diff options
author | Eric Blake <eblake@redhat.com> | 2011-12-22 17:47:50 -0700 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2011-12-30 10:57:59 +0800 |
commit | b43432931aef92325920953ff92beabfbe5224c8 (patch) | |
tree | 31f840cb48fa5a7f4014349591b165f5eb81a642 /tests/qemuxml2xmltest.c | |
parent | seclabel: extend XML to allow per-disk label overrides (diff) | |
download | libvirt-b43432931aef92325920953ff92beabfbe5224c8.tar.gz libvirt-b43432931aef92325920953ff92beabfbe5224c8.tar.bz2 libvirt-b43432931aef92325920953ff92beabfbe5224c8.zip |
seclabel: allow a seclabel override on a disk src
Implement the parsing and formatting of the XML addition of
the previous commit. The new XML doesn't affect qemu command
line, so we can now test round-trip XML->memory->XML handling.
I chose to reuse the existing structure, even though per-device
override doesn't use all of those fields, rather than create a
new structure, in order to reuse more code.
* src/conf/domain_conf.h (_virDomainDiskDef): Add seclabel member.
* src/conf/domain_conf.c (virDomainDiskDefFree): Free it.
(virSecurityLabelDefFree): New function.
(virDomainDiskDefFormat): Print it.
(virSecurityLabelDefFormat): Reduce output if model not present.
(virDomainDiskDefParseXML): Alter signature, and parse seclabel.
(virSecurityLabelDefParseXML): Split...
(virSecurityLabelDefParseXMLHelper): ...into new helper.
(virDomainDeviceDefParse, virDomainDefParseXML): Update callers.
* tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-override.args:
New file.
* tests/qemuxml2xmltest.c (mymain): Enhance test.
* tests/qemuxml2argvtest.c (mymain): Likewise.
Diffstat (limited to 'tests/qemuxml2xmltest.c')
-rw-r--r-- | tests/qemuxml2xmltest.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index e4b99c40e..0a8a28e3d 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -195,6 +195,7 @@ mymain(void) DO_TEST("blkdeviotune"); DO_TEST("seclabel-dynamic-baselabel"); + DO_TEST("seclabel-dynamic-override"); DO_TEST("seclabel-static"); /* These tests generate different XML */ |