qmemman: fix meminfo handling

This fixes "a2d9b15 qmemman: support simple VM meminfo format"
This commit is contained in:
Marek Marczykowski-Górecki 2016-09-12 06:08:59 +02:00
parent 9ae3dc2ebf
commit 2956f62bbc
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -60,9 +60,9 @@ def sanitize_and_parse_meminfo(untrusted_meminfo):
untrusted_words[1]
# sanitize start
if not is_meminfo_suspicious(untrusted_meminfo):
if not is_meminfo_suspicious(untrusted_dict):
# sanitize end
meminfo = untrusted_meminfo
meminfo = untrusted_dict
return meminfo['MemTotal'] - \
meminfo['MemFree'] - meminfo['Cached'] - meminfo['Buffers'] + \
meminfo['SwapTotal'] - meminfo['SwapFree']
@ -131,7 +131,7 @@ def balloon(memsize, domain_dictionary):
request = list()
available = 0
for i in domain_dictionary.keys():
if domain_dictionary[i].meminfo is None:
if domain_dictionary[i].mem_used is None:
continue
if domain_dictionary[i].no_progress:
continue