]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #2862: allow sata/ide template backups
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 26 Apr 2021 12:11:03 +0000 (14:11 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 29 Apr 2021 14:15:53 +0000 (16:15 +0200)
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 <f.gruenbichler@proxmox.com>
PVE/QemuServer.pm

index e7680723c8bbaac3c806ccce9f45849b6375b75e..638077c840af66d133a3dbc4f5c15ee00b44d5f9 100644 (file)
@@ -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(