diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 6be11b419c..cb8c75dd06 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -3365,7 +3365,8 @@ qemuMigrationPrepareIncoming(virDomainObjPtr vm, goto cleanup; } - inc = qemuProcessIncomingDefNew(priv->qemuCaps, migrateFrom, fd, NULL); + inc = qemuProcessIncomingDefNew(priv->qemuCaps, listenAddress, + migrateFrom, fd, NULL); cleanup: VIR_FREE(migrateFrom); @@ -3586,7 +3587,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, if (mig->nbd && flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC) && virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NBD_SERVER)) { - if (qemuMigrationStartNBDServer(driver, vm, listenAddress, + if (qemuMigrationStartNBDServer(driver, vm, incoming->address, nmigrate_disks, migrate_disks) < 0) { goto stopjob; } diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index f2740687f6..819ad05f76 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4124,6 +4124,7 @@ qemuProcessIncomingDefFree(qemuProcessIncomingDefPtr inc) if (!inc) return; + VIR_FREE(inc->address); VIR_FREE(inc->launchURI); VIR_FREE(inc->deferredURI); VIR_FREE(inc); @@ -4137,6 +4138,7 @@ qemuProcessIncomingDefFree(qemuProcessIncomingDefPtr inc) */ qemuProcessIncomingDefPtr qemuProcessIncomingDefNew(virQEMUCapsPtr qemuCaps, + const char *listenAddress, const char *migrateFrom, int fd, const char *path) @@ -4149,6 +4151,9 @@ qemuProcessIncomingDefNew(virQEMUCapsPtr qemuCaps, if (VIR_ALLOC(inc) < 0) return NULL; + if (VIR_STRDUP(inc->address, listenAddress) < 0) + goto error; + inc->launchURI = qemuMigrationIncomingURI(migrateFrom, fd); if (!inc->launchURI) goto error; @@ -5137,7 +5142,7 @@ qemuProcessStart(virConnectPtr conn, goto cleanup; if (migrateFrom) { - incoming = qemuProcessIncomingDefNew(priv->qemuCaps, migrateFrom, + incoming = qemuProcessIncomingDefNew(priv->qemuCaps, NULL, migrateFrom, migrateFd, migratePath); if (!incoming) goto stop; diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index 85e3a06817..c67411139a 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -47,6 +47,7 @@ int qemuProcessAssignPCIAddresses(virDomainDefPtr def); typedef struct _qemuProcessIncomingDef qemuProcessIncomingDef; typedef qemuProcessIncomingDef *qemuProcessIncomingDefPtr; struct _qemuProcessIncomingDef { + char *address; /* address where QEMU is supposed to listen */ char *launchURI; /* used as a parameter for -incoming command line option */ char *deferredURI; /* used when calling migrate-incoming QMP command */ int fd; /* for fd:N URI */ @@ -54,6 +55,7 @@ struct _qemuProcessIncomingDef { }; qemuProcessIncomingDefPtr qemuProcessIncomingDefNew(virQEMUCapsPtr qemuCaps, + const char *listenAddress, const char *migrateFrom, int fd, const char *path);