On 05/23/2013 04:32 PM, Osier Yang wrote:
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.
No, we don't call qemuMigrationStartNBDServer for tunnelled migration.
> + 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/
Thanks, pushed now.
Jan