volume_resize: align size to 1 KiB
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@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
462537a270
commit
c72155735d
@ -209,6 +209,9 @@ sub volume_size_info {
|
|||||||
sub volume_resize {
|
sub volume_resize {
|
||||||
my ($cfg, $volid, $size, $running) = @_;
|
my ($cfg, $volid, $size, $running) = @_;
|
||||||
|
|
||||||
|
my $padding = (1024 - $size % 1024) % 1024;
|
||||||
|
$size = $size + $padding;
|
||||||
|
|
||||||
my ($storeid, $volname) = parse_volume_id($volid, 1);
|
my ($storeid, $volname) = parse_volume_id($volid, 1);
|
||||||
if ($storeid) {
|
if ($storeid) {
|
||||||
my $scfg = storage_config($cfg, $storeid);
|
my $scfg = storage_config($cfg, $storeid);
|
||||||
|
|||||||
Reference in New Issue
Block a user