From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id C8C3569C71 for ; Mon, 7 Dec 2020 13:15:50 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B6730243AC for ; Mon, 7 Dec 2020 13:15:20 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 44EEF243A3 for ; Mon, 7 Dec 2020 13:15:20 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 0FAD444E2E for ; Mon, 7 Dec 2020 13:15:20 +0100 (CET) From: Fabian Ebner To: pve-devel@lists.proxmox.com Date: Mon, 7 Dec 2020 13:15:15 +0100 Message-Id: <20201207121515.6348-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.009 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH qemu-server] clone_disk: fix offline clone of efidisk X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2020 12:15:50 -0000 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 --- 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