Re: [PATCH-SERIES qemu-server v3 00/18] fix #7066: api: allow live snapshot (remove) of qcow2 TPM drive with snapshot-as-volume-chain

Lukas Sichert
2026-04-23T13:58:09Z

Everything works as expected.

My setup for testing:

I configured one PVE machine as an iSCSI target server and exported a
400 GB disk as a writable LUN. On a second PVE machine, in the GUI I
added the target LUN as iSCSI storage, created a volume group (VG) on
top of it, and then added a LVM storage based on that VG.

For testing, I used Windows Server 2022 Evaluation and Windows 11.

Before the patch:
-taking live snapshots was not possible
-removing any snapshot live was not possible

After the patch:
-taking live snapshots is possible
-removing live snapshots is possible, except for the top-most snapshot

Unrelated to the patch, works with and without it:
-rollbacks power off the VM and are therefore possible
-offline snapshots are still possible

I will go through the code to give a review soon.

Tested-by: Lukas Sichert <l.sichert@proxmox.com>

On 2026-04-23 11:35, Fiona Ebner <f.ebner@proxmox.com> wrote:

> Changes in v3:
> * Rebase on latest master (adapt to change from new perltidy version).
>
> Changes in v2:
> * Rebase on latest master (many modified functions moved to
> VolumeChain.pm).
> * get_node_name_below_throttle(): also die after else branch if no
> top node can be found.
>
> The QMP commands for snapshot operations can just be passed to the
> qemu-storage-daemon for the FUSE-exported TPM state and it will handle
> it just the same as the main QEMU instance.
>
> There is a single limitation remaining. That limitation is removing
> the top-most snapshot live when the current image is exported via
> FUSE, because exporting unshares the 'resize' permission, which would
> be required by both 'block-commit' and 'block-stream', for example:
>
>> QEMU storage daemon 100 qsd command 'block-commit' failed - Permission
>> conflict on node '#block017': permissions 'resize' are both required
>> by node 'drive-tpmstate0' (uses node '#block017' as 'file' child) and
>> unshared by commit job 'commit-drive-tpmstate0' (uses node '#block017'
>> as 'main node' child).
>
> Most of the work is preparing the code interacting with the block
> layer to support different QMP peers.
>
> The first two commits are independent from the goal of the series, but
> tangentially related.
>
> Since this touches quite a bit of code, more testing would be very
> appreciated!
>
> qemu-server:
>
> Fiona Ebner (18):
> block job: fix variable name in documentation
> qmp client: add default timeouts for more block commands
> drive: introduce drive_uses_qsd_fuse() helper
> monitor: add vm_qmp_peer() helper
> monitor: add qsd_peer() helper
> blockdev: rename variable in get_node_name_below_throttle() for
> readability
> blockdev: switch get_node_name_below_throttle() to use QMP peer
> blockdev: switch detach() to use QMP peer
> blockdev: switch blockdev_replace() to use QMP peer
> blockdev: switch blockdev_external_snapshot() to use QMP peer
> block job: switch qemu_handle_concluded_blockjob() to use QMP peer
> block job: switch qemu_blockjobs_cancel() to use QMP peer
> block job: switch qemu_drive_mirror_monitor() to use QMP peer
> blockdev: switch blockdev_delete() to use QMP peer
> blockdev: switch blockdev_stream() to use QMP peer
> blockdev: switch blockdev_commit() to use QMP peer
> snapshot: support live snapshot (remove) of qcow2 TPM drive on storage
> with snapshot-as-volume-chain
> fix #7066: api: allow live snapshot (remove) of qcow2 TPM drive with
> snapshot-as-volume-chain
>
> src/PVE/API2/Qemu.pm | 45 ++++++--------
> src/PVE/QMPClient.pm | 7 +++
> src/PVE/QemuMigrate.pm | 6 +-
> src/PVE/QemuServer.pm | 65 +++++++++++---------
> src/PVE/QemuServer/BlockJob.pm | 62 +++++++++++--------
> src/PVE/QemuServer/Blockdev.pm | 59 +++++++++---------
> src/PVE/QemuServer/Drive.pm | 20 +++++++
> src/PVE/QemuServer/Monitor.pm | 19 +++++-
> src/PVE/QemuServer/QSD.pm | 11 ++--
> src/PVE/QemuServer/VolumeChain.pm | 73 ++++++++++++++---------
> src/PVE/VZDump/QemuServer.pm | 6 +-
> src/test/MigrationTest/QemuMigrateMock.pm | 2 +-
> 12 files changed, 222 insertions(+), 153 deletions(-)
>
>
> Summary over all repositories:
> 12 files changed, 222 insertions(+), 153 deletions(-)
>
> --
> Generated by git-murpp 0.5.0