WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Fix destruction of VMMetrics objects for managed dom

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Fix destruction of VMMetrics objects for managed domains
From: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date: Tue, 15 Jul 2008 12:22:28 -0600
Delivery-date: Tue, 15 Jul 2008 11:22:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080421)
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


   Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>


diff -r 750eee596adf tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Tue Jul 15 13:19:26 2008 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Tue Jul 15 11:59:32 2008 -0600
@@ -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
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Fix destruction of VMMetrics objects for managed domains, Jim Fehlig <=