From 0ce7336cadc29f8cdcfbd8637d86b412da58860b Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Tue, 13 Sep 2011 18:39:09 +0200 Subject: [PATCH] dom0: Distinguish 'Halting','Crashed' state from simple 'Halted' (#314) --- dom0/qvm-core/qubes.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index 402724b8..fbb0ec1f 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -502,10 +502,10 @@ class QubesVm(object): if dominfo: if dominfo['paused']: return "Paused" - elif dominfo['shutdown']: - return "Halted" elif dominfo['crashed']: return "Crashed" + elif dominfo['shutdown']: + return "Halting" elif dominfo['dying']: return "Dying" else: @@ -988,7 +988,8 @@ class QubesVm(object): if dry_run: return - if self.is_running(): + # Intentionally not used is_running(): eliminate also "Paused", "Crashed", "Halting" + if self.get_power_state() != "Halted": raise QubesException ("VM is already running!") if self.netvm_vm is not None: