Browse Source

vm: stubdom_xid: use canonical method for checking VM state

Don't depend on xid==-1 for not running VM.
This breaks some tests, as xid can be a mock object (not comparable to
int).
Marek Marczykowski-Górecki 7 years ago
parent
commit
3c7d2289ce
1 changed files with 1 additions and 1 deletions
  1. 1 1
      qubes/vm/qubesvm.py

+ 1 - 1
qubes/vm/qubesvm.py

@@ -535,7 +535,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
 
     @qubes.stateless_property
     def stubdom_xid(self):
-        if self.xid < 0:
+        if not self.is_running():
             return -1
 
         if self.app.vmm.xs is None: