Re: [libvirt] [PATCH v6 3/4] nodedev: Convert virNodeDeviceObjListPtr to use hash tables

2017-07-24 Thread Erik Skultety
> >> Replies don't include your patch; however, I will note if you jump to > >> patch 13: > > > > What do you mean? Don't you see squash.patch in the attachment? (yes, I > > attached a patch instead of inlining it, the reason for that being that the > > patch is not particularly small and inlining

Re: [libvirt] [PATCH v6 3/4] nodedev: Convert virNodeDeviceObjListPtr to use hash tables

2017-07-24 Thread John Ferlan
On 07/24/2017 09:08 AM, Erik Skultety wrote: virNodeDeviceObjPtr virNodeDeviceObjListFindBySysfsPath(virNodeDeviceObjListPtr devs, const char *sysfs_path) { -size_t i; +virNodeDeviceObjPtr obj; -for (i = 0

Re: [libvirt] [PATCH v6 3/4] nodedev: Convert virNodeDeviceObjListPtr to use hash tables

2017-07-24 Thread Erik Skultety
> >> virNodeDeviceObjPtr > >> virNodeDeviceObjListFindBySysfsPath(virNodeDeviceObjListPtr devs, > >> const char *sysfs_path) > >> { > >> -size_t i; > >> +virNodeDeviceObjPtr obj; > >> > >> -for (i = 0; i < devs->count; i++) { > >> -virNode

Re: [libvirt] [PATCH v6 3/4] nodedev: Convert virNodeDeviceObjListPtr to use hash tables

2017-07-24 Thread John Ferlan
On 07/24/2017 03:52 AM, Erik Skultety wrote: > On Thu, Jul 20, 2017 at 10:08:14AM -0400, John Ferlan wrote: >> 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. >> >> Thi

Re: [libvirt] [PATCH v6 3/4] nodedev: Convert virNodeDeviceObjListPtr to use hash tables

2017-07-24 Thread Erik Skultety
On Thu, Jul 20, 2017 at 10:08:14AM -0400, John Ferlan wrote: > 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 l

[libvirt] [PATCH v6 3/4] nodedev: Convert virNodeDeviceObjListPtr to use hash tables

2017-07-20 Thread John Ferlan
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. Ea