[pve-devel] [PATCH v2 qemu-server 12/16] phase3_cleanup: add finish_spice_migration
Alexandre Derumier
aderumier at odiso.com
Mon Mar 9 16:24:35 CET 2020
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/QemuMigrate.pm | 34 +++++++++++++++++++++-------------
1 file changed, 21 insertions(+), 13 deletions(-)
diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 1566b82..3aaee51 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -637,19 +637,7 @@ sub phase3_cleanup {
finish_livemigration($self, $vmid);
- 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 = mon_cmd($vmid, 'query-spice');
- last if int($res->{'migrated'}) == 1;
- last if $timer > 50;
- $timer ++;
- usleep(200000);
- }
- }
- };
+ finish_spice_migration($self, $vmid);
# always stop local VM
eval { PVE::QemuServer::vm_stop($self->{storecfg}, $vmid, 1, 1); };
@@ -1184,4 +1172,24 @@ sub finish_livemigration {
}
}
+sub finish_spice_migration {
+ my ($self, $vmid) = @_;
+
+ my $conf = $self->{vmconf};
+
+ 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 = mon_cmd($vmid, 'query-spice');
+ last if int($res->{'migrated'}) == 1;
+ last if $timer > 50;
+ $timer ++;
+ usleep(200000);
+ }
+ }
+ };
+}
+
1;
--
2.20.1
More information about the pve-devel
mailing list