[pve-devel] [PATCH qemu-server] clone_disk: fix offline clone of efidisk

Fabian Ebner f.ebner at proxmox.com
Mon Dec 7 13:15:15 CET 2020


by partially reverting 4df98f2f14348d0ed57529c4c04a1b5ffb840055 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 at proxmox.com>
---
 PVE/QemuServer.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 70c14ba..607f77b 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -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]);
-- 
2.20.1






More information about the pve-devel mailing list