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] Release the domains_lock properly when ge

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Release the domains_lock properly when get_dev_property_by_uuid fails.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 25 Mar 2007 22:00:20 -0700
Delivery-date: Sun, 25 Mar 2007 21:59:59 -0700
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>
# Date 1174668874 0
# Node ID 2249cb6b5e42ab30eaee3bab53961fe49304cdd0
# Parent  6f2f72f39872f163c44ebf88b31ce0cafdcfde5b
Release the domains_lock properly when get_dev_property_by_uuid fails.

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

diff -r 6f2f72f39872 -r 2249cb6b5e42 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Fri Mar 23 15:10:46 2007 +0000
+++ b/tools/python/xen/xend/XendDomain.py       Fri Mar 23 16:54:34 2007 +0000
@@ -653,14 +653,16 @@ class XendDomain:
     def get_dev_property_by_uuid(self, klass, dev_uuid, field):
         value = None
         self.domains_lock.acquire()
-        try:
-            dom = self.get_vm_with_dev_uuid(klass, dev_uuid)
-            if dom:
-                value = dom.get_dev_property(klass, dev_uuid, field)
-        except ValueError, e:
-            pass
-
-        self.domains_lock.release()
+
+        try:
+            try:
+                dom = self.get_vm_with_dev_uuid(klass, dev_uuid)
+                if dom:
+                    value = dom.get_dev_property(klass, dev_uuid, field)
+            except ValueError, e:
+                pass
+        finally:
+            self.domains_lock.release()
         
         return value
 

_______________________________________________
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] Release the domains_lock properly when get_dev_property_by_uuid fails., Xen patchbot-unstable <=