[libvirt] [PATCH v3 1/3] rbd: do not attempt to use fast-diff if it's marked invalid

Michal Privoznik mprivozn at redhat.com
Tue Mar 19 16:00:23 UTC 2019


On 3/19/19 2:42 PM, jdillama at redhat.com wrote:
> From: Jason Dillaman <dillaman at redhat.com>
> 
> The librbd API will transparently revert to a slow disk usage
> calculation method if the fast-diff map is marked as invalid.
> 
> Signed-off-by: Jason Dillaman <dillaman at redhat.com>
> ---
>   src/storage/storage_backend_rbd.c | 41 ++++++++++++++++++++++++++++---
>   1 file changed, 37 insertions(+), 4 deletions(-)
> 
> diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
> index 2b7af1db23..e67911f928 100644
> --- a/src/storage/storage_backend_rbd.c
> +++ b/src/storage/storage_backend_rbd.c
> @@ -437,10 +437,29 @@ volStorageBackendRBDGetFeatures(rbd_image_t image,
>   }
>   
>   #if LIBRBD_VERSION_CODE > 265
> +static int
> +volStorageBackendRBDGetFlags(rbd_image_t image,
> +                             const char *volname,
> +                             uint64_t *flags)
> +{
> +    int r, ret = -1;
> +
> +    if ((r = rbd_get_flags(image, flags)) < 0) {
> +        virReportSystemError(-r, _("failed to get the flags of RBD image "
> +                                 "%s"), volname);
> +        goto cleanup;
> +    }
> +    ret = 0;
> +
> + cleanup:
> +    return ret;
> +}

I've simplified this a bit.

Michal




More information about the libvir-list mailing list