Explorar el Código

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 hace 6 años
padre
commit
ca41ca66cd
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  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