]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Fix event generated for qemuDomainRevertToSnapshot (pause->run)
authorJohn Ferlan <jferlan@redhat.com>
Tue, 15 Dec 2015 18:39:44 +0000 (13:39 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 17 Dec 2015 13:04:02 +0000 (08:04 -0500)
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

src/qemu/qemu_driver.c

index 783a7cdfea69324850a498ed5d8d7dc2461c5a92..deeffc1312b09d389e32eba02344bbe19ff517db 100644 (file)
@@ -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 */
                 detail = VIR_DOMAIN_EVENT_RESUMED;
                 event = virDomainEventLifecycleNewFromObj(vm,