[libvirt] Generic processing of xml data

Eric Blake eblake at redhat.com
Wed Feb 1 15:41:37 UTC 2012


On 02/01/2012 07:01 AM, Hendrik Schwartke wrote:
> There are some changes made to the conf code to handle some new tags
> like <title> or to add some "metadata" to a domain description in the
> last days.
> I'm wondering if there is a more generic (read better) way to handle
> those extra data in xml config elements.
> I think it would be far more reasonable to use xml namespaces to enable
> libvirt to differentiate between config options which it has to process
> and data which are unknown to libvirt and thus are only stored without
> any further processing.

That's precisely what we have already started implementing.  We added
the <metadata> element that takes one sub-element per namespace for use
by however the application sees fit:
https://www.redhat.com/archives/libvir-list/2012-January/msg00943.html
and have a pending API to allow runtime manipulation of that metadata:
https://www.redhat.com/archives/libvir-list/2012-February/msg00032.html

> 
> This distinction could then by easily used for expansions like the
> <title>-tag, to store the x- and y-position of a guest in a graphical
> visualization of virtual networks, to add some names of administrators
> which are responsible for the guests, to add some hints to interfaces
> concerning quality of service, etc...
> 
> I don't know how complex such in implementation would be but I think it
> would be worth the effort.

Right now, the only missing part is wiring up the proposed API from
Peter's series to actually modify the XML from Zeeshan's patch, if you'd
like to help with that.

-- 
Eric Blake   eblake at 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: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120201/de4c4ec3/attachment-0001.sig>


More information about the libvir-list mailing list