mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-24 13:35:17 +00:00
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:
parent
ceb4ff664b
commit
ea9aab3828
@ -332,7 +332,6 @@ qemuDomainObjResetAsyncJob(qemuDomainObjPrivatePtr priv)
|
|||||||
job->abortJob = false;
|
job->abortJob = false;
|
||||||
job->spiceMigration = false;
|
job->spiceMigration = false;
|
||||||
job->spiceMigrated = false;
|
job->spiceMigrated = false;
|
||||||
job->postcopyEnabled = false;
|
|
||||||
job->dumpCompleted = false;
|
job->dumpCompleted = false;
|
||||||
VIR_FREE(job->error);
|
VIR_FREE(job->error);
|
||||||
VIR_FREE(job->current);
|
VIR_FREE(job->current);
|
||||||
|
@ -176,7 +176,6 @@ struct _qemuDomainJobObj {
|
|||||||
bool spiceMigration; /* we asked for spice migration and we
|
bool spiceMigration; /* we asked for spice migration and we
|
||||||
* should wait for it to finish */
|
* should wait for it to finish */
|
||||||
bool spiceMigrated; /* spice migration completed */
|
bool spiceMigrated; /* spice migration completed */
|
||||||
bool postcopyEnabled; /* post-copy migration was enabled */
|
|
||||||
char *error; /* job event completion error */
|
char *error; /* job event completion error */
|
||||||
bool dumpCompleted; /* dump completed */
|
bool dumpCompleted; /* dump completed */
|
||||||
|
|
||||||
|
@ -13818,7 +13818,7 @@ qemuDomainMigrateStartPostCopy(virDomainPtr dom,
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!priv->job.postcopyEnabled) {
|
if (!(priv->job.apiFlags & VIR_MIGRATE_POSTCOPY)) {
|
||||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||||
_("switching to post-copy requires migration to be "
|
_("switching to post-copy requires migration to be "
|
||||||
"started with VIR_MIGRATE_POSTCOPY flag"));
|
"started with VIR_MIGRATE_POSTCOPY flag"));
|
||||||
|
@ -2406,8 +2406,6 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
|
|||||||
migParams) < 0)
|
migParams) < 0)
|
||||||
goto stopjob;
|
goto stopjob;
|
||||||
|
|
||||||
priv->job.postcopyEnabled = flags & VIR_MIGRATE_POSTCOPY;
|
|
||||||
|
|
||||||
if (mig->nbd &&
|
if (mig->nbd &&
|
||||||
flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC) &&
|
flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC) &&
|
||||||
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NBD_SERVER)) {
|
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NBD_SERVER)) {
|
||||||
@ -3346,8 +3344,6 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver,
|
|||||||
migParams) < 0)
|
migParams) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
priv->job.postcopyEnabled = flags & VIR_MIGRATE_POSTCOPY;
|
|
||||||
|
|
||||||
if (migrate_flags & (QEMU_MONITOR_MIGRATE_NON_SHARED_DISK |
|
if (migrate_flags & (QEMU_MONITOR_MIGRATE_NON_SHARED_DISK |
|
||||||
QEMU_MONITOR_MIGRATE_NON_SHARED_INC)) {
|
QEMU_MONITOR_MIGRATE_NON_SHARED_INC)) {
|
||||||
if (mig->nbd) {
|
if (mig->nbd) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user