Ver código fonte

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 bf4306b815a5c0e84ebcb8b58a3449fbac962f88
    qmemman: clear "not responding" flags when VM require more memory

QubesOS/qubes-issues#3265
Marek Marczykowski-Górecki 6 anos atrás
pai
commit
ca41ca66cd
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      qubes/qmemman/__init__.py

+ 2 - 0
qubes/qmemman/__init__.py

@@ -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