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