From 3c7d2289ce1730b15b73bee5202d7a289ac60068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 13 May 2017 01:03:04 +0200 Subject: [PATCH] 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). --- qubes/vm/qubesvm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index 18ef63f4..9e3477c5 100644 --- a/qubes/vm/qubesvm.py +++ b/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: