]> git.ipfire.org Git - thirdparty/libvirt.git/commit
seclabel: allow a seclabel override on a disk src
authorEric Blake <eblake@redhat.com>
Fri, 23 Dec 2011 00:47:50 +0000 (17:47 -0700)
committerDaniel Veillard <veillard@redhat.com>
Fri, 30 Dec 2011 02:57:59 +0000 (10:57 +0800)
commitb43432931aef92325920953ff92beabfbe5224c8
tree31f840cb48fa5a7f4014349591b165f5eb81a642
parent6cb4acce8b136e0dd2afa647b9b8cdf7c1702aed
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.
src/conf/domain_conf.c
src/conf/domain_conf.h
tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-override.args [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/qemuxml2xmltest.c