From 8084639cd807b02ad096ed6e36bf882d86a22089 Mon Sep 17 00:00:00 2001 From: Michael Weiser Date: Wed, 18 Dec 2019 23:26:11 +0100 Subject: [PATCH] virtManager: object: domain: Fix snapshot run check snap.is_running() returns a boolean and checking that against VIR_DOMAIN_RUNNING worked by pure coincidence only. Just use the bool value and give it a more speaking name while at it. Reviewed-by: Cole Robinson Signed-off-by: Michael Weiser --- virtManager/object/domain.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virtManager/object/domain.py b/virtManager/object/domain.py index bad7108ed..778d1feef 100644 --- a/virtManager/object/domain.py +++ b/virtManager/object/domain.py @@ -1051,11 +1051,11 @@ class vmmDomain(vmmLibvirtObject): def revert_to_snapshot(self, snap): # no use trying to set the guest time if is going to be switched off # after reverting to the snapshot - target_run_state = snap.is_running() + will_be_running = snap.is_running() self._backend.revertToSnapshot(snap.get_backend()) # looking at the domain state after revert will always come back as # paused, so look at the snapshot state instead - if target_run_state == libvirt.VIR_DOMAIN_RUNNING: + if will_be_running: self._set_time() def create_snapshot(self, xml, redefine=False):