mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
snapshot: qemu: Add async job type for snapshots
The new external system checkpoints will require an async job while the snapshot is taken. This patch adds QEMU_ASYNC_JOB_SNAPSHOT to track this job type.
This commit is contained in:
parent
5f75bd4bbe
commit
2a59a3d597
@ -65,6 +65,7 @@ VIR_ENUM_IMPL(qemuDomainAsyncJob, QEMU_ASYNC_JOB_LAST,
|
|||||||
"migration in",
|
"migration in",
|
||||||
"save",
|
"save",
|
||||||
"dump",
|
"dump",
|
||||||
|
"snapshot",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -79,6 +80,7 @@ qemuDomainAsyncJobPhaseToString(enum qemuDomainAsyncJob job,
|
|||||||
|
|
||||||
case QEMU_ASYNC_JOB_SAVE:
|
case QEMU_ASYNC_JOB_SAVE:
|
||||||
case QEMU_ASYNC_JOB_DUMP:
|
case QEMU_ASYNC_JOB_DUMP:
|
||||||
|
case QEMU_ASYNC_JOB_SNAPSHOT:
|
||||||
case QEMU_ASYNC_JOB_NONE:
|
case QEMU_ASYNC_JOB_NONE:
|
||||||
case QEMU_ASYNC_JOB_LAST:
|
case QEMU_ASYNC_JOB_LAST:
|
||||||
; /* fall through */
|
; /* fall through */
|
||||||
@ -101,6 +103,7 @@ qemuDomainAsyncJobPhaseFromString(enum qemuDomainAsyncJob job,
|
|||||||
|
|
||||||
case QEMU_ASYNC_JOB_SAVE:
|
case QEMU_ASYNC_JOB_SAVE:
|
||||||
case QEMU_ASYNC_JOB_DUMP:
|
case QEMU_ASYNC_JOB_DUMP:
|
||||||
|
case QEMU_ASYNC_JOB_SNAPSHOT:
|
||||||
case QEMU_ASYNC_JOB_NONE:
|
case QEMU_ASYNC_JOB_NONE:
|
||||||
case QEMU_ASYNC_JOB_LAST:
|
case QEMU_ASYNC_JOB_LAST:
|
||||||
; /* fall through */
|
; /* fall through */
|
||||||
|
@ -92,6 +92,7 @@ enum qemuDomainAsyncJob {
|
|||||||
QEMU_ASYNC_JOB_MIGRATION_IN,
|
QEMU_ASYNC_JOB_MIGRATION_IN,
|
||||||
QEMU_ASYNC_JOB_SAVE,
|
QEMU_ASYNC_JOB_SAVE,
|
||||||
QEMU_ASYNC_JOB_DUMP,
|
QEMU_ASYNC_JOB_DUMP,
|
||||||
|
QEMU_ASYNC_JOB_SNAPSHOT,
|
||||||
|
|
||||||
QEMU_ASYNC_JOB_LAST
|
QEMU_ASYNC_JOB_LAST
|
||||||
};
|
};
|
||||||
|
@ -3025,23 +3025,27 @@ qemuProcessRecoverJob(struct qemud_driver *driver,
|
|||||||
|
|
||||||
case QEMU_ASYNC_JOB_SAVE:
|
case QEMU_ASYNC_JOB_SAVE:
|
||||||
case QEMU_ASYNC_JOB_DUMP:
|
case QEMU_ASYNC_JOB_DUMP:
|
||||||
|
case QEMU_ASYNC_JOB_SNAPSHOT:
|
||||||
qemuDomainObjEnterMonitor(driver, vm);
|
qemuDomainObjEnterMonitor(driver, vm);
|
||||||
ignore_value(qemuMonitorMigrateCancel(priv->mon));
|
ignore_value(qemuMonitorMigrateCancel(priv->mon));
|
||||||
qemuDomainObjExitMonitor(driver, vm);
|
qemuDomainObjExitMonitor(driver, vm);
|
||||||
/* resume the domain but only if it was paused as a result of
|
/* resume the domain but only if it was paused as a result of
|
||||||
* running save/dump operation. Although we are recovering an
|
* running a migration-to-file operation. Although we are
|
||||||
* async job, this function is run at startup and must resume
|
* recovering an async job, this function is run at startup
|
||||||
* things using sync monitor connections. */
|
* and must resume things using sync monitor connections. */
|
||||||
if (state == VIR_DOMAIN_PAUSED &&
|
if (state == VIR_DOMAIN_PAUSED &&
|
||||||
((job->asyncJob == QEMU_ASYNC_JOB_DUMP &&
|
((job->asyncJob == QEMU_ASYNC_JOB_DUMP &&
|
||||||
reason == VIR_DOMAIN_PAUSED_DUMP) ||
|
reason == VIR_DOMAIN_PAUSED_DUMP) ||
|
||||||
(job->asyncJob == QEMU_ASYNC_JOB_SAVE &&
|
(job->asyncJob == QEMU_ASYNC_JOB_SAVE &&
|
||||||
reason == VIR_DOMAIN_PAUSED_SAVE) ||
|
reason == VIR_DOMAIN_PAUSED_SAVE) ||
|
||||||
reason == VIR_DOMAIN_PAUSED_UNKNOWN)) {
|
(job->asyncJob == QEMU_ASYNC_JOB_SNAPSHOT &&
|
||||||
if (qemuProcessStartCPUs(driver, vm, conn,
|
reason == VIR_DOMAIN_PAUSED_SNAPSHOT) ||
|
||||||
VIR_DOMAIN_RUNNING_UNPAUSED,
|
reason == VIR_DOMAIN_PAUSED_UNKNOWN)) {
|
||||||
QEMU_ASYNC_JOB_NONE) < 0) {
|
if (qemuProcessStartCPUs(driver, vm, conn,
|
||||||
VIR_WARN("Could not resume domain %s after", vm->def->name);
|
VIR_DOMAIN_RUNNING_UNPAUSED,
|
||||||
|
QEMU_ASYNC_JOB_NONE) < 0) {
|
||||||
|
VIR_WARN("Could not resume domain '%s' after migration to file",
|
||||||
|
vm->def->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user