[libvirt] [BUG, ½PATCH] domain.rng vs. formatdomain.html#elementsUSB

Hello, I just tried to validate the minimal <hostdev>-example from <http://libvirt.org/formatdomain.html#elementsUSB>, which failed. <domain type='xen'> <name>N</name> <memory>123456</memory> <bootloader>/usr/bin/pygrub</bootloader> <os> <type arch='x86_64' machine='xenpv'>linux</type> </os> <devices> <hostdev mode='subsystem' type='pci'> <source> <address bus='0x06' slot='0x00' function='0x0'/> </source> </hostdev> </devices> </domain> This is caused by domain.rng requiring either all three attributes ("mode", "type", and the undocumented "managed") to be defined or non of them; just a subset of them is not allowed because the all reside in the same <optional>-section. Since I don't know, which of the three attributes must be defined in concert, and which is optional, I just post a patch to make all three self-standing. diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng index 8b215f3..11a987e 100644 --- a/docs/schemas/domain.rng +++ b/docs/schemas/domain.rng @@ -1731,12 +1731,16 @@ <value>capabilities</value> </choice> </attribute> + </optional> + <optional> <attribute name="type"> <choice> <value>usb</value> <value>pci</value> </choice> </attribute> + </optional> + <optional> <attribute name="managed"> <choice> <value>yes</value> Also the "managed" attribute should be documented on that page. Any internal documentation (read: code) for that? Sincerely Philipp -- Philipp Hahn Open Source Software Engineer hahn@univention.de Univention GmbH Linux for Your Business fon: +49 421 22 232- 0 Mary-Somerville-Str.1 28359 Bremen fax: +49 421 22 232-99 http://www.univention.de/ ** Besuchen Sie uns auf der CeBIT in Hannover ** ** Auf dem Univention Stand D36 in Halle 2 ** ** Vom 01. bis 05. März 2011 **

On 02/24/2011 04:46 AM, Philipp Hahn wrote:
This is caused by domain.rng requiring either all three attributes ("mode", "type", and the undocumented "managed") to be defined or non of them; just a subset of them is not allowed because the all reside in the same <optional>-section.
Good catch.
Since I don't know, which of the three attributes must be defined in concert, and which is optional, I just post a patch to make all three self-standing.
diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng index 8b215f3..11a987e 100644 --- a/docs/schemas/domain.rng +++ b/docs/schemas/domain.rng @@ -1731,12 +1731,16 @@ <value>capabilities</value> </choice> </attribute> + </optional> + <optional> <attribute name="type"> <choice> <value>usb</value> <value>pci</value> </choice> </attribute> + </optional> + <optional> <attribute name="managed"> <choice> <value>yes</value>
Without reading the code yet, I'm guessing that this is probably correct. And I agree that we should also fix docs/formatdomain.html.in at the same time as this goes in.
Also the "managed" attribute should be documented on that page. Any internal documentation (read: code) for that?
src/conf/domain_conf.c -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Philipp Hahn