Blame SOURCES/libvirt-virDomainDiskTranslateSourcePool-Check-for-disk-type-correctly.patch

a41c76
From 92d99bea060e3d86a6e3b2fdd2df089362303536 Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <92d99bea060e3d86a6e3b2fdd2df089362303536@dist-git>
a41c76
From: Michal Privoznik <mprivozn@redhat.com>
a41c76
Date: Tue, 10 Mar 2020 08:03:12 +0100
a41c76
Subject: [PATCH] virDomainDiskTranslateSourcePool: Check for disk type
a41c76
 correctly
a41c76
a41c76
When rewriting the virDomainDiskTranslateSourcePool() function in
a41c76
v6.1.0-rc1~184 a typo was introduced. Previously, we allowed
a41c76
startup policy only for those volumes which translated to
a41c76
VIR_STORAGE_TYPE_FILE. But starting with the referenced commit,
a41c76
the value we checked for was changed to VIR_STORAGE_VOL_FILE
a41c76
which comes from a different enum and has a different value too.
a41c76
This is wrong, because virStorageSourceGetActualType() returns a
a41c76
value from the original enum.
a41c76
a41c76
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1811728
a41c76
a41c76
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
a41c76
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
a41c76
(cherry picked from commit 3918dbd84e4951b43f93fbf50ef52be00274850c)
a41c76
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
a41c76
Message-Id: <ed47a6cb36e55e543ae4ed8cb9f55e1b100d7859.1583823787.git.mprivozn@redhat.com>
a41c76
Acked-by: Peter Krempa <pkrempa@redhat.com>
a41c76
---
a41c76
 src/conf/domain_conf.c | 2 +-
a41c76
 1 file changed, 1 insertion(+), 1 deletion(-)
a41c76
a41c76
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
a41c76
index 3a370e6b90..77e3d25a2d 100644
a41c76
--- a/src/conf/domain_conf.c
a41c76
+++ b/src/conf/domain_conf.c
a41c76
@@ -31610,7 +31610,7 @@ virDomainDiskTranslateSourcePool(virDomainDiskDefPtr def)
a41c76
     }
a41c76
 
a41c76
     if (def->startupPolicy != 0 &&
a41c76
-        virStorageSourceGetActualType(def->src) != VIR_STORAGE_VOL_FILE) {
a41c76
+        virStorageSourceGetActualType(def->src) != VIR_STORAGE_TYPE_FILE) {
a41c76
         virReportError(VIR_ERR_XML_ERROR, "%s",
a41c76
                        _("'startupPolicy' is only valid for "
a41c76
                          "'file' type volume"));
a41c76
-- 
a41c76
2.25.1
a41c76