public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server 1/2] vzdump: tpmstate: escape drive string
@ 2022-09-14 13:07 Fabian Grünbichler
  2022-09-14 13:07 ` [pve-devel] [PATCH qemu-server 2/2] vzdump: tpmstate: include HMP error in message Fabian Grünbichler
  2022-09-16 10:54 ` [pve-devel] applied-series: [PATCH qemu-server 1/2] vzdump: tpmstate: escape drive string Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Fabian Grünbichler @ 2022-09-14 13:07 UTC (permalink / raw)
  To: pve-devel

the volume path could contain escaped ":" or ",", which means their '\'
needs to be escaped another time for passing to HMP.

the same approach is used for hotplugging regular drives in
PVE::QemuServer, and is needed (at least) for RBD storages with IPv6
monhosts or an explicit monhost port.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---

Notes:
    reported and fix tested by Tuxis in our forum:
    
    https://forum.proxmox.com/threads/pbs-backup-attaching-tpm-drive-failed.114996

 PVE/VZDump/QemuServer.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm
index 202e53dd..0d58e03b 100644
--- a/PVE/VZDump/QemuServer.pm
+++ b/PVE/VZDump/QemuServer.pm
@@ -442,6 +442,7 @@ my $attach_tpmstate_drive = sub {
     $self->loginfo('attaching TPM drive to QEMU for backup');
 
     my $drive = "file=$task->{tpmpath},if=none,read-only=on,id=drive-tpmstate0-backup";
+    $drive =~ s/\\/\\\\/g;
     my $ret = PVE::QemuServer::Monitor::hmp_cmd($vmid, "drive_add auto \"$drive\"");
     die "attaching TPM drive failed\n" if $ret !~ m/OK/s;
 };
-- 
2.30.2





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

end of thread, other threads:[~2022-09-16 10:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14 13:07 [pve-devel] [PATCH qemu-server 1/2] vzdump: tpmstate: escape drive string Fabian Grünbichler
2022-09-14 13:07 ` [pve-devel] [PATCH qemu-server 2/2] vzdump: tpmstate: include HMP error in message Fabian Grünbichler
2022-09-16 10:54 ` [pve-devel] applied-series: [PATCH qemu-server 1/2] vzdump: tpmstate: escape drive string 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