qemu: Drop priv->job.postcopyEnabled bool

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@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Jiri Denemark 2018-03-21 14:22:45 +01:00
parent ceb4ff664b
commit ea9aab3828
4 changed files with 1 additions and 7 deletions

View File

@ -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);

View File

@ -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 */

View File

@ -13818,7 +13818,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"));

View File

@ -2406,8 +2406,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)) {
@ -3346,8 +3344,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) {