clone_disk: fix offline clone of efidisk

by partially reverting 4df98f2f14 and fixing the
line-length issue differently. The commit didn't update two later usages of
$size, breaking copying the efidisk. The other usage as a parameter to
qemu_img_convert() is luckily only cosmetic, for progress output.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner 2020-12-07 13:15:15 +01:00 committed by Thomas Lamprecht
parent e00319af4d
commit b5688f69a0

View File

@ -6951,8 +6951,9 @@ sub clone_disk {
} else {
($size) = PVE::Storage::volume_size_info($storecfg, $drive->{file}, 10);
}
$size /= 1024;
$newvolid = PVE::Storage::vdisk_alloc($storecfg, $storeid, $newvmid, $dst_format, $name, $size);
$newvolid = PVE::Storage::vdisk_alloc(
$storecfg, $storeid, $newvmid, $dst_format, $name, ($size/1024)
);
push @$newvollist, $newvolid;
PVE::Storage::activate_volumes($storecfg, [$newvolid]);