From 24555136bf42e14f81c4fe1106e36052cb7b32cc Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Wed, 13 Jul 2016 11:16:45 +0100 Subject: [PATCH] Don't error when attaching security label of model "none" If you invoke virDomainLxcEnterSecurityLabel() on security model of "none" it will report an error. Logically a "none" security model should be treated as a no-op, so we should just return success immediately, instead of an error. Signed-off-by: Daniel P. Berrange --- src/libvirt-lxc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libvirt-lxc.c b/src/libvirt-lxc.c index 16e08e9db8..c487ecebab 100644 --- a/src/libvirt-lxc.c +++ b/src/libvirt-lxc.c @@ -257,6 +257,8 @@ virDomainLxcEnterSecurityLabel(virSecurityModelPtr model, _("Support for AppArmor is not enabled")); goto error; #endif + } else if (STREQ(model->model, "none")) { + /* nothing todo */ } else { virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, _("Security model %s cannot be entered"),