]> git.ipfire.org Git - thirdparty/libvirt.git/commit
lxc: Set default security model in XML parser config
authorJim Fehlig <jfehlig@suse.com>
Thu, 3 Dec 2020 18:55:24 +0000 (11:55 -0700)
committerJim Fehlig <jfehlig@suse.com>
Mon, 7 Dec 2020 17:41:15 +0000 (10:41 -0700)
commitcf4e7e620a3ecd109f23c8cdb577893d0e088201
tree92590ceb0a1f8b29a345596067332dacd58a7c6a
parentf6c11a23c8b83525722fd122b9767f10c7de4aac
lxc: Set default security model in XML parser config

Attempting to create a lxc domain with <seclabel type='none'/> fails

virsh --connect lxc:/// create distro_nosec.xml
error: Failed to create domain from distro_nosec.xml
error: unsupported configuration: Security driver model '(null)' is not available

Commit 638ffa2228 adjusted the logic for setting a driver's default
security model.

The lxc driver does not set a default security driver model in the XML
parser config, causing seclabels of type='none' to have a null model.
The lxc driver's security manager is initialized in lxcStateInitialize()
by calling lxcSecurityInit(). Use the model of this manager as the
default in the XML parser config.

For the record, this is a regression caused by commit 638ffa2228, which
changed the logic for setting a driver's default security model. The
qemu driver was adjusted accordingly, but a similar change was missed
in the lxc driver.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/lxc/lxc_conf.c
src/lxc/lxc_conf.h
src/lxc/lxc_controller.c
src/lxc/lxc_driver.c
tests/testutilslxc.c