]> xenbits.xensource.com Git - libvirt.git/commitdiff
Don't error when attaching security label of model "none"
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 13 Jul 2016 10:16:45 +0000 (11:16 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 3 Aug 2016 09:58:31 +0000 (10:58 +0100)
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 <berrange@redhat.com>
src/libvirt-lxc.c

index 16e08e9db8a9f130d4b74bf8dc520acef5614d77..c487ecebabf767b97d855d12e8f40d3a68778001 100644 (file)
@@ -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"),