]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virDomainDiskTranslateSourcePool: Check for disk type correctly
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 9 Mar 2020 15:40:57 +0000 (16:40 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 10 Mar 2020 06:57:55 +0000 (07:57 +0100)
When rewriting the virDomainDiskTranslateSourcePool() function in
v6.1.0-rc1~184 a typo was introduced. Previously, we allowed
startup policy only for those volumes which translated to
VIR_STORAGE_TYPE_FILE. But starting with the referenced commit,
the value we checked for was changed to VIR_STORAGE_VOL_FILE
which comes from a different enum and has a different value too.
This is wrong, because virStorageSourceGetActualType() returns a
value from the original enum.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1811728

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/conf/domain_conf.c

index d8471acd2dcc4fe9b3a33b158694a92469f13510..d2d97daf808060051cdde7557b903065254f9aa6 100644 (file)
@@ -31856,7 +31856,7 @@ virDomainDiskTranslateSourcePool(virDomainDiskDefPtr def)
     }
 
     if (def->startupPolicy != 0 &&
-        virStorageSourceGetActualType(def->src) != VIR_STORAGE_VOL_FILE) {
+        virStorageSourceGetActualType(def->src) != VIR_STORAGE_TYPE_FILE) {
         virReportError(VIR_ERR_XML_ERROR, "%s",
                        _("'startupPolicy' is only valid for "
                          "'file' type volume"));