all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server] fix #2862: allow sata/ide template backups
Date: Mon, 26 Apr 2021 14:11:03 +0200	[thread overview]
Message-ID: <20210426121103.2861221-1-f.gruenbichler@proxmox.com> (raw)

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





             reply	other threads:[~2021-04-26 12:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 12:11 Fabian Grünbichler [this message]
2021-04-29 14:19 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210426121103.2861221-1-f.gruenbichler@proxmox.com \
    --to=f.gruenbichler@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal