[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] qemu: fix NBD migration to hosts with IPv6 enabled



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 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 4767908..73ced73 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -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;
         }
-- 
1.8.1.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]