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

Re: [Xen-devel] [PATCH]xend: fix dual destroy

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] [PATCH]xend: fix dual destroy
From: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date: Sun, 27 Jul 2008 21:55:13 -0600
Delivery-date: Sun, 27 Jul 2008 20:55:44 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <FE7BBCFBB500984A9A7922EBC95F516E017C421E@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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>
References: <FE7BBCFBB500984A9A7922EBC95F516E017C421E@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080421)
Cui, Dexuan wrote:
After changeset 18030 and 18064 were checked in, I found some issues
when creating HVM domains with devices assigned:

In XendDomainInfo.py, we have the call trace: the global function
create() => vm.start()  => _constructDomain().
In _constructDomain(), we invoke xc.test_assign_device() and when the
function fails (maybe because iommu=1 is not specified in grub entry
since iommu is 0 by defaut now; maybe because the device doesn't exist;
maybe because the device has been assigned, or something) we raise
VmError;
Then start() will invoke self.destroy() and re-raise the exception;
Next, the global create() will invoke vm.destroy() again; finally,
_cleanupVm()  and "self.metrics.destroy()" will be invoked again. Here
when we execute metrics.destroy() for the second time, the deregister()
in XendAPIStore.py will complain: there is no such an element in the
dict __classes and a KeyError exception is raised!

We can avoid the dual destroy by adding a check as follows.

Thanks. Finding the right place to destroy the metrics object made me quite nervous. Thought I had been through enough testing after c/s 18064 to have gotten it right :-/. Even more discouraging - xend still has a significant leak.

Jim


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>