]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Allow for a driver specific private data blob in virDomainObjPtr
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 6 Oct 2009 11:50:58 +0000 (12:50 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 2 Nov 2009 16:03:10 +0000 (11:03 -0500)
commit3505790b85da55c16191a9dca46404c29e0b7f87
tree0e1369a76ac36d42ab101edbcd4bd63e8baef26e
parent530d4463ba447a6034371b07dd9c0d7903cb9fa5
Allow for a driver specific private data blob in virDomainObjPtr

The virDomainObjPtr object stores state about a running domain.
This object is shared across all drivers so it is not appropriate
to include driver specific state here. This patch adds the ability
to request a blob of private data per domain object instance. The
driver must provide a allocator & deallocator for this purpose

THis patch abuses the virCapabilitiesPtr structure for storing the
allocator/deallocator callbacks, since it is already being abused
for other internal things relating to parsing. This should be moved
out into a separate object at some point.

* src/conf/capabilities.h: Add privateDataAllocFunc and
  privateDataFreeFunc fields
* src/conf/domain_conf.c: Invoke the driver allocators / deallocators
  when creating/freeing virDomainObjPtr instances.
* src/conf/domain_conf.h: Pass virCapsPtr into virDomainAssignDef
  to allow access to the driver specific allocator function
* src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
  src/openvz/openvz_driver.c, src/qemu/qemu_driver.c,
  src/test/test_driver.c, src/uml/uml_driver.c: Update for
  change in virDomainAssignDef contract
src/conf/capabilities.h
src/conf/domain_conf.c
src/conf/domain_conf.h
src/lxc/lxc_driver.c
src/opennebula/one_driver.c
src/openvz/openvz_driver.c
src/qemu/qemu_driver.c
src/test/test_driver.c
src/uml/uml_driver.c