public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Maximiliano Sandoval <m.sandoval@proxmox.com>
Subject: [pve-devel] applied: [PATCH stable-7 qemu] fix #2258: select correct device when removing drive snapshot via QEMU
Date: Fri, 22 Mar 2024 10:35:41 +0100	[thread overview]
Message-ID: <b41fa0b3-e109-4e18-b63a-70035e27d15c@proxmox.com> (raw)
In-Reply-To: <20240321122949.386487-1-m.sandoval@proxmox.com>

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 <f.ebner@proxmox.com>
> Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
> ---
> 
> 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!




      reply	other threads:[~2024-03-22  9:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 12:29 [pve-devel] " Maximiliano Sandoval
2024-03-22  9:35 ` Thomas Lamprecht [this message]

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=b41fa0b3-e109-4e18-b63a-70035e27d15c@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=m.sandoval@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 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