Re: [PATCH] Implement LVM volume resize via lvresize

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 30, 2017 at 20:23:30 +0300, apolyakov@xxxxxxxx wrote:
> From: Alexander Polyakov <apolyakov@xxxxxxxxx>

Commit message is missing (and required). Please describe your change.

> 
> Signed-off-by: Alexander Polyakov <apolyakov@xxxxxxxxx>
> ---
>  m4/virt-storage-lvm.m4                |  4 ++++
>  src/storage/storage_backend_logical.c | 22 ++++++++++++++++++++++
>  2 files changed, 26 insertions(+)

[...]

> diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
> index 67f70e551..810e4ee88 100644
> --- a/src/storage/storage_backend_logical.c
> +++ b/src/storage/storage_backend_logical.c
> @@ -1072,6 +1072,27 @@ virStorageBackendLogicalVolWipe(virConnectPtr conn,
>      return -1;
>  }
>  
> +static int
> +virStorageBackendLogicalResizeVol(virConnectPtr conn ATTRIBUTE_UNUSED,
> +                                   virStoragePoolObjPtr pool,
> +                                   virStorageVolDefPtr vol,
> +                                   unsigned long long capacity,
> +                                   unsigned int flags)
> +{
> +
> +    virCheckFlags(0, -1);

This won't allow shrinking of the volume. Also VIR_STORAGE_VOL_RESIZE_DELTA
looks simple enough to implement.

> +
> +    (void)pool;

Use ATTRIBUTE_UNUSED for the parameter.

> +    virCommandPtr cmd = virCommandNewArgList(LVRESIZE, "-L", NULL);
> +    virCommandAddArgFormat(cmd, "%lluK", VIR_DIV_UP(capacity, 1024));

Why don't you pass this through in bytes?

> +    virCommandAddArgFormat(cmd, "%s", vol->target.path);
> +    int ret = virCommandRun(cmd, NULL);

rest looks fine.

Attachment: signature.asc
Description: PGP signature

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

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux