]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: Add post XML parse callbacks and prepare for cleaning of virCaps
authorPeter Krempa <pkrempa@redhat.com>
Tue, 19 Feb 2013 16:29:39 +0000 (17:29 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 4 Apr 2013 20:29:48 +0000 (22:29 +0200)
commit43b99fc4c0df3a2bb1eef83691ab53496a2eaca4
treec19cb63538ca6d7e30ab63ee093bec0250f8959d
parente84b19316a72aa969286f9c41bc0e0b7d005f754
conf: Add post XML parse callbacks and prepare for cleaning of virCaps

This patch adds instrumentation that will allow hypervisor drivers to
fill and validate domain and device definitions after parsed by the XML
parser.

With this patch, after the XML is parsed, a callback to the driver is
issued requesting to fill and validate driver specific details of the
configuration. This allows to use sensible defaults and checks on a per
driver basis at the time the XML is parsed.

Two callback pointers are stored in the new virDomainXMLConf object:
* virDomainDeviceDefPostParseCallback (devicesPostParseCallback)
  - called for a single device parsed and for every single device in a
    domain config. A virDomainDeviceDefPtr is passed along with the
    domain definition and virCaps.

* virDomainDefPostParseCallback, (domainPostParseCallback)
  - A callback that is meant to process the domain config after it's
  parsed.  A virDomainDefPtr is passed along with virCaps.

Both types of callbacks support arbitrary opaque data passed for the
callback functions.

Errors may be reported in those callbacks resulting in a XML parsing
failure.
23 files changed:
src/conf/domain_conf.c
src/conf/domain_conf.h
src/esx/esx_driver.c
src/libxl/libxl_driver.c
src/lxc/lxc_conf.c
src/lxc/lxc_driver.c
src/openvz/openvz_conf.c
src/openvz/openvz_driver.c
src/parallels/parallels_driver.c
src/phyp/phyp_driver.c
src/qemu/qemu_conf.c
src/qemu/qemu_driver.c
src/security/virt-aa-helper.c
src/test/test_driver.c
src/uml/uml_driver.c
src/vbox/vbox_tmpl.c
src/vmware/vmware_driver.c
src/xen/xen_driver.c
src/xen/xend_internal.c
src/xen/xm_internal.c
src/xenapi/xenapi_driver.c
tests/testutilsxen.c
tests/xml2vmxtest.c