]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/QemuMigrate.pm
add vmxnet3 to list of available network card models
[qemu-server.git] / PVE / QemuMigrate.pm
index d88180bfa9264666c3587487d4449b5d3c6c83c6..634c305bca07d4f3b67a1430c644de9471504577 100644 (file)
@@ -590,17 +590,20 @@ sub phase3_cleanup {
        }
     }
 
-    my $timer = 0;
-    if (PVE::QemuServer::vga_conf_has_spice($conf->{vga})) {
-        $self->log('info', "Waiting for spice server migration");
-       while (1) {
-           my $res = PVE::QemuServer::vm_mon_cmd_nocheck($vmid, 'query-spice');
-           last if int($res->{'migrated'}) == 1;
-           last if $timer > 50;
-           $timer ++;
-           usleep(200000);
-        }
-    }
+    eval {
+
+       my $timer = 0;
+       if (PVE::QemuServer::vga_conf_has_spice($conf->{vga}) && $self->{running}) {
+           $self->log('info', "Waiting for spice server migration");
+           while (1) {
+               my $res = PVE::QemuServer::vm_mon_cmd_nocheck($vmid, 'query-spice');
+               last if int($res->{'migrated'}) == 1;
+               last if $timer > 50;
+               $timer ++;
+               usleep(200000);
+           }
+       }
+    };
 
     # always stop local VM
     eval { PVE::QemuServer::vm_stop($self->{storecfg}, $vmid, 1, 1); };