From 3dc33a728a7b5dc7e69eabad77b4efd05d2e02d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Mon, 26 Apr 2021 14:11:03 +0200 Subject: [PATCH] fix #2862: allow sata/ide template backups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit for IDE and SATA, setting the whole drive into readonly mode is not possible. skip the readonly flag for such drives as a workaround until we find a better solution. Signed-off-by: Fabian Grünbichler --- PVE/QemuServer.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index e7680723..638077c8 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -3647,7 +3647,13 @@ sub config_to_command { } my $drive_cmd = print_drive_commandline_full($storecfg, $vmid, $drive, $pbs_name); - $drive_cmd .= ',readonly' if PVE::QemuConfig->is_template($conf); + + # extra protection for templates, but SATA and IDE don't support it.. + my $read_only = PVE::QemuConfig->is_template($conf) + && $drive->{interface} ne 'sata' + && $drive->{interface} ne 'ide'; + + $drive_cmd .= ',readonly' if $read_only; push @$devices, '-drive',$drive_cmd; push @$devices, '-device', print_drivedevice_full(