[libvirt] [PATCH] rbd: Allow shrinking and deltas when resizing RBD volumes
Ján Tomko
jtomko at redhat.com
Sat Feb 6 10:28:18 UTC 2016
On Sat, Jan 30, 2016 at 04:15:32PM +0100, Wido den Hollander wrote:
> Modify virCheckFlags that it accepts both VIR_STORAGE_VOL_RESIZE_DELTA
> and VIR_STORAGE_VOL_RESIZE_SHRINK as valid flags for resizing RBD
> volumes.
>
> This still does not solve the problem where RBD volumes can't be
> shrinked using libvirt. The allocation and capacity of RBD volumes
> are equal for a RBD volume and this makes libvirt think the volume
> is fully allocated and therefor can't be shrinked.
>
> Signed-off-by: Wido den Hollander <wido at widodh.nl>
> ---
> 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 80a1d33..88b613a 100644
> --- a/src/storage/storage_backend_rbd.c
> +++ b/src/storage/storage_backend_rbd.c
> @@ -1041,7 +1041,8 @@ static int virStorageBackendRBDResizeVol(virConnectPtr conn ATTRIBUTE_UNUSED,
> int ret = -1;
> int r = 0;
>
> - virCheckFlags(0, -1);
> + virCheckFlags(VIR_STORAGE_VOL_RESIZE_DELTA |
The storage driver calculates the new capacity in storageVolResize and
masks off the VIR_STORAGE_VOL_RESIZE_DELTA flag. It should never be set
here.
Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160206/b8624109/attachment-0001.sig>
More information about the libvir-list
mailing list