dom0: qmemman: distribute memory only if there are VMs which can accept it

This prevent potential inifinite loop in qmemman when free memory cannot be
assigned to any VM (because of static max). Practically this will never happen,
because dom0 can always accept memory.
Esse commit está contido em:
Marek Marczykowski 2011-05-12 17:36:47 +02:00
commit dccc528144

Ver arquivo

@ -126,7 +126,7 @@ def balance_when_enough_memory(domain_dictionary, xen_free_memory, total_mem_pre
acceptors_count += 1
target_memory[i] = target
# distribute left memory across all acceptors
while left_memory > 0:
while left_memory > 0 and acceptors_count > 0:
print ' left_memory:', left_memory, 'acceptors_count:', acceptors_count
new_left_memory = 0
for i in target_memory.keys():