5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-08 21:18:03 +03:00

fix #2862: allow sata/ide template backups

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>
This commit is contained in:
Fabian Grünbichler 2021-04-26 14:11:03 +02:00 committed by Thomas Lamprecht
parent 30664f14ff
commit 3dc33a728a

View 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(