dom0/qmemman: distribute memory freed by deleted domain

Also wait a moment after domain list change for domain cleanup. Even if this
time is not sufficient, memory will be balanced when some domain need it.
This commit is contained in:
Marek Marczykowski 2011-06-07 15:52:10 +02:00
parent 429c685f1d
commit bd447308fe
2 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,7 @@ class SystemState:
def del_domain(self, id):
self.domdict.pop(id)
self.do_balance()
def get_free_xen_memory(self):
return self.xc.physinfo()['free_memory']*1024

View File

@ -33,6 +33,7 @@ class XS_Watcher:
self.watch_token_dict = {}
def domain_list_changed(self, param):
time.sleep(0.05)
curr = self.handle.ls('', '/local/domain')
if curr == None:
return