diff --git a/dom0/qmemman/qmemman.py b/dom0/qmemman/qmemman.py index 66a33207..227cc812 100755 --- a/dom0/qmemman/qmemman.py +++ b/dom0/qmemman/qmemman.py @@ -29,7 +29,6 @@ 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 diff --git a/dom0/qmemman/qmemman_server.py b/dom0/qmemman/qmemman_server.py index cf28e905..63fddfb5 100755 --- a/dom0/qmemman/qmemman_server.py +++ b/dom0/qmemman/qmemman_server.py @@ -29,11 +29,11 @@ class WatchType: class XS_Watcher: def __init__(self): self.handle = xen.lowlevel.xs.xs() - self.handle.watch('/local/domain', WatchType(XS_Watcher.domain_list_changed, None)) + self.handle.watch('@introduceDomain', WatchType(XS_Watcher.domain_list_changed, None)) + self.handle.watch('@releaseDomain', WatchType(XS_Watcher.domain_list_changed, None)) self.watch_token_dict = {} def domain_list_changed(self, param): - time.sleep(0.05) curr = self.handle.ls('', '/local/domain') if curr == None: return @@ -50,6 +50,7 @@ class XS_Watcher: self.watch_token_dict.pop(i) system_state.del_domain(i) global_lock.release() + system_state.do_balance() def meminfo_changed(self, domain_id): untrusted_meminfo_key = self.handle.read('', get_domain_meminfo_key(domain_id))