[pve-devel] [PATCH qemu-server] fix remote viewer live migration

Dominik Csapak d.csapak at proxmox.com
Tue Aug 20 10:45:32 CEST 2019


for some reason not setting port results in a port of '65535' which
triggers an execption in http-server anyevent, so we set the port to 0

also, we have to read the ticket from stdin even for 'unix' type secure
migration

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/API2/Qemu.pm   | 2 +-
 PVE/QemuMigrate.pm | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 8be0b7b..b30931d 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -2048,7 +2048,7 @@ __PACKAGE__->register_method({
 
 	# read spice ticket from STDIN
 	my $spice_ticket;
-	if ($stateuri && ($stateuri eq 'tcp') && $migratedfrom && ($rpcenv->{type} eq 'cli')) {
+	if ($stateuri && ($stateuri eq 'tcp' || $stateuri eq 'unix') && $migratedfrom && ($rpcenv->{type} eq 'cli')) {
 	    if (defined(my $line = <STDIN>)) {
 		chomp $line;
 		$spice_ticket = $line;
diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index bc83816..94bc40c 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -749,7 +749,7 @@ sub phase2 {
 
 	eval {
 	    PVE::QemuServer::vm_mon_cmd_nocheck($vmid, "client_migrate_info", protocol => 'spice',
-						hostname => $proxyticket, 'tls-port' => $spice_port,
+						hostname => $proxyticket, 'port' => 0, 'tls-port' => $spice_port,
 						'cert-subject' => $subject);
 	};
 	$self->log('info', "client_migrate_info error: $@") if $@;
-- 
2.20.1





More information about the pve-devel mailing list