[pve-devel] [PATCH v13 qemu-server 2/8] clone disk: move check against cloning TPM state of running VM to beginning

Fabian Ebner f.ebner at proxmox.com
Thu Mar 17 12:31:00 CET 2022


where other similar checks are.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

New in v13.

 PVE/QemuServer.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index dd6f48f3..907cfc09 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -7598,6 +7598,9 @@ sub clone_disk {
 	    if $use_drive_mirror && $vmid == $newvmid;
     }
 
+    die "cannot move TPM state while VM is running\n"
+	if $use_drive_mirror && $src_drivename eq 'tpmstate0';
+
     my $newvolid;
 
     print "create " . ($full ? 'full' : 'linked') . " clone of drive ";
@@ -7651,8 +7654,6 @@ sub clone_disk {
 
 	my $sparseinit = PVE::Storage::volume_has_feature($storecfg, 'sparseinit', $newvolid);
 	if ($use_drive_mirror) {
-	    die "cannot move TPM state while VM is running\n" if $src_drivename eq 'tpmstate0';
-
 	    qemu_drive_mirror($vmid, $src_drivename, $newvolid, $newvmid, $sparseinit, $jobs,
 	        $completion, $qga, $bwlimit);
 	} else {
-- 
2.30.2






More information about the pve-devel mailing list