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.
This commit is contained in:
Ján Tomko 2013-05-23 15:51:05 +02:00
parent a32b41746c
commit 2326006410

View 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;
}