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)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id EEA7FBAF53 for ; Fri, 22 Mar 2024 10:36:16 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C940A20C8 for ; Fri, 22 Mar 2024 10:35:46 +0100 (CET) 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)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 22 Mar 2024 10:35:43 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 0DB8F419A3 for ; Fri, 22 Mar 2024 10:35:43 +0100 (CET) Message-ID: Date: Fri, 22 Mar 2024 10:35:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta To: Proxmox VE development discussion , Maximiliano Sandoval References: <20240321122949.386487-1-m.sandoval@proxmox.com> Content-Language: en-GB From: Thomas Lamprecht In-Reply-To: <20240321122949.386487-1-m.sandoval@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.059 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [qemuserver.pm, plugin.pm, proxmox.com] Subject: [pve-devel] applied: [PATCH stable-7 qemu] fix #2258: select correct device when removing drive snapshot via QEMU 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: Fri, 22 Mar 2024 09:36:17 -0000 On 21/03/2024 13:29, Maximiliano Sandoval wrote: > The QMP command needs to be issued for the device where the disk is > currently attached, not for the device where the disk was attached at > the time the snapshot was taken. > > Fixes the following scenario with a disk image for which > do_snapshots_with_qemu() is true (i.e. qcow2 or RBD+krbd=0): > 1. Take snapshot while disk image is attached to a given bus+ID. > 2. Detach disk image. > 3. Attach disk image to a different bus+ID. > 4. Remove snapshot. > > Previously, this would result in an error like: >> blockdev-snapshot-delete-internal-sync' failed - Cannot find device=drive-scsi1 nor node_name=drive-scsi1 > > While the $running parameter for volume_snapshot_delete() is planned > to be removed on the next storage plugin APIAGE reset, it currently > causes an immediate return in Storage/Plugin.pm. So passing a truthy > value would prevent removing a snapshot from an unused qcow2 disk that > was still used at the time the snapshot was taken. Thus, and because > some exotic third party plugin might be using it for whatever reason, > it's necessary to keep passing the same value as before. > > Signed-off-by: Fiona Ebner > Signed-off-by: Maximiliano Sandoval > --- > > This is a backport for Proxmox VE 7 of > https://lists.proxmox.com/pipermail/pve-devel/2022-September/054124.html which > was applied at > https://git.proxmox.com/?p=qemu-server.git;a=commit;h=c60586838a4bfbd4f879c509195cbfb1291db443. > If you use `git cherry-pick -xs COMMIT` the -x will add a reference that this was cherry-picked from a commit and the -s adds your S-o-b, which makes it a bit nicer as one can immediately see where it comes from when checking the git log. I amended that info in this time. > I tested this by creating a new Proxmox VE 7.4 VM, creating a new VM inside with > storage as IDE, taking a snapshot while the VM is running, detach the storage > and add it back as SCSI, then deleting the snapshot. > > PVE/QemuServer.pm | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) applied, thanks!