From: Keir Fraser Date: Wed, 16 Jul 2008 10:12:36 +0000 (+0100) Subject: xend: Fix destruction of VMMetrics objects for managed domains X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14188^2~12 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6ed38332916e3e7e4407019d2bad262e93fe5872;p=xen.git xend: Fix destruction of VMMetrics objects for managed domains While plugging a xend memory lead (c/s 18030), I introduced a bug in the case of managed domains. Managed domains continue to exist after shutdown and thus should not have their associated VMMetrics object destroyed until deleted. The bug actually manifested by a new -> start -> shutdown -> delete sequence of operations. Shutdown destroyed the VMMetrics object and delete tried to do the same :-): Signed-off-by: Jim Fehlig --- diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index b6514cde0c..5052009158 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -2618,7 +2618,9 @@ class XendDomainInfo: def _cleanupVm(self): """Cleanup VM resources. Idempotent. Nothrow guarantee.""" - self.metrics.destroy() + from xen.xend import XendDomain + if not XendDomain.instance().is_domain_managed(self): + self.metrics.destroy() self._unwatchVm() try: