public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] clone disk: add version guard for qemu-img dd's -l option
@ 2022-04-05  8:22 Fabian Ebner
  2022-04-06 15:42 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Ebner @ 2022-04-05  8:22 UTC (permalink / raw)
  To: pve-devel

It's only available since QEMU 6.2 and doing a check here rather than
bumping the package dependency allows for easy downgrades.

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 PVE/QemuServer.pm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index eb2db42a..d7f4befc 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -7708,7 +7708,12 @@ sub clone_disk {
 		my $bs = 1024*1024;
 
 		my $cmd = ['qemu-img', 'dd', '-n', '-O', $dst_format];
-		push $cmd->@*, '-l', $snapname if $src_format eq 'qcow2' && $snapname;
+
+		if ($src_format eq 'qcow2' && $snapname) {
+		    die "cannot clone qcow2 EFI disk snapshot - requires QEMU >= 6.2\n"
+			if !min_version(kvm_user_version(), 6, 2);
+		    push $cmd->@*, '-l', $snapname;
+		}
 		push $cmd->@*, "bs=$bs", "osize=$size", "if=$src_path", "of=$dst_path";
 		run_command($cmd);
 	    } else {
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-06 15:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05  8:22 [pve-devel] [PATCH qemu-server] clone disk: add version guard for qemu-img dd's -l option Fabian Ebner
2022-04-06 15:42 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal