libvirt/src/conf
Daniel P. Berrange a3adcce795 Convert virDomainObjListPtr to use a hash of domain objects
The current virDomainObjListPtr object stores domain objects in
an array. This means that to find a particular objects requires
O(n) time, and more critically acquiring O(n) mutex locks.

The new impl replaces the array with a virHashTable, keyed off
UUID. Finding a object based on UUID is now O(1) time, and only
requires a single mutex lock. Finding by name/id is unchanged
in complexity.

In changing this, all code which iterates over the array had
to be updated to use a hash table iterator function callback.
Several of the functions which were identically duplicating
across all drivers were pulled into domain_conf.c

* src/conf/domain_conf.h, src/conf/domain_conf.c: Change
  virDomainObjListPtr to use virHashTable. Add a initializer
  method virDomainObjListInit, and rename virDomainObjListFree
  to virDomainObjListDeinit, since its not actually freeing
  the container, only its contents. Also add some convenient
  methods virDomainObjListGetInactiveNames,
  virDomainObjListGetActiveIDs and virDomainObjListNumOfDomains
  which can be used to implement the correspondingly named
  public API entry points in drivers
* src/libvirt_private.syms: Export new methods from domain_conf.h
* src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
  src/openvz/openvz_conf.c, src/openvz/openvz_driver.c,
  src/qemu/qemu_driver.c, src/test/test_driver.c,
  src/uml/uml_driver.c, src/vbox/vbox_tmpl.c: Update all code
  to deal with hash tables instead of arrays for domains
2009-10-28 20:05:55 +00:00
..
capabilities.c Take domain type into account when looking up default machine 2009-10-12 10:57:35 +01:00
capabilities.h Take domain type into account when looking up default machine 2009-10-12 10:57:35 +01:00
domain_conf.c Convert virDomainObjListPtr to use a hash of domain objects 2009-10-28 20:05:55 +00:00
domain_conf.h Convert virDomainObjListPtr to use a hash of domain objects 2009-10-28 20:05:55 +00:00
domain_event.c Move all XML configuration handling to src/conf/ 2009-09-21 14:41:46 +01:00
domain_event.h Move all XML configuration handling to src/conf/ 2009-09-21 14:41:46 +01:00
interface_conf.c Maintain value of ctxt->node in virInterfaceDefParseDhcp 2009-09-29 11:16:04 +02:00
interface_conf.h Move all XML configuration handling to src/conf/ 2009-09-21 14:41:46 +01:00
network_conf.c Add support for an external TFTP boot server 2009-10-28 15:57:49 +01:00
network_conf.h Add support for an external TFTP boot server 2009-10-28 15:57:49 +01:00
node_device_conf.c Fix potential false-positive OOM error reporting. 2009-10-22 15:25:45 +02:00
node_device_conf.h node device: Break out get_wwns and get_parent_node helpers 2009-10-20 14:17:35 -04:00
secret_conf.c Move all XML configuration handling to src/conf/ 2009-09-21 14:41:46 +01:00
secret_conf.h Move all XML configuration handling to src/conf/ 2009-09-21 14:41:46 +01:00
storage_conf.c storage: Add ParseSourceString function for use with FindPoolSources. 2009-10-28 11:30:40 -04:00
storage_conf.h storage: Add ParseSourceString function for use with FindPoolSources. 2009-10-28 11:30:40 -04:00
storage_encryption_conf.c Move all XML configuration handling to src/conf/ 2009-09-21 14:41:46 +01:00
storage_encryption_conf.h Move all XML configuration handling to src/conf/ 2009-09-21 14:41:46 +01:00