]> git.proxmox.com Git - qemu-server.git/commitdiff
clone disk: move check against cloning TPM state of running VM to beginning
authorFabian Ebner <f.ebner@proxmox.com>
Thu, 17 Mar 2022 11:31:00 +0000 (12:31 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 1 Apr 2022 08:24:59 +0000 (10:24 +0200)
where other similar checks are.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/QemuServer.pm

index bc66246bfde5528cb515d0dc6dcf46fbe0cfedf3..b7fe6ff4c5dc32fda530618ff32033eb9a871f52 100644 (file)
@@ -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 {