From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 925DC76F81 for ; Mon, 26 Apr 2021 14:11:12 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 76B3B15B7F for ; Mon, 26 Apr 2021 14:11:12 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 5128615B71 for ; Mon, 26 Apr 2021 14:11:11 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 1E7704229B for ; Mon, 26 Apr 2021 14:11:11 +0200 (CEST) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: pve-devel@lists.proxmox.com Date: Mon, 26 Apr 2021 14:11:03 +0200 Message-Id: <20210426121103.2861221-1-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.028 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH qemu-server] fix #2862: allow sata/ide template backups X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 12:11:12 -0000 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 --- 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