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-changelog

[Xen-changelog] [xen-unstable] Move the actual call routed by do_legacy_

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Move the actual call routed by do_legacy_api_with_uuid out of the scope of
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 06 Dec 2006 22:10:17 +0000
Delivery-date: Wed, 06 Dec 2006 14:09:49 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Node ID 97acbb7e2146b57025cd5426fddc912e5b180ea7
# Parent  fb1291ffa26f0fec9d3b0d1b55a210b5ce2455ee
Move the actual call routed by do_legacy_api_with_uuid out of the scope of
the domains_lock.  The call itself is already locking as necessary, and it
is important for domain_start to be able to release the lock across the scope
of waitForDevices.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendDomain.py |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff -r fb1291ffa26f -r 97acbb7e2146 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Wed Dec 06 10:10:06 2006 +0000
+++ b/tools/python/xen/xend/XendDomain.py       Wed Dec 06 10:12:39 2006 +0000
@@ -641,17 +641,22 @@ class XendDomain:
         return (self.get_vm_with_dev_uuid(klass, dev_uuid) != None)
 
     def do_legacy_api_with_uuid(self, fn, vm_uuid, *args, **kwargs):
+        dom = self.uuid_to_dom(vm_uuid)
+        fn(dom, *args, **kwargs)
+
+    def uuid_to_dom(self, vm_uuid):
         self.domains_lock.acquire()
         try:
             for domid, dom in self.domains.items():
-                if dom.get_uuid == vm_uuid:
-                    return fn(domid, *args, **kwargs)
+                if dom.get_uuid() == vm_uuid:
+                    return domid
                     
             if vm_uuid in self.managed_domains:
                 domid = self.managed_domains[vm_uuid].getDomid()
-                if domid == None:
-                    domid = self.managed_domains[vm_uuid].getName()
-                return fn(domid, *args, **kwargs)
+                if domid is None:
+                    return self.managed_domains[vm_uuid].getName()
+                else:
+                    return domid
             
             raise XendInvalidDomain("Domain does not exist")
         finally:

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Move the actual call routed by do_legacy_api_with_uuid out of the scope of, Xen patchbot-unstable <=