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
  2026-05-06  0:20 ` applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread

* applied: [PATCH qemu-server] snapshot: tpm state: revert to using 'storage' snapshot type when not using QSD
  2026-04-30 10:03 [PATCH qemu-server] snapshot: tpm state: revert to using 'storage' snapshot type when not using QSD Fiona Ebner
@ 2026-05-06  0:20 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2026-05-06  0:20 UTC (permalink / raw)
  To: pve-devel, Fiona Ebner

On Thu, 30 Apr 2026 12:03:39 +0200, Fiona Ebner wrote:
> 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.

Applied, thanks!

[1/1] snapshot: tpm state: revert to using 'storage' snapshot type when not using QSD
      commit: 14b0209047eefb66fb001abf1c0e51111107f3ac




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-06  0:20 UTC | newest]

Thread overview: 2+ messages (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
2026-05-06  0:20 ` applied: " Thomas Lamprecht

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