qemuMigrationPrepareAny called multiple of the functions starting the
qemu process for incomming 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.
---
src/qemu/qemu_migration.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 32904b7b9..078da1dfd 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -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;
--
2.14.1