diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-04-07 10:14:35 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-04-07 10:14:35 +0100 |
commit | 94bacaf76d0c10ec1a56ad34ddaece7e981a3ce8 (patch) | |
tree | 7c070a28f9f7dcdc112b9f6b56fa814008a001ac | |
parent | e6e6785c99bccdd61ecf6ffcfd4aa3423e3a1255 (diff) | |
download | xen-94bacaf76d0c10ec1a56ad34ddaece7e981a3ce8.tar.gz xen-94bacaf76d0c10ec1a56ad34ddaece7e981a3ce8.tar.bz2 xen-94bacaf76d0c10ec1a56ad34ddaece7e981a3ce8.zip |
xend: fix leak of /local/domain/* in xenstore
xenwatch thread _storeChanged() may create /local/domain/<domid>
entries in xenstore even after the domain has shutdown.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
-rw-r--r-- | tools/python/xen/xend/XendDomainInfo.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 644831b87d..17ed7dac11 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -1634,7 +1634,13 @@ class XendDomainInfo: if changed: # Update the domain section of the store, as this contains some # parameters derived from the VM configuration. - self._storeDomDetails() + self.refresh_shutdown_lock.acquire() + try: + state = self._stateGet() + if state not in (DOM_STATE_SHUTDOWN, DOM_STATE_HALTED,): + self._storeDomDetails() + finally: + self.refresh_shutdown_lock.release() return 1 |