mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-07 05:57:30 +03:00
qemu: Properly avoid cancelling memory-only dump
migrate_cancel QMP command cannot be used for cancelling memory-only dumps and priv->job.dump_memory_only is used for reporting an error if someone calls virDomainAbortJob when memory-only dump job is running. Since commit 150930e3098 the dump_memory_only flag is set only if dump-guest-memory command was called without the detach parameter. This would incorrectly allow libvirt to send migrate_cancel while the detached memory-only dump is running. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
d634f7d759
commit
a5bc7130f3
@ -3772,12 +3772,12 @@ qemuDumpToFd(virQEMUDriverPtr driver,
|
||||
if (qemuSecuritySetImageFDLabel(driver->securityManager, vm->def, fd) < 0)
|
||||
return -1;
|
||||
|
||||
if (detach) {
|
||||
priv->job.dump_memory_only = true;
|
||||
|
||||
if (detach)
|
||||
priv->job.current->statsType = QEMU_DOMAIN_JOB_STATS_TYPE_MEMDUMP;
|
||||
} else {
|
||||
else
|
||||
VIR_FREE(priv->job.current);
|
||||
priv->job.dump_memory_only = true;
|
||||
}
|
||||
|
||||
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
|
||||
return -1;
|
||||
@ -13450,7 +13450,7 @@ static int qemuDomainAbortJob(virDomainPtr dom)
|
||||
|
||||
priv = vm->privateData;
|
||||
|
||||
if (!priv->job.asyncJob || priv->job.dump_memory_only) {
|
||||
if (!priv->job.asyncJob) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("no job is active on the domain"));
|
||||
goto endjob;
|
||||
@ -13463,6 +13463,13 @@ static int qemuDomainAbortJob(virDomainPtr dom)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
if (priv->job.asyncJob == QEMU_ASYNC_JOB_DUMP &&
|
||||
priv->job.dump_memory_only) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("cannot abort memory-only dump"));
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_OUT &&
|
||||
(priv->job.current->status == QEMU_DOMAIN_JOB_STATUS_POSTCOPY ||
|
||||
(virDomainObjGetState(vm, &reason) == VIR_DOMAIN_PAUSED &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user