]> xenbits.xensource.com Git - libvirt.git/commit
conf: use a hash table for storing nwfilter object list
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 8 Mar 2022 17:01:36 +0000 (17:01 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 17 Mar 2022 11:39:53 +0000 (11:39 +0000)
commitc4fb52dc72b312431a3a28e3a163b38441a95665
tree4782762568ae33875c9ba5f4efc055a5e99af8c3
parenta19f1e7fc8bbae7f0b612fda58add608c681c3ae
conf: use a hash table for storing nwfilter object list

The current use of an array for nwfilter objects requires
the caller to iterate over all elements to find a filter,
and also requires locking each filter.

Switching to a pair of hash tables enables O(1) lookups
both by name and uuid, with no locking required.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/conf/virnwfilterobj.c
src/nwfilter/nwfilter_gentech_driver.c