From 78b63eb21ac9d9134afc89baf16d4822faa85b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 11 Jan 2016 21:50:57 +0100 Subject: [PATCH] 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 --- qmemman/qmemman.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmemman/qmemman.py b/qmemman/qmemman.py index 01712375..57d27370 100755 --- a/qmemman/qmemman.py +++ b/qmemman/qmemman.py @@ -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