From: Jason Dillaman Date: Tue, 19 Mar 2019 13:42:18 +0000 (-0400) Subject: rbd: optionally compute volume allocation from capacity X-Git-Tag: v5.2.0-rc1~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9c38c723af4d8cce77a1a348ac4b9ef512641d7;p=thirdparty%2Flibvirt.git rbd: optionally compute volume allocation from capacity Use the new refresh volume allocation pool override to skip computing the actual volume usage if disabled. Signed-off-by: Jason Dillaman Signed-off-by: Michal Privoznik --- diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c index 4744b7bfd8..61ebb9b541 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -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);