aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-08-10 14:04:17 +0100
committerDaniel P. Berrange <berrange@redhat.com>2012-08-14 15:31:26 +0100
commit51b23ed31a5915ed437e4dd149bc4c8e04a4bcc4 (patch)
tree0b8e372b65635e288b6cf58ec1f953d1f7dfbb4c /src/security
parentAdd missing domain_conf.h include in security_manager.h (diff)
downloadlibvirt-51b23ed31a5915ed437e4dd149bc4c8e04a4bcc4.tar.gz
libvirt-51b23ed31a5915ed437e4dd149bc4c8e04a4bcc4.tar.bz2
libvirt-51b23ed31a5915ed437e4dd149bc4c8e04a4bcc4.zip
Use VIR_ERR_CONFIG_UNSUPPORTED if requested security driver is disabled
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>
Diffstat (limited to 'src/security')
-rw-r--r--src/security/security_driver.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/security/security_driver.c b/src/security/security_driver.c
index 7ff5f1786..f450a9437 100644
--- a/src/security/security_driver.c
+++ b/src/security/security_driver.c
@@ -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: