From 93e3f756c4579082a4274155183cde0361cbbbfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 14 Sep 2022 15:07:27 +0200 Subject: [PATCH] vzdump: tpmstate: escape drive string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- 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; };