mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemuDomainSnapshotCreateActiveExternal: Grab agent job
Now that we have agent job we can grab it while freezing/thawing guest file system before/after doing snapshot. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
bd59e0d7c2
commit
cb2bc7a492
@ -15144,7 +15144,19 @@ qemuDomainSnapshotCreateActiveExternal(virQEMUDriverPtr driver,
|
|||||||
* The command will fail if the guest is paused or the guest agent
|
* The command will fail if the guest is paused or the guest agent
|
||||||
* is not running, or is already quiesced. */
|
* is not running, or is already quiesced. */
|
||||||
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE) {
|
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE) {
|
||||||
int freeze = qemuDomainSnapshotFSFreeze(driver, vm, NULL, 0);
|
int freeze;
|
||||||
|
|
||||||
|
if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_MODIFY) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
if (virDomainObjCheckActive(vm) < 0) {
|
||||||
|
qemuDomainObjEndAgentJob(vm);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
freeze = qemuDomainSnapshotFSFreeze(driver, vm, NULL, 0);
|
||||||
|
qemuDomainObjEndAgentJob(vm);
|
||||||
|
|
||||||
if (freeze < 0) {
|
if (freeze < 0) {
|
||||||
/* the helper reported the error */
|
/* the helper reported the error */
|
||||||
if (freeze == -2)
|
if (freeze == -2)
|
||||||
@ -15281,12 +15293,17 @@ qemuDomainSnapshotCreateActiveExternal(virQEMUDriverPtr driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (thaw != 0 &&
|
if (thaw != 0 &&
|
||||||
qemuDomainSnapshotFSThaw(driver, vm, ret == 0 && thaw > 0) < 0) {
|
qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_MODIFY) >= 0 &&
|
||||||
|
virDomainObjIsActive(vm)) {
|
||||||
|
if (qemuDomainSnapshotFSThaw(driver, vm, ret == 0 && thaw > 0) < 0) {
|
||||||
/* helper reported the error, if it was needed */
|
/* helper reported the error, if it was needed */
|
||||||
if (thaw > 0)
|
if (thaw > 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qemuDomainObjEndAgentJob(vm);
|
||||||
|
}
|
||||||
|
|
||||||
virQEMUSaveDataFree(data);
|
virQEMUSaveDataFree(data);
|
||||||
VIR_FREE(xml);
|
VIR_FREE(xml);
|
||||||
VIR_FREE(compressedpath);
|
VIR_FREE(compressedpath);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user