dom0/core: introduce "Starting" state (#520)
Represent VM which is running, but gui daemon hasn't connected yet.
This commit is contained in:
parent
ceeed3bd8b
commit
3d316ca2f9
@ -631,6 +631,9 @@ class QubesVm(object):
|
|||||||
return "Halting"
|
return "Halting"
|
||||||
elif dominfo['dying']:
|
elif dominfo['dying']:
|
||||||
return "Dying"
|
return "Dying"
|
||||||
|
else:
|
||||||
|
if not self.is_fully_usable():
|
||||||
|
return "Starting"
|
||||||
else:
|
else:
|
||||||
return "Running"
|
return "Running"
|
||||||
else:
|
else:
|
||||||
@ -638,8 +641,19 @@ class QubesVm(object):
|
|||||||
|
|
||||||
return "NA"
|
return "NA"
|
||||||
|
|
||||||
|
def is_fully_usable(self):
|
||||||
|
xid = self.get_xid()
|
||||||
|
if xid < 0:
|
||||||
|
return False
|
||||||
|
if not os.path.exists('/var/run/qubes/guid_running.%d' % xid):
|
||||||
|
return False
|
||||||
|
# currently qrexec daemon doesn't cleanup socket in /var/run/qubes, so
|
||||||
|
# it can be left from some other VM
|
||||||
|
return True
|
||||||
|
|
||||||
def is_running(self):
|
def is_running(self):
|
||||||
if self.get_power_state() == "Running":
|
# in terms of Xen and internal logic - starting VM is running
|
||||||
|
if self.get_power_state() in ["Running", "Starting"]:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user