qmemman: fix early crash

clear_outdated_error_markers crashes if memory stats are not retrieved
yet. In practice it crashes at the very first call during daemon
startup, making the whole qmemman unusable.

This fixes bf4306b815
    qmemman: clear "not responding" flags when VM require more memory

QubesOS/qubes-issues#3265
This commit is contained in:
Marek Marczykowski-Górecki 2018-01-18 16:47:55 +01:00
parent dce3b609b4
commit ca41ca66cd
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -140,6 +140,8 @@ class SystemState(object):
def clear_outdated_error_markers(self):
# Clear outdated errors
for i in self.domdict.keys():
if self.domdict[i].mem_used is None:
continue
# clear markers excluding VM from memory balance, if:
# - VM have responded to previous request (with some safety margin)
# - VM request more memory than it has assigned