mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu: Simplify qemuProcessIncomingDef
All QEMU releases currently supported by libvirt already understand "-incoming defer". We can drop the code handling "-incoming URI". Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
f7ed8d929f
commit
fa9c730bdd
@ -3040,8 +3040,7 @@ qemuMigrationDstPrepareAny(virQEMUDriver *driver,
|
|||||||
VIR_DEBUG("Received no lockstate");
|
VIR_DEBUG("Received no lockstate");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (incoming->deferredURI &&
|
if (qemuMigrationDstRun(driver, vm, incoming->uri,
|
||||||
qemuMigrationDstRun(driver, vm, incoming->deferredURI,
|
|
||||||
VIR_ASYNC_JOB_MIGRATION_IN) < 0)
|
VIR_ASYNC_JOB_MIGRATION_IN) < 0)
|
||||||
goto stopjob;
|
goto stopjob;
|
||||||
|
|
||||||
|
@ -4559,8 +4559,7 @@ qemuProcessIncomingDefFree(qemuProcessIncomingDef *inc)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
g_free(inc->address);
|
g_free(inc->address);
|
||||||
g_free(inc->launchURI);
|
g_free(inc->uri);
|
||||||
g_free(inc->deferredURI);
|
|
||||||
g_free(inc);
|
g_free(inc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4589,15 +4588,10 @@ qemuProcessIncomingDefNew(virQEMUCaps *qemuCaps,
|
|||||||
|
|
||||||
inc->address = g_strdup(listenAddress);
|
inc->address = g_strdup(listenAddress);
|
||||||
|
|
||||||
inc->launchURI = qemuMigrationDstGetURI(migrateFrom, fd);
|
inc->uri = qemuMigrationDstGetURI(migrateFrom, fd);
|
||||||
if (!inc->launchURI)
|
if (!inc->uri)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_INCOMING_DEFER)) {
|
|
||||||
inc->deferredURI = inc->launchURI;
|
|
||||||
inc->launchURI = g_strdup("defer");
|
|
||||||
}
|
|
||||||
|
|
||||||
inc->fd = fd;
|
inc->fd = fd;
|
||||||
inc->path = path;
|
inc->path = path;
|
||||||
|
|
||||||
@ -7373,12 +7367,11 @@ qemuProcessLaunch(virConnectPtr conn,
|
|||||||
unsigned long long maxMemLock = 0;
|
unsigned long long maxMemLock = 0;
|
||||||
|
|
||||||
VIR_DEBUG("conn=%p driver=%p vm=%p name=%s if=%d asyncJob=%d "
|
VIR_DEBUG("conn=%p driver=%p vm=%p name=%s if=%d asyncJob=%d "
|
||||||
"incoming.launchURI=%s incoming.deferredURI=%s "
|
"incoming.uri=%s "
|
||||||
"incoming.fd=%d incoming.path=%s "
|
"incoming.fd=%d incoming.path=%s "
|
||||||
"snapshot=%p vmop=%d flags=0x%x",
|
"snapshot=%p vmop=%d flags=0x%x",
|
||||||
conn, driver, vm, vm->def->name, vm->def->id, asyncJob,
|
conn, driver, vm, vm->def->name, vm->def->id, asyncJob,
|
||||||
NULLSTR(incoming ? incoming->launchURI : NULL),
|
NULLSTR(incoming ? incoming->uri : NULL),
|
||||||
NULLSTR(incoming ? incoming->deferredURI : NULL),
|
|
||||||
incoming ? incoming->fd : -1,
|
incoming ? incoming->fd : -1,
|
||||||
NULLSTR(incoming ? incoming->path : NULL),
|
NULLSTR(incoming ? incoming->path : NULL),
|
||||||
snapshot, vmop, flags);
|
snapshot, vmop, flags);
|
||||||
@ -7429,7 +7422,7 @@ qemuProcessLaunch(virConnectPtr conn,
|
|||||||
VIR_DEBUG("Building emulator command line");
|
VIR_DEBUG("Building emulator command line");
|
||||||
if (!(cmd = qemuBuildCommandLine(driver,
|
if (!(cmd = qemuBuildCommandLine(driver,
|
||||||
vm,
|
vm,
|
||||||
incoming ? incoming->launchURI : NULL,
|
incoming ? "defer" : NULL,
|
||||||
snapshot, vmop,
|
snapshot, vmop,
|
||||||
false,
|
false,
|
||||||
qemuCheckFips(vm),
|
qemuCheckFips(vm),
|
||||||
@ -7856,8 +7849,7 @@ qemuProcessStart(virConnectPtr conn,
|
|||||||
relabel = true;
|
relabel = true;
|
||||||
|
|
||||||
if (incoming) {
|
if (incoming) {
|
||||||
if (incoming->deferredURI &&
|
if (qemuMigrationDstRun(driver, vm, incoming->uri, asyncJob) < 0)
|
||||||
qemuMigrationDstRun(driver, vm, incoming->deferredURI, asyncJob) < 0)
|
|
||||||
goto stop;
|
goto stop;
|
||||||
} else {
|
} else {
|
||||||
/* Refresh state of devices from QEMU. During migration this happens
|
/* Refresh state of devices from QEMU. During migration this happens
|
||||||
|
@ -52,8 +52,7 @@ void qemuProcessReconnectAll(virQEMUDriver *driver);
|
|||||||
typedef struct _qemuProcessIncomingDef qemuProcessIncomingDef;
|
typedef struct _qemuProcessIncomingDef qemuProcessIncomingDef;
|
||||||
struct _qemuProcessIncomingDef {
|
struct _qemuProcessIncomingDef {
|
||||||
char *address; /* address where QEMU is supposed to listen */
|
char *address; /* address where QEMU is supposed to listen */
|
||||||
char *launchURI; /* used as a parameter for -incoming command line option */
|
char *uri; /* used when calling migrate-incoming QMP command */
|
||||||
char *deferredURI; /* used when calling migrate-incoming QMP command */
|
|
||||||
int fd; /* for fd:N URI */
|
int fd; /* for fd:N URI */
|
||||||
const char *path; /* path associated with fd */
|
const char *path; /* path associated with fd */
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user