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] [xend] Host.get_resident_VMs RPC

To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] [xend] Host.get_resident_VMs RPC
From: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date: Mon, 11 Dec 2006 13:08:44 -0700
Delivery-date: Mon, 11 Dec 2006 12:12:57 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.8 (X11/20061025)
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
# HG changeset patch
# User jfehlig@xxxxxxxxxxxxxxxxxxxxxxxxx
# 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@xxxxxxxxxx>

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()
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>