]> xenbits.xensource.com Git - libvirt.git/commit
nodedev: Convert virNodeDeviceObjListPtr to use hash tables
authorJohn Ferlan <jferlan@redhat.com>
Thu, 29 Jun 2017 19:50:06 +0000 (15:50 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 24 Jul 2017 16:19:34 +0000 (12:19 -0400)
commit4ae9dbea99cf20f0f33f60e63f2d7296bf3873e3
tree5c0f3fb8c7cc6d5f68dab6986d6f07d1880ce04d
parent8f6679d9f69c0e2f859d5f2412b1de8bb67964ff
nodedev: Convert virNodeDeviceObjListPtr to use hash tables

Rather than use a forward linked list of elements, it'll be much more
efficient to use a hash table to reference the elements by unique name
and to perform hash searches.

This patch does all the heavy lifting of converting the list object to
use a self locking list that contains the hash table. Each of the FindBy
functions that do not involve finding the object by it's key (name) is
converted to use virHashSearch in order to find the specific object.
When searching for the key (name), it's possible to use virHashLookup.
For any of the list perusal functions that are required to evaluate
each object, the virHashForEach function is used.
src/conf/virnodedeviceobj.c