mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 03:42:19 +00:00
qemuProcessHandleReset: Don't emulate lifecycle actions for RESET event
The RESET event is delivered by qemu only when the guest OS is actually allowed to reboot ('-no-reboot' or equivalent is not used) and due to the nature of async handling of the events VM is actually already executing guest code after the reboot, until our code gets to killing it. In general it should have been impossible to reach a state where the reboot action is 'destroy' but we didn't use '-no-reboot' but due to various bugs it was. Due to the fact that this was not a desired operation and additionally guest code already is executing I think the best option is not to kill the VM any more (possible data loss?) and rely for the proper fix where we use the new 'set-action' QMP command to enable an equivalent behaviour to '-no-reboot' during runtime. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
5fb54459e3
commit
24dab19f8a
@ -443,27 +443,6 @@ qemuProcessHandleReset(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
||||||
|
|
||||||
if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY ||
|
|
||||||
vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE) {
|
|
||||||
|
|
||||||
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (!virDomainObjIsActive(vm)) {
|
|
||||||
VIR_DEBUG("Ignoring RESET event from inactive domain %s",
|
|
||||||
vm->def->name);
|
|
||||||
goto endjob;
|
|
||||||
}
|
|
||||||
|
|
||||||
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED,
|
|
||||||
QEMU_ASYNC_JOB_NONE, 0);
|
|
||||||
virDomainAuditStop(vm, "destroyed");
|
|
||||||
qemuDomainRemoveInactive(driver, vm);
|
|
||||||
endjob:
|
|
||||||
qemuDomainObjEndJob(driver, vm);
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup:
|
|
||||||
virObjectUnlock(vm);
|
virObjectUnlock(vm);
|
||||||
virObjectEventStateQueue(driver->domainEventState, event);
|
virObjectEventStateQueue(driver->domainEventState, event);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user