提交 f87668b7 编写于 作者: J Jiri Denemark

qemu: Fix NBD migration with default listenAddress

My commit 674afcb0 moved computing the
default listen address from qemuMigrationPrepareAny to
qemuMigrationPrepareIncoming. However, I didn't notice listenAddress was
later passed to qemuMigrationStartNBDServer. Thus, it would be called
with the original value of listenAddress (NULL).

Let's add the updated listen address to qemuProcessIncomingDef and use
it when starting NBD servers.
Reported-by: NMichael Chapman <mike@very.puzzling.org>
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 aa7735e9
......@@ -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;
}
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册