mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
Release the domains_lock properly when get_dev_property_by_uuid fails.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
ea178f69d5
commit
31ec6ab111
1 file changed
+9
-7
@@ -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
|
||||
|
||||
|
||||