]> git.proxmox.com Git - qemu-server.git/commitdiff
migration: put the source address in brackets
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 21 May 2015 13:19:35 +0000 (15:19 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 21 May 2015 15:30:30 +0000 (17:30 +0200)
Always adding brackets around the address works. They're required for
ipv6 and qemu also accepts them for ipv4 and hostnames.

PVE/QemuMigrate.pm
PVE/QemuServer.pm

index 5eb488f574dc57375f808957617884b8fe0de210..264a2a7608c15add1559c0263a05eba131e1d9b8 100644 (file)
@@ -334,7 +334,7 @@ sub phase2 {
     PVE::Tools::run_command($cmd, input => $spice_ticket, outfunc => sub {
        my $line = shift;
 
-       if ($line =~ m/^migration listens on tcp:([\d\.]+|localhost):(\d+)$/) {
+       if ($line =~ m/^migration listens on tcp:\[([\d\.:a-fA-F]+|localhost)\]:(\d+)$/) {
            $raddr = $1;
            $rport = int($2);
        }
@@ -418,10 +418,10 @@ sub phase2 {
     }
 
     eval {
-        PVE::QemuServer::vm_mon_cmd_nocheck($vmid, "migrate", uri => "tcp:$raddr:$rport");
+        PVE::QemuServer::vm_mon_cmd_nocheck($vmid, "migrate", uri => "tcp:[$raddr]:$rport");
     };
     my $merr = $@;
-    $self->log('info', "migrate uri => tcp:$raddr:$rport failed: $merr") if $merr;
+    $self->log('info', "migrate uri => tcp:[$raddr]:$rport failed: $merr") if $merr;
 
     my $lstat = 0;
     my $usleep = 2000000;
index 3ac0eae4425812c0a3507a841b1e7c945776f49b..19fcf4979084689d132d8746e3249a76bd01daf1 100644 (file)
@@ -4202,7 +4202,7 @@ sub vm_start {
                }
                my $pfamily = PVE::Tools::get_host_address_family($nodename);
                $migrate_port = PVE::Tools::next_migrate_port($pfamily);
-               $migrate_uri = "tcp:${localip}:${migrate_port}";
+               $migrate_uri = "tcp:[${localip}]:${migrate_port}";
                push @$cmd, '-incoming', $migrate_uri;
                push @$cmd, '-S';
            } else {