Message ID | 20210519142359.23083-4-pl@kamp.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | block/rbd: migrate to coroutines and add write zeroes support | expand |
On Wed, May 19, 2021 at 4:26 PM Peter Lieven <pl@kamp.de> wrote: > > in case the image size changed we should adjust our internally stored size as well. > > Signed-off-by: Peter Lieven <pl@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
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; }
in case the image size changed we should adjust our internally stored size as well. Signed-off-by: Peter Lieven <pl@kamp.de> --- block/rbd.c | 1 + 1 file changed, 1 insertion(+)