]> git.proxmox.com Git - qemu-server.git/commit
fix #2258: select correct device when removing drive snapshot via QEMU
authorFiona Ebner <f.ebner@proxmox.com>
Wed, 3 Jan 2024 13:41:49 +0000 (14:41 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 9 Jan 2024 09:11:17 +0000 (10:11 +0100)
commitc60586838a4bfbd4f879c509195cbfb1291db443
tree63067e2a79ef64d5c8f16a943addcbdd07ca8dd5
parenta17c753528d0fa12530d2ffbe307087abef3d1f8
fix #2258: select correct device when removing drive snapshot via QEMU

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>
PVE/QemuServer.pm