[libvirt] [PATCH v5.1 02/11] conf: Add post XML parse callbacks and prepare for cleaning of virCaps

Daniel P. Berrange berrange at redhat.com
Thu Apr 4 17:01:59 UTC 2013


On Thu, Apr 04, 2013 at 02:10:12PM +0200, Peter Krempa wrote:
> 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 requesing 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.
> ---
>  src/conf/domain_conf.c           | 101 +++++++++++++++++++++++++++++++++++++--
>  src/conf/domain_conf.h           |  26 ++++++++--
>  src/esx/esx_driver.c             |   2 +-
>  src/libxl/libxl_driver.c         |  11 +++--
>  src/lxc/lxc_conf.c               |   4 +-
>  src/lxc/lxc_driver.c             |   6 ++-
>  src/openvz/openvz_conf.c         |   1 +
>  src/openvz/openvz_driver.c       |   6 +--
>  src/parallels/parallels_driver.c |   2 +-
>  src/phyp/phyp_driver.c           |   6 +--
>  src/qemu/qemu_conf.c             |   5 +-
>  src/qemu/qemu_driver.c           |  11 +++--
>  src/security/virt-aa-helper.c    |   2 +-
>  src/test/test_driver.c           |   2 +-
>  src/uml/uml_driver.c             |   7 ++-
>  src/vbox/vbox_tmpl.c             |  10 ++--
>  src/vmware/vmware_driver.c       |   2 +-
>  src/xen/xen_driver.c             |   2 +-
>  src/xen/xend_internal.c          |   6 +--
>  src/xen/xm_internal.c            |   2 +
>  src/xenapi/xenapi_driver.c       |   2 +-
>  tests/testutilsxen.c             |   2 +-
>  tests/xml2vmxtest.c              |   2 +-
>  23 files changed, 174 insertions(+), 46 deletions(-)

ACK


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list