[libvirt] [PATCH] schema: Move timer element inside clock

Both conf/domain_conf.c and domain XML documentation have <timer> elements inside /domain/clock. Change domain.rng schema to be consistent with them. --- docs/schemas/domain.rng | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng index aaf9667..5a8576c 100644 --- a/docs/schemas/domain.rng +++ b/docs/schemas/domain.rng @@ -348,9 +348,6 @@ </interleave> </define> <define name="clock"> - <zeroOrMore> - <ref name="timer"/> - </zeroOrMore> <optional> <element name="clock"> <choice> @@ -381,7 +378,9 @@ </optional> </group> </choice> - <empty/> + <zeroOrMore> + <ref name="timer"/> + </zeroOrMore> </element> </optional> </define> -- 1.7.3.2

On 11/08/2010 04:31 AM, Jiri Denemark wrote:
Both conf/domain_conf.c and domain XML documentation have <timer> elements inside /domain/clock. Change domain.rng schema to be consistent with them. --- docs/schemas/domain.rng | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
Conditional ACK: you also need to add at least one .xml file somewhere under tests that uses a <timer> element, so that we can test that the fixed .rng file validates our intended usage. Right now: $ git grep '<timer' tests shows that we have no testsuite exposure of this element. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

Both conf/domain_conf.c and domain XML documentation have <timer> elements inside /domain/clock. Change domain.rng schema to be consistent with them. --- docs/schemas/domain.rng | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
Conditional ACK: you also need to add at least one .xml file somewhere under tests that uses a <timer> element, so that we can test that the fixed .rng file validates our intended usage. Right now:
$ git grep '<timer' tests
shows that we have no testsuite exposure of this element.
Good point. That is actually the reason why no-one noticed the schema was not correct. The following XML makes domainschematest fail with current HEAD while the test succeeds with the corrected schema. tests/domainschemadata/timers.xml | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) create mode 100644 tests/domainschemadata/timers.xml diff --git a/tests/domainschemadata/timers.xml b/tests/domainschemadata/timers.xml new file mode 100644 index 0000000..c1baa2c --- /dev/null +++ b/tests/domainschemadata/timers.xml @@ -0,0 +1,28 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory>219200</memory> + <currentMemory>219200</currentMemory> + <vcpu>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'> + <timer name='pit' tickpolicy='delay'/> + <timer name='hpet'/> + </clock> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='block' device='disk'> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <memballoon model='virtio'/> + </devices> +</domain>

On Tue, Nov 09, 2010 at 12:08:27PM +0100, Jiri Denemark wrote:
Both conf/domain_conf.c and domain XML documentation have <timer> elements inside /domain/clock. Change domain.rng schema to be consistent with them. --- docs/schemas/domain.rng | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
Conditional ACK: you also need to add at least one .xml file somewhere under tests that uses a <timer> element, so that we can test that the fixed .rng file validates our intended usage. Right now:
$ git grep '<timer' tests
shows that we have no testsuite exposure of this element.
Good point. That is actually the reason why no-one noticed the schema was not correct. The following XML makes domainschematest fail with current HEAD while the test succeeds with the corrected schema.
tests/domainschemadata/timers.xml | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) create mode 100644 tests/domainschemadata/timers.xml
diff --git a/tests/domainschemadata/timers.xml b/tests/domainschemadata/timers.xml new file mode 100644 index 0000000..c1baa2c --- /dev/null +++ b/tests/domainschemadata/timers.xml @@ -0,0 +1,28 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory>219200</memory> + <currentMemory>219200</currentMemory> + <vcpu>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'> + <timer name='pit' tickpolicy='delay'/> + <timer name='hpet'/> + </clock> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='block' device='disk'> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <memballoon model='virtio'/> + </devices> +</domain>
ACK for a patch with that test added :-) Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (3)
-
Daniel Veillard
-
Eric Blake
-
Jiri Denemark