All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Fehlig <jfehlig@novell.com>
To: Stefan Berger <stefanb@us.ibm.com>, Ewan Mellor <ewan@xensource.com>
Cc: Xen-devel <xen-devel@lists.xensource.com>
Subject: Re: An Introduction to the Xen-API Work
Date: Wed, 08 Nov 2006 10:34:24 -0700	[thread overview]
Message-ID: <45521520.40307@novell.com> (raw)
In-Reply-To: <OFC0D1AFE8.15C6DDE9-ON85257220.005274A8-85257220.00529831@us.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 1444 bytes --]

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.

Regards,
Jim


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: xend-domain-lookup.patch --]
[-- Type: text/x-patch; name="xend-domain-lookup.patch", Size: 692 bytes --]

diff -r 8eb8c0085604 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py	Mon Nov 06 16:36:51 2006 +0000
+++ b/tools/python/xen/xend/XendDomain.py	Wed Nov 08 10:32:26 2006 -0700
@@ -472,10 +472,9 @@ class XendDomain:
         self.domains_lock.acquire()
         try:
             # lookup by name
-            match = [dom for dom in self.domains.values() \
-                     if dom.getName() == domid]
-            if match:
-                return match[0]
+            for dom in self.domains.values() + self.managed_domains.values():
+                if dom.getName() == domid:
+                    return dom
 
             # lookup by id
             try:

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

  reply	other threads:[~2006-11-08 17:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-04 15:29 An Introduction to the Xen-API Work Ewan Mellor
2006-11-06 20:44 ` Stefan Berger
2006-11-06 23:46   ` Ewan Mellor
2006-11-07 21:38     ` Stefan Berger
2006-11-08 15:02     ` Stefan Berger
2006-11-08 17:34       ` Jim Fehlig [this message]
2006-11-08 18:25         ` Ewan Mellor
2006-11-08 19:15         ` Stefan Berger
2006-11-08 18:29 ` Patrick O'Rourke
2006-11-08 18:45   ` Ewan Mellor
2006-11-08 19:22     ` Patrick O'Rourke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45521520.40307@novell.com \
    --to=jfehlig@novell.com \
    --cc=ewan@xensource.com \
    --cc=stefanb@us.ibm.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.