On Tue, Dec 15, 2015 at 02:18:52PM -0500, John Ferlan wrote:
A closer review of the code shows that for the transition from paused
to
running which was supposed to emit the VIR_DOMAIN_EVENT_RESUMED - no event
would be generated. Rather the event is generated when going from running
to running.
Following the 'was_running' boolean shows it is set when the domain obj
is active and the domain obj state is VIR_DOMAIN_RUNNING. So rather than
using was_running to generate the RESUMED event, use !was_running
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
I hope I've read the bread crumbs in the code correctly regarding state
transitions! Saw this while reviewing something else:
http://www.redhat.com/archives/libvir-list/2015-December/msg00330.html
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 783a7cd..deeffc1 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15549,7 +15549,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_STARTED,
detail);
- } else if (was_running) {
+ } else if (!was_running) {
/* Transition 8 */
Transition 8 really is paused->running and was_running is set to true
only if the domain state is _RUNNING. And the variable is used only
here, so if I read them correctly, this should be fixed. But I must
say, that snapshot restoring logic... is nasty.
ACK.
detail = VIR_DOMAIN_EVENT_RESUMED;
event = virDomainEventLifecycleNewFromObj(vm,
--
2.5.0
--
libvir-list mailing list
libvir-list(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list