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] An Introduction to the Xen-API Work

To: Jim Fehlig <jfehlig@xxxxxxxxxx>
Subject: Re: [Xen-devel] An Introduction to the Xen-API Work
From: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Date: Wed, 8 Nov 2006 18:25:26 +0000
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stefan Berger <stefanb@xxxxxxxxxx>
Delivery-date: Wed, 08 Nov 2006 10:25:45 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <45521520.40307@xxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <OFC0D1AFE8.15C6DDE9-ON85257220.005274A8-85257220.00529831@xxxxxxxxxx> <45521520.40307@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Wed, Nov 08, 2006 at 10:34:24AM -0700, Jim Fehlig wrote:

> Stefan Berger wrote:
> >
> >This here solves the problem.
> >
> >diff -r 2408c042a276 tools/python/xen/xend/XendDomain.py
> >--- a/tools/python/xen/xend/XendDomain.py                 Wed Nov  8 
> >11:13:50 2006
> >+++ b/tools/python/xen/xend/XendDomain.py                 Wed Nov  8 
> >09:58:35 2006
> >@@ -472,7 +472,7 @@
> >        self.domains_lock.acquire()
> >        try:
> >            # lookup by name
> >-            match = [dom for dom in self.domains.values() \
> >+            match = [dom for dom in self.managed_domains.values() \
> >                     if dom.getName() == domid]
> >            if match:
> >                return match[0]
> >
> > Stefan
> 
> Ah, this is essentially the xend patch I was referring to in 
> http://lists.xensource.com/archives/html/xen-devel/2006-11/msg00361.html.  
> In domain_lookup_nr, it appears only 'non-inactive' domains are in the 
> domains dictionary, so this routine would not find the inactive domain 
> that I was attempting to destroy.  I took a slightly different approach 
> (patch attached), but given my knowledge of the code was not sure of any 
> potential side affects.  Also I wasn't sure why we are building a list 
> only to return the first item.  Why not return the item when found?  I 
> realize that names are not unique but the current code doesn't handle 
> duplicates anyway.
> 
> Ewan, can you comment on either of these patches?  This routine needs to 
> accommodate inactive domains as well.

Yes, we certainly need to include both lists here -- Stefan's patch breaks
other things unfortunately.  Your patch looks OK to me, though I'll give
Alastair time to comment -- he's worked on this more recently than me.

Ewan.

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