mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 03:42:19 +00:00
qemu: migration: Extract flags for starting VM into a variable
qemuMigrationPrepareAny called multiple of the functions starting the qemu process for incoming migration by adding the flags explicitly. Extract them to a variable so that they can be easily used for other calls or changed in the future.
This commit is contained in:
parent
fda4298515
commit
b8c0262efa
@ -2511,6 +2511,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
|
||||
bool tunnel = !!st;
|
||||
char *xmlout = NULL;
|
||||
unsigned int cookieFlags;
|
||||
unsigned int startFlags;
|
||||
virCapsPtr caps = NULL;
|
||||
qemuProcessIncomingDefPtr incoming = NULL;
|
||||
bool taint_hook = false;
|
||||
@ -2671,8 +2672,10 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
|
||||
goto stopjob;
|
||||
}
|
||||
|
||||
startFlags = VIR_QEMU_PROCESS_START_AUTODESTROY;
|
||||
|
||||
if (qemuProcessInit(driver, vm, mig->cpu, QEMU_ASYNC_JOB_MIGRATION_IN,
|
||||
true, VIR_QEMU_PROCESS_START_AUTODESTROY) < 0)
|
||||
true, startFlags) < 0)
|
||||
goto stopjob;
|
||||
stopProcess = true;
|
||||
|
||||
@ -2681,8 +2684,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
|
||||
dataFD[0])))
|
||||
goto stopjob;
|
||||
|
||||
if (qemuProcessPrepareDomain(dconn, driver, vm,
|
||||
VIR_QEMU_PROCESS_START_AUTODESTROY) < 0)
|
||||
if (qemuProcessPrepareDomain(dconn, driver, vm, startFlags) < 0)
|
||||
goto stopjob;
|
||||
|
||||
if (qemuProcessPrepareHost(driver, vm, !!incoming) < 0)
|
||||
@ -2691,7 +2693,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
|
||||
rv = qemuProcessLaunch(dconn, driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN,
|
||||
incoming, NULL,
|
||||
VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_START,
|
||||
VIR_QEMU_PROCESS_START_AUTODESTROY);
|
||||
startFlags);
|
||||
if (rv < 0) {
|
||||
if (rv == -2)
|
||||
relabel = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user