dom0/core: improve diagnostics of qmemman errors
This commit is contained in:
parent
59a1fb96db
commit
abefe78197
@ -1458,7 +1458,11 @@ class QubesVm(object):
|
||||
|
||||
mem_required = int(self.memory) * 1024 * 1024
|
||||
qmemman_client = QMemmanClient()
|
||||
if not qmemman_client.request_memory(mem_required):
|
||||
try:
|
||||
got_memory = qmemman_client.request_memory(mem_required)
|
||||
except IOError as e:
|
||||
raise IOError("ERROR: Failed to connect to qmemman: %s" % str(e))
|
||||
if not got_memory:
|
||||
qmemman_client.close()
|
||||
raise MemoryError ("ERROR: insufficient memory to start VM '%s'" % self.name)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user