From: Jim Fehlig <jfehlig@novell.com>
To: Xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] [xend] Host.get_resident_VMs RPC
Date: Mon, 11 Dec 2006 13:08:44 -0700 [thread overview]
Message-ID: <457DBACC.6000206@novell.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 675 bytes --]
I've noticed that Host.get_resident_VMs RPC returns duplicate references
to running VMs. Is this the intent or a bug :-)? In XendDomain.py we have
def get_domain_refs(self):
result = []
try:
self.domains_lock.acquire()
result = [d.get_uuid() for d in self.domains.values()]
result += self.managed_domains.keys()
return result
finally:
self.domains_lock.release()
and as you can see a running domain would be included twice in the
resulting list. If this is a bug, patch attached. If intentional,
please let me know so I can handle it appropriately in client code.
Regards,
Jim
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: libxen-residentVMs.patch --]
[-- Type: text/x-patch; name="libxen-residentVMs.patch", Size: 1005 bytes --]
# HG changeset patch
# User jfehlig@jfehlig2.provo.novell.com
# Date 1165867640 25200
# Node ID 687e576ee99eb68d10324d0013bfd9acc372468c
# Parent 37141c3a3d39956ad5faf2d4e2a91276eaca557b
When enumerating VMs resident on a host (Host.get_resident_VMs RPC), ensure VMs with same UUID only appear once in the list.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
diff -r 37141c3a3d39 -r 687e576ee99e tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py Mon Dec 11 15:06:53 2006 +0000
+++ b/tools/python/xen/xend/XendDomain.py Mon Dec 11 13:07:20 2006 -0700
@@ -591,7 +591,9 @@ class XendDomain:
try:
self.domains_lock.acquire()
result = [d.get_uuid() for d in self.domains.values()]
- result += self.managed_domains.keys()
+ for d in self.managed_domains.keys():
+ if d not in result:
+ result.append(d)
return result
finally:
self.domains_lock.release()
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2006-12-11 20:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-11 20:08 Jim Fehlig [this message]
2006-12-13 14:44 ` [PATCH] [xend] Host.get_resident_VMs RPC Ewan Mellor
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=457DBACC.6000206@novell.com \
--to=jfehlig@novell.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.