]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Pass running reason to RESUME event handler
authorJiri Denemark <jdenemar@redhat.com>
Mon, 10 Sep 2018 17:41:53 +0000 (19:41 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 25 Sep 2018 18:42:25 +0000 (20:42 +0200)
commit5dab984ed0cd0332e59d719420ab2f9d009b952f
treeb754d49a5d4d58edbd98aac12bd1c1d239716bcb
parent54b5b0ac3945ad5417b67bec8443cf6e7b3d482b
qemu: Pass running reason to RESUME event handler

Whenever we get the RESUME event from QEMU, we change the state of the
affected domain to VIR_DOMAIN_RUNNING with VIR_DOMAIN_RUNNING_UNPAUSED
reason. This is fine if the domain is resumed unexpectedly, but when we
sent "cont" to QEMU we usually have a better reason for the state
change. The better reason is used in qemuProcessStartCPUs which also
sets the domain state to running if qemuMonitorStartCPUs reports
success. Thus we may end up with two state updates in a row, but the
final reason is correct.

This patch is a preparation for dropping the state change done in
qemuMonitorStartCPUs for which we need to pass the actual running reason
to the RESUME event handler and use it there instead of
VIR_DOMAIN_RUNNING_UNPAUSED.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_domain.h
src/qemu/qemu_process.c