From 9b8ee6d0f289983803831f320e3adf1d65494efd Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Thu, 20 Jun 2013 18:27:04 +0800 Subject: [PATCH] conf: Requires either uuid or usage of secret As the RNG schema for disk auth secret implies, it requires either "uuid" or "usage": ceph iscsi --- src/conf/domain_conf.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 23733973b6..92979372fb 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4972,6 +4972,14 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt, _("only one of uuid and usage can be specified")); goto error; } + + if (!authUUID && !authUsage) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("either uuid or usage should be " + "specified for a secret")); + goto error; + } + if (authUUID != NULL) { def->auth.secretType = VIR_DOMAIN_DISK_SECRET_TYPE_UUID; if (virUUIDParse(authUUID, -- 2.39.5