public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] fix #2862: allow sata/ide template backups
@ 2021-04-26 12:11 Fabian Grünbichler
  2021-04-29 14:19 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Grünbichler @ 2021-04-26 12:11 UTC (permalink / raw)
  To: pve-devel

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

Notes:
    tested backing up a template with SATA, IDE, virtio-block and virtio-scsi with a few storages

 PVE/QemuServer.pm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index e768072..638077c 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(
-- 
2.20.1





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

* [pve-devel] applied: [PATCH qemu-server] fix #2862: allow sata/ide template backups
  2021-04-26 12:11 [pve-devel] [PATCH qemu-server] fix #2862: allow sata/ide template backups Fabian Grünbichler
@ 2021-04-29 14:19 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2021-04-29 14:19 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fabian Grünbichler

On 26.04.21 14:11, Fabian Grünbichler wrote:
> 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>
> ---
> 
> Notes:
>     tested backing up a template with SATA, IDE, virtio-block and virtio-scsi with a few storages
> 
>  PVE/QemuServer.pm | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
>

applied, thanks!




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

end of thread, other threads:[~2021-04-29 14:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26 12:11 [pve-devel] [PATCH qemu-server] fix #2862: allow sata/ide template backups Fabian Grünbichler
2021-04-29 14:19 ` [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