public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH qemu-server] snapshot: tpm state: revert to using 'storage' snapshot type when not using QSD
@ 2026-04-30 10:03 Fiona Ebner
  0 siblings, 0 replies; only message in thread
From: Fiona Ebner @ 2026-04-30 10:03 UTC (permalink / raw)
  To: pve-devel

When the QEMU Storage Daemon is not used for a TPM state drive, the
snapshot still needs to be made via the storage layer, because the
drive is neither attached to the VM nor QSD, so the snapshot cannot be
taken via QMP.

Fixes: da752aaf ("snapshot: support live snapshot (remove) of qcow2 TPM drive on storage with snapshot-as-volume-chain")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/QemuServer.pm | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 964b9dd2..62ebb0e6 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -4351,7 +4351,7 @@ sub qemu_volume_snapshot {
     my $volid = $drive->{file};
     my $running = check_running($vmid);
 
-    my $do_snapshots_type = do_snapshots_type($storecfg, $volid, $deviceid, $running);
+    my $do_snapshots_type = do_snapshots_type($storecfg, $drive, $deviceid, $running);
 
     if ($do_snapshots_type eq 'internal') {
         print "internal qemu snapshot\n";
@@ -4396,7 +4396,7 @@ sub qemu_volume_snapshot_delete {
         );
     }
 
-    my $do_snapshots_type = do_snapshots_type($storecfg, $volid, $attached_deviceid, $running);
+    my $do_snapshots_type = do_snapshots_type($storecfg, $drive, $attached_deviceid, $running);
 
     if ($do_snapshots_type eq 'internal') {
         my $qmp_peer = PVE::QemuServer::Drive::drive_qmp_peer($storecfg, $vmid, $drive);
@@ -7790,12 +7790,19 @@ sub restore_tar_archive {
 }
 
 sub do_snapshots_type {
-    my ($storecfg, $volid, $deviceid, $running) = @_;
+    my ($storecfg, $drive, $deviceid, $running) = @_;
 
     #we use storage snapshot if vm is not running or if disk is unused;
     return 'storage' if !$running || !$deviceid;
 
-    if (my $method = PVE::Storage::volume_qemu_snapshot_method($storecfg, $volid)) {
+    if (
+        $deviceid eq 'drive-tpmstate0'
+        && !PVE::QemuServer::Drive::drive_uses_qsd_fuse($storecfg, $drive)
+    ) {
+        return 'storage';
+    }
+
+    if (my $method = PVE::Storage::volume_qemu_snapshot_method($storecfg, $drive->{file})) {
         return 'internal' if $method eq 'qemu';
         return 'external' if $method eq 'mixed';
     }
-- 
2.47.3





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-30 10:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-30 10:03 [PATCH qemu-server] snapshot: tpm state: revert to using 'storage' snapshot type when not using QSD Fiona Ebner

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