]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage: Allow probe of volume capacity for BLOCK type
authorJohn Ferlan <jferlan@redhat.com>
Tue, 6 Dec 2016 23:37:46 +0000 (18:37 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 18 Jan 2017 11:09:38 +0000 (06:09 -0500)
If the voldef type is VIR_STORAGE_VOL_BLOCK, then as long as the
format is known, let's allow the probe to happen - gets a truer value
and the same probe/update would be allowed for the same volume defined
in a domain.

src/storage/storage_backend.c

index 742dc07db6a1560a5b81390c7946a53a29fa60a9..20c2b851157c5cd4a8493ac9c941c93a39e92a12 100644 (file)
@@ -1900,7 +1900,7 @@ virStorageBackendUpdateVolTargetInfo(virStorageVolType voltype,
     if ((ret = virStorageBackendUpdateVolTargetInfoFD(target, fd, &sb)) < 0)
         goto cleanup;
 
-    if (voltype == VIR_STORAGE_VOL_FILE &&
+    if ((voltype == VIR_STORAGE_VOL_FILE || voltype == VIR_STORAGE_VOL_BLOCK) &&
         target->format != VIR_STORAGE_FILE_NONE) {
         if (S_ISDIR(sb.st_mode)) {
             if (virStorageBackendIsPloopDir(target->path)) {