[libvirt] [PATCH 3/3] rbd: optionally compute volume allocation from capacity

jdillama@redhat.com posted 3 patches 6 years, 11 months ago
There is a newer version of this series
[libvirt] [PATCH 3/3] rbd: optionally compute volume allocation from capacity
Posted by jdillama@redhat.com 6 years, 11 months ago
From: Jason Dillaman <dillaman@redhat.com>

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>
---
 src/storage/storage_backend_rbd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index e67911f928..1b01fbb3a8 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -564,7 +564,8 @@ volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol,
     vol->type = VIR_STORAGE_VOL_NETWORK;
     vol->target.format = VIR_STORAGE_FILE_RAW;
 
-    if (volStorageBackendRBDUseFastDiff(features, flags)) {
+    if (def->refresh_volume_allocation == VIR_STORAGE_VOL_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);
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 3/3] rbd: optionally compute volume allocation from capacity
Posted by Michal Privoznik 6 years, 10 months ago
On 3/15/19 4:17 PM, jdillama@redhat.com wrote:
> From: Jason Dillaman <dillaman@redhat.com>
> 
> 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>
> ---
>   src/storage/storage_backend_rbd.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
> index e67911f928..1b01fbb3a8 100644
> --- a/src/storage/storage_backend_rbd.c
> +++ b/src/storage/storage_backend_rbd.c
> @@ -564,7 +564,8 @@ volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol,
>       vol->type = VIR_STORAGE_VOL_NETWORK;
>       vol->target.format = VIR_STORAGE_FILE_RAW;
>   
> -    if (volStorageBackendRBDUseFastDiff(features, flags)) {
> +    if (def->refresh_volume_allocation == VIR_STORAGE_VOL_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);
> 

This will need to adapt to changes I'm suggesting in 2/3 but the idea 
looks good.

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list