[libvirt] domain.rng updated ?

Eric Blake eblake at redhat.com
Thu Feb 10 17:24:48 UTC 2011


On 02/10/2011 09:59 AM, arnaud.champion at devatom.fr wrote:
> ?Hi,
> 
> I'm working on C# bindings, my goal is to expose xml descriptions (domain, node, storage and so on...) as real C# objects, for this, I'm studying the rng files provided in /docs/schemas/ directory of the sources. I'm currently working on domain.rng.
> I don't know if the domain.rng file is up to date because, for example, the disk device definition in the rng doesn't speak about the "address" node that a virhs dumpxml show :
> 
> <disk type='file' device='disk'>
>       <driver name='qemu' type='raw'/>
>       <source file='/var/lib/libvirt/image/Ubuntu-10.10.img'/>
>       <target dev='hda' bus='ide'/>
>       <address type='drive' controller='0' bus='0' unit='0'/>
> </disk>

Actually, it does permit the <address> sub-element:

<define name="disk"> defines the <element name="disk">, then a <choice>
that selects the <group> with <attribute name="type"> of file, as well
as an <interleave> that includes <ref name="diskspec"/>.

<define name="diskspec"> includes an <optional> <ref name="address"/>,
which covers the <address> you were asking about.

> 
> Is the domain.rng up to date or should I use the libvirt.org XML format page only ?

The libvirt.org XML format page (generated from
docs/formatdomain.html.in) is supposed to match domain.rng; if they
don't, that's a documentation bug and should be fixed.

Meanwhile, domain.rng is a subset of actual XML parsed by the code;
there are some additional elements, such as <alias>, that can only be
present in a live xml dump but are ignored for defining or creating a
domain.  The rule of thumb is that if 'virsh dumpxml --inactive' can
produce an element, then domain.rng should permit it and
formatdomain.html.in should document it.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110210/5d5469fa/attachment-0001.sig>


More information about the libvir-list mailing list