[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCHv7 2/2] domain: conf: Fix secret type checking for network volumes



This patch fixes the secret type checking done in the
virDomainDiskDefParseXML function. Previously, it would not allow any
volumes that utilized a secret. This patch is a simple bypass of the
checking code for volumes.

Signed-off-by: Adam Walters <adam pandorasboxen com>
---
 src/conf/domain_conf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 28e24f9..773dc26 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5418,7 +5418,8 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
         cur = cur->next;
     }
 
-    if (auth_secret_usage != -1 && auth_secret_usage != expected_secret_usage) {
+    if (auth_secret_usage != -1 && auth_secret_usage != expected_secret_usage &&
+        def->type != VIR_DOMAIN_DISK_TYPE_VOLUME) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("invalid secret type '%s'"),
                        virSecretUsageTypeTypeToString(auth_secret_usage));
@@ -18214,7 +18215,8 @@ virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
     if (!disk->src || disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK ||
         (disk->type == VIR_DOMAIN_DISK_TYPE_VOLUME &&
          disk->srcpool &&
-         disk->srcpool->mode == VIR_DOMAIN_DISK_SOURCE_POOL_MODE_DIRECT))
+         (disk->srcpool->mode == VIR_DOMAIN_DISK_SOURCE_POOL_MODE_DIRECT ||
+          disk->srcpool->mode == VIR_DOMAIN_DISK_TYPE_NETWORK)))
         return 0;
 
     if (iter(disk, disk->src, 0, opaque) < 0)
-- 
1.8.5.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]