From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server] snapshot: tpm state: revert to using 'storage' snapshot type when not using QSD
Date: Thu, 30 Apr 2026 12:03:39 +0200 [thread overview]
Message-ID: <20260430101035.73226-1-f.ebner@proxmox.com> (raw)
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
reply other threads:[~2026-04-30 10:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260430101035.73226-1-f.ebner@proxmox.com \
--to=f.ebner@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.