[pve-devel] [PATCH qemu-server 1/2] vzdump: tpmstate: escape drive string

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Sep 14 15:07:27 CEST 2022


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 at 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






More information about the pve-devel mailing list