From bd447308fe03240d781eecb856153b1ac5461dc4 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Tue, 7 Jun 2011 15:52:10 +0200 Subject: [PATCH] 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. --- dom0/qmemman/qmemman.py | 1 + dom0/qmemman/qmemman_server.py | 1 + 2 files changed, 2 insertions(+) diff --git a/dom0/qmemman/qmemman.py b/dom0/qmemman/qmemman.py index 8a235422..b62f08fd 100755 --- a/dom0/qmemman/qmemman.py +++ b/dom0/qmemman/qmemman.py @@ -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 diff --git a/dom0/qmemman/qmemman_server.py b/dom0/qmemman/qmemman_server.py index f6b768b5..cf28e905 100755 --- a/dom0/qmemman/qmemman_server.py +++ b/dom0/qmemman/qmemman_server.py @@ -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