[pve-devel] applied: [PATCH v4 storage] volume_resize: align size to 1 KiB
Thomas Lamprecht
t.lamprecht at proxmox.com
Wed Feb 19 15:30:46 CET 2020
On 2/19/20 11:31 AM, Fabian Ebner wrote:
> 1. Avoids the error
> qemu-img: The new size must be a multiple of 512
> for qcow2 disks.
> 2. Because volume_import expects disk sizes to be a multiple of 1 KiB.
>
> Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
> ---
> PVE/Storage.pm | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/PVE/Storage.pm b/PVE/Storage.pm
> index 62d72de..3247c61 100755
> --- a/PVE/Storage.pm
> +++ b/PVE/Storage.pm
> @@ -207,6 +207,9 @@ sub volume_size_info {
> sub volume_resize {
> my ($cfg, $volid, $size, $running) = @_;
>
> + my $padding = (1024 - $size % 1024) % 1024;
> + $size = $size + $padding;
> +
> my ($storeid, $volname) = parse_volume_id($volid, 1);
> if ($storeid) {
> my $scfg = storage_config($cfg, $storeid);
>
applied, thanks!
More information about the pve-devel
mailing list