]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
conf: better <disk> interleaving in schema
authorEric Blake <eblake@redhat.com>
Mon, 14 Apr 2014 22:54:12 +0000 (16:54 -0600)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 15 Apr 2014 09:45:02 +0000 (11:45 +0200)
commita9efe2d70cd43a5c60163a1873a7adc146e9efaf
tree671b52400874144e52990838a6106f17b97fbc5b
parent6077be466efcc2d57679e59db8a4b1626ed0757c
conf: better <disk> interleaving in schema

In general, we try to make virt-xml-validate tolerant of input
elements in any order when possible.  However, as written, the
RNG grammar did not permit <source> unless there was an explicit
type= attribute (even though the C code manages just fine by
defaulting to type='file').  After making the attribute optional
on the 'file' branch, I noticed that the use of diskspec was now
redundant with the branch when no <source> was supplied.

View this patch with 'git diff -b' for a better picture of the
schema change.

* docs/schemas/domaincommon.rng (disk): Hoist 'diskspec' out of
choice, make type='file' default, and still preserve interleave.
* tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-source-pool.xml:
* tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-discard.xml:
New files.
* tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml:
* tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.xml:
Reorder XML.
* tests/qemuxml2xmltest.c (mymain): Cover new files.

Signed-off-by: Eric Blake <eblake@redhat.com>
docs/schemas/domaincommon.rng
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.xml
tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml
tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-discard.xml [new file with mode: 0644]
tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-source-pool.xml [new file with mode: 0644]
tests/qemuxml2xmltest.c