]> xenbits.xensource.com Git - libvirt.git/commit
seclabel: fix regression in libvirtd restart
authorEric Blake <eblake@redhat.com>
Wed, 4 Jan 2012 23:01:24 +0000 (16:01 -0700)
committerDaniel Veillard <veillard@redhat.com>
Thu, 5 Jan 2012 09:05:02 +0000 (17:05 +0800)
commit302fe95ffa1bc5f1c61c0beb31a1adfbc38c668e
tree0255f5d4ef70ec240821d6228bd1d6b87eade41f
parentdb371a217d5461f297867daef396b78e3616002b
seclabel: fix regression in libvirtd restart

Commit b434329 has a logic bug: seclabel overrides don't set
def->type, but the default value is 0 (aka static).  Restarting
libvirtd would thus reject the XML for any domain with an
override of <seclabel relabel='no'/> (which happens quite
easily if a disk image lives on NFS), with a message:

2012-01-04 22:29:40.949+0000: 6769: error : virSecurityLabelDefParseXMLHelper:2593 : XML error: security label is missing

Fix the logic to never read from an override's def->type, and
to allow a missing <label> subelement when relabel is no.  There's
a lot of stupid double-negatives in the code (!norelabel) because
of the way that we want the zero-initialized defaults to behave.

* src/conf/domain_conf.c (virSecurityLabelDefParseXMLHelper): Use
type field from correct location.
src/conf/domain_conf.c