mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
qemu: refresh internal domain state after reset
Internal domain state may change during the reset and qemu does not always send events about it. In case it happens, internal state of the domain in libvirt would be inconsistent with the internal state in qemu which could cause additional problems (e.g. cdrom tray state can change from open to closed). The solution is to refresh state after a successful reset to query qemu about the current internal domain state. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1824722 Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
7a20341270
commit
f47af66624
@ -2000,6 +2000,7 @@ qemuDomainReset(virDomainPtr dom, unsigned int flags)
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
qemuDomainObjPrivate *priv;
|
qemuDomainObjPrivate *priv;
|
||||||
virDomainState state;
|
virDomainState state;
|
||||||
|
virQEMUDriver *driver = dom->conn->privateData;
|
||||||
|
|
||||||
virCheckFlags(0, -1);
|
virCheckFlags(0, -1);
|
||||||
|
|
||||||
@ -2026,6 +2027,8 @@ qemuDomainReset(virDomainPtr dom, unsigned int flags)
|
|||||||
if (state == VIR_DOMAIN_CRASHED)
|
if (state == VIR_DOMAIN_CRASHED)
|
||||||
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_CRASHED);
|
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_CRASHED);
|
||||||
|
|
||||||
|
qemuProcessRefreshState(driver, vm, VIR_ASYNC_JOB_NONE);
|
||||||
|
|
||||||
endjob:
|
endjob:
|
||||||
virDomainObjEndJob(vm);
|
virDomainObjEndJob(vm);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user