]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: fix omission of <driver> in domain dumpxml
authorEric Blake <eblake@redhat.com>
Mon, 14 Apr 2014 22:54:19 +0000 (16:54 -0600)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 16 Apr 2014 08:49:07 +0000 (10:49 +0200)
commit8fb446754deda2f9d953eeb854a5aa050c8599f5
tree31ec159d60cbd177cedc77862ce0fb7bec5151bb
parentfec1a93927c860934b4e983dce4ecbbe44485a93
conf: fix omission of <driver> in domain dumpxml

I noticed that depending on the <driver> attributes the user passed
in, the output may omit the <driver> element altogether.  For example,
the rerror_policy has had this problem since commit 4bb4109 in Oct
2011.  But in adding testsuite coverage to expose it, I found another
problem: the C code is just fine without a driver name, but the
XML validator required either a name or a cache mode.

* src/conf/domain_conf.c (virDomainDiskDefFormat): Update
conditional.
* docs/schemas/domaincommon.rng (diskDriver): Simplify.
* tests/qemuxml2argvdata/qemuxml2argv-disk-drive-copy-on-read.xml:
* tests/qemuxml2argvdata/qemuxml2argv-disk-drive-copy-on-read.args:
New files.
* tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.xml:
Enhance test.
* tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-discard.xml:
Likewise.
* tests/qemuxml2argvtest.c (mymain): New test.
* tests/qemuxml2xmltest.c (mymain): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-copy-on-read.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-copy-on-read.xml [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.xml
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-discard.xml
tests/qemuxml2xmltest.c