]> git.ipfire.org Git - thirdparty/libvirt.git/commit
seclabel: make code and RNG match
authorEric Blake <eblake@redhat.com>
Sat, 4 Feb 2012 14:01:56 +0000 (07:01 -0700)
committerEric Blake <eblake@redhat.com>
Mon, 6 Feb 2012 19:04:33 +0000 (12:04 -0700)
commitc052d8a89f6df81822abbd0a3204d47f402f6de4
treef472eed9a8f28673bd58733eea6d32216df000e5
parent13545647ba54fbb5cd5c4f18b1e8f83cacc57fe5
seclabel: make code and RNG match

Commit b170eb99 introduced a bug: domains that had an explicit
<seclabel type='none'/> when started would not be reparsed if
libvirtd restarted.  It turns out that our testsuite was not
exercising this because it never tried anything but inactive
parsing.  Additionally, the live XML for such a domain failed
to re-validate.  Applying just the tests/ portion of this patch
will expose the bugs that are fixed by the other two files.

* docs/schemas/domaincommon.rng (seclabel): Allow relabel under
type='none'.
* src/conf/domain_conf.c (virSecurityLabelDefParseXML): Per RNG,
presence of <seclabel> with no type implies dynamic.  Don't
require sub-elements for type='none'.
* tests/qemuxml2xmltest.c (mymain): Add test.
* tests/qemuxml2argvtest.c (mymain): Likewise.
* tests/qemuxml2argvdata/qemuxml2argv-seclabel-none.xml: Add file.
* tests/qemuxml2argvdata/qemuxml2argv-seclabel-none.args: Add file.
Reported by Ansis Atteka.
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
tests/qemuxml2argvdata/qemuxml2argv-seclabel-none.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-seclabel-none.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/qemuxml2xmltest.c