qmemman: fix crash when VM fails to start

In this case, qmemman would not manage to get any memory state for such
VM, so memory_current would be 'None'. But later it would perform
arithmetics on it, which would result in qmemman crash (TypeError
exception).

Fixes QubesOS/qubes-issues#1601
This commit is contained in:
Marek Marczykowski-Górecki 2016-01-11 21:50:57 +01:00
parent 301eed55b3
commit 78b63eb21a
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -37,7 +37,7 @@ slow_memset_react_msg="VM didn't give back all requested memory"
class DomainState:
def __init__(self, id):
self.meminfo = None #dictionary of memory info read from client
self.memory_current = None #the current memory size
self.memory_current = 0 # the current memory size
self.memory_actual = None # the current memory allocation (what VM
# is using or can use at any time)
self.memory_maximum = None #the maximum memory size