Skip to contentSkip to conversation

Fix destruction of VMMetrics objects for managed domains

PATCH New Jim Fehlig 1 participant 1 message Jul 15, 2008

lore
Share & tools
lore

Jim Fehlig

author
#0 lore raw

PATCH 1/1 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 :-):

xen65:~/jim # xm del opensuse-10.3
Error: ('fa5160c0-bc7a-1459-974b-d3e023c717dd', 'VM_metrics')
Usage: xm delete <DomainName>

Initially, I was simply going to clean up exception handling but decided to go with the attached hack (*cough* ..., I mean patch) since users may be interested in VMMetrics even when the vm is powered-off.

Regards,
Jim

tools/python/xen/xend/XendDomainInfo.py +3 -1
diff -r 750eee596adf 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:

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel