]> xenbits.xensource.com Git - libvirt.git/commitdiff
rbd: optionally compute volume allocation from capacity
authorJason Dillaman <dillaman@redhat.com>
Tue, 19 Mar 2019 13:42:18 +0000 (09:42 -0400)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 19 Mar 2019 15:49:24 +0000 (16:49 +0100)
Use the new refresh volume allocation pool override to skip
computing the actual volume usage if disabled.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/storage/storage_backend_rbd.c

index 4744b7bfd8aa46de544e8b0f906ca70532da61bf..61ebb9b541230f8b49e6c792ed2a14bbf512a5ff 100644 (file)
@@ -563,7 +563,9 @@ volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol,
     vol->type = VIR_STORAGE_VOL_NETWORK;
     vol->target.format = VIR_STORAGE_FILE_RAW;
 
-    if (volStorageBackendRBDUseFastDiff(features, flags)) {
+    if (def->refresh &&
+        def->refresh->volume.allocation == VIR_STORAGE_VOL_DEF_REFRESH_ALLOCATION_DEFAULT &&
+        volStorageBackendRBDUseFastDiff(features, flags)) {
         VIR_DEBUG("RBD image %s/%s has fast-diff feature enabled. "
                   "Querying for actual allocation",
                   def->source.name, vol->name);