On Wed, May 19, 2021 at 4:26 PM Peter Lieven <p...@kamp.de> wrote:
>
> in case the image size changed we should adjust our internally stored size as 
> well.
>
> Signed-off-by: Peter Lieven <p...@kamp.de>
> ---
>  block/rbd.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/block/rbd.c b/block/rbd.c
> index b4caea4f1b..97a2ae4c84 100644
> --- a/block/rbd.c
> +++ b/block/rbd.c
> @@ -976,6 +976,7 @@ static int64_t qemu_rbd_getlength(BlockDriverState *bs)
>          return r;
>      }
>
> +    s->image_size = info.size;
>      return info.size;

Since you are touching this function might as well switch to
rbd_get_size() to put size directly into s->image_size and return
s->image_size, skipping rbd_image_info_t.

Thanks,

                Ilya

Reply via email to