mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-11 05:17:59 +03:00
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 <crobinso@redhat.com> Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
This commit is contained in:
parent
6bec5474db
commit
8084639cd8
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user