]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: fix NBD migration to hosts with IPv6 enabled
authorJán Tomko <jtomko@redhat.com>
Thu, 23 May 2013 13:51:05 +0000 (15:51 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 23 May 2013 15:55:34 +0000 (17:55 +0200)
Since f03dcc5 we use [::] as the listening address both on qemu
command line in -incoming and in nbd-server-start QMP command.
However the latter requires just :: without the braces.

src/qemu/qemu_migration.c

index 4767908f421e440189c36cdc859d8017aa232a5c..73ced73c18178058aec8013929b31cc03f713c3b 100644 (file)
@@ -1112,6 +1112,12 @@ qemuMigrationStartNBDServer(virQEMUDriverPtr driver,
     unsigned short port = 0;
     char *diskAlias = NULL;
     size_t i;
+    const char *host;
+
+    if (STREQ(listenAddr, "[::]"))
+        host = "::";
+    else
+        host = listenAddr;
 
     for (i = 0; i < vm->def->ndisks; i++) {
         virDomainDiskDefPtr disk = vm->def->disks[i];
@@ -1133,7 +1139,7 @@ qemuMigrationStartNBDServer(virQEMUDriverPtr driver,
 
         if (!port &&
             ((virPortAllocatorAcquire(driver->remotePorts, &port) < 0) ||
-             (qemuMonitorNBDServerStart(priv->mon, listenAddr, port) < 0))) {
+             (qemuMonitorNBDServerStart(priv->mon, host, port) < 0))) {
             qemuDomainObjExitMonitor(driver, vm);
             goto cleanup;
         }