We store the flags passed to the API which started the migration. Let's
use them instead of a separate bool to check if post-copy migration was
requested.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_domain.c | 1 -
src/qemu/qemu_domain.h | 1 -
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_migration.c | 4 ----
4 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index d82c9aad23..2a15eb273b 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -332,7 +332,6 @@ qemuDomainObjResetAsyncJob(qemuDomainObjPrivatePtr priv)
job->abortJob = false;
job->spiceMigration = false;
job->spiceMigrated = false;
- job->postcopyEnabled = false;
job->dumpCompleted = false;
VIR_FREE(job->error);
VIR_FREE(job->current);
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 8d608da121..91385da2a9 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -176,7 +176,6 @@ struct _qemuDomainJobObj {
bool spiceMigration; /* we asked for spice migration and we
* should wait for it to finish */
bool spiceMigrated; /* spice migration completed */
- bool postcopyEnabled; /* post-copy migration was enabled */
char *error; /* job event completion error */
bool dumpCompleted; /* dump completed */
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 04eb0b6929..b871dab581 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13840,7 +13840,7 @@ qemuDomainMigrateStartPostCopy(virDomainPtr dom,
goto endjob;
}
- if (!priv->job.postcopyEnabled) {
+ if (!(priv->job.apiFlags & VIR_MIGRATE_POSTCOPY)) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("switching to post-copy requires migration to be "
"started with VIR_MIGRATE_POSTCOPY flag"));
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 3ce180dd39..808a6c147e 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2403,8 +2403,6 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
migParams) < 0)
goto stopjob;
- priv->job.postcopyEnabled = flags & VIR_MIGRATE_POSTCOPY;
-
if (mig->nbd &&
flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC)
&&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NBD_SERVER)) {
@@ -3340,8 +3338,6 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver,
migParams) < 0)
goto error;
- priv->job.postcopyEnabled = flags & VIR_MIGRATE_POSTCOPY;
-
if (migrate_flags & (QEMU_MONITOR_MIGRATE_NON_SHARED_DISK |
QEMU_MONITOR_MIGRATE_NON_SHARED_INC)) {
if (mig->nbd) {
--
2.17.0