[libvirt] [PATCH v5.1 02/11] conf: Add post XML parse callbacks and prepare for cleaning of virCaps
Eric Blake
eblake at redhat.com
Thu Apr 4 17:10:11 UTC 2013
On 04/04/2013 06:10 AM, 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
s/requesing/requesting/
> 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.
> ---
> + if (xmlopt && xmlopt->config.devicesPostParseCallback) {
> + ret = xmlopt->config.devicesPostParseCallback(dev, def, caps,
> + xmlopt->config.priv);
Indentation is off.
> + /* call the domain config callback */
> + if (xmlopt && xmlopt->config.domainPostParseCallback) {
> + ret = xmlopt->config.domainPostParseCallback(def, caps,
> + xmlopt->config.priv);
and again
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130404/ac101350/attachment-0001.sig>
More information about the libvir-list
mailing list