[libvirt PATCH 06.5/12] test: snapshot revert: properly emulate starting CPUs

Pavel Hrdina posted 1 patch 2 weeks, 1 day ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/f0a78984d9372090b32958f87f7a6cc4a626458c.1637655464.git.phrdina@redhat.com
src/test/test_driver.c |  3 +++
tests/virsh-snapshot   | 14 +++++++-------
2 files changed, 10 insertions(+), 7 deletions(-)

[libvirt PATCH 06.5/12] test: snapshot revert: properly emulate starting CPUs

Posted by Pavel Hrdina 2 weeks, 1 day ago
When active snapshot is reverted we stop CPUs in order to load the
snapshot but we never start the CPUs again.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
 src/test/test_driver.c |  3 +++
 tests/virsh-snapshot   | 14 +++++++-------
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index c17ed9d2a4..985f08ea1f 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -9144,6 +9144,9 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
             virObjectUnref(event);
             event = NULL;
 
+            virDomainObjSetState(vm, VIR_DOMAIN_RUNNING,
+                                 VIR_DOMAIN_PAUSED_FROM_SNAPSHOT);
+
             if (was_stopped) {
                 /* Transition 2 */
                 event = virDomainEventLifecycleNewFromObj(vm,
diff --git a/tests/virsh-snapshot b/tests/virsh-snapshot
index 289de5b2db..4c64bb537b 100755
--- a/tests/virsh-snapshot
+++ b/tests/virsh-snapshot
@@ -137,25 +137,25 @@ Domain snapshot s1 deleted
  Name   Creation Time               State
 ---------------------------------------------
  s3     TIMESTAMP   running
- s7     TIMESTAMP   paused
+ s7     TIMESTAMP   running
 
  Name   Creation Time               State
 ---------------------------------------------
  s2     TIMESTAMP   running
- s4     TIMESTAMP   paused
- s5     TIMESTAMP   paused
- s8     TIMESTAMP   paused
+ s4     TIMESTAMP   running
+ s5     TIMESTAMP   running
+ s8     TIMESTAMP   running
 
  Name   Creation Time               State     Parent
 ------------------------------------------------------
  s3     TIMESTAMP   running
- s6     TIMESTAMP   paused    s3
- s7     TIMESTAMP   paused
+ s6     TIMESTAMP   running   s3
+ s7     TIMESTAMP   running
 
  Name   Creation Time               State
 ---------------------------------------------
  s2     TIMESTAMP   running
- s6     TIMESTAMP   paused
+ s6     TIMESTAMP   running
 
 s2
 s4
-- 
2.31.1

Re: [libvirt PATCH 06.5/12] test: snapshot revert: properly emulate starting CPUs

Posted by Peter Krempa 2 weeks, 1 day ago
On Tue, Nov 23, 2021 at 09:20:20 +0100, Pavel Hrdina wrote:
> When active snapshot is reverted we stop CPUs in order to load the
> snapshot but we never start the CPUs again.
> 
> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> ---
>  src/test/test_driver.c |  3 +++
>  tests/virsh-snapshot   | 14 +++++++-------
>  2 files changed, 10 insertions(+), 7 deletions(-)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>