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

Osier Yang jyang at redhat.com
Thu May 23 14:32:34 UTC 2013


On 23/05/13 22:23, Ján Tomko wrote:
> 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, "[::]"))

Can "listenAddr" be NULL?  Guess no though.

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

ACK anyway, you can fix it easily if it can be NULL by 
s/STREQ/STREQ_NONNULL/

Osier




More information about the libvir-list mailing list