ia64/xen-unstable

changeset 18067:45787d746db4

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 <jfehlig@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Jul 16 11:12:36 2008 +0100 (2008-07-16)
parents ea6a9793928d
children 649c975b72f0
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Tue Jul 15 18:00:13 2008 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Wed Jul 16 11:12:36 2008 +0100
     1.3 @@ -2618,7 +2618,9 @@ class XendDomainInfo:
     1.4      def _cleanupVm(self):
     1.5          """Cleanup VM resources.  Idempotent.  Nothrow guarantee."""
     1.6  
     1.7 -        self.metrics.destroy()
     1.8 +        from xen.xend import XendDomain
     1.9 +        if not XendDomain.instance().is_domain_managed(self):
    1.10 +            self.metrics.destroy()
    1.11          self._unwatchVm()
    1.12  
    1.13          try: