]> xenbits.xensource.com Git - libvirt.git/commitdiff
Use VIR_ERR_CONFIG_UNSUPPORTED if requested security driver is disabled
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 10 Aug 2012 13:04:17 +0000 (14:04 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 14 Aug 2012 14:31:26 +0000 (15:31 +0100)
There is currently no way to distinguish the case that a requested
security driver was disabled, from the case where no security driver
was available. Use VIR_ERR_CONFIG_UNSUPPORTED as the error when an
explicitly requested security driver was disabled

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/security/security_driver.c

index 7ff5f1786d6f46fa25aaa300b9f094de0d6577df..f450a94372886ee6271332e2ec5d49eecb348609 100644 (file)
@@ -72,6 +72,12 @@ virSecurityDriverPtr virSecurityDriverLookup(const char *name,
 
         case SECURITY_DRIVER_DISABLE:
             VIR_DEBUG("Not enabled name=%s", tmp->name);
+            if (name && STREQ(tmp->name, name)) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                               _("Security driver %s not enabled"),
+                               name);
+                return NULL;
+            }
             break;
 
         default: