ia64/xen-unstable

changeset 14538:2249cb6b5e42

Release the domains_lock properly when get_dev_property_by_uuid fails.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Fri Mar 23 16:54:34 2007 +0000 (2007-03-23)
parents 6f2f72f39872
children f434c63b484a
files tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Fri Mar 23 15:10:46 2007 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Fri Mar 23 16:54:34 2007 +0000
     1.3 @@ -653,14 +653,16 @@ class XendDomain:
     1.4      def get_dev_property_by_uuid(self, klass, dev_uuid, field):
     1.5          value = None
     1.6          self.domains_lock.acquire()
     1.7 +
     1.8          try:
     1.9 -            dom = self.get_vm_with_dev_uuid(klass, dev_uuid)
    1.10 -            if dom:
    1.11 -                value = dom.get_dev_property(klass, dev_uuid, field)
    1.12 -        except ValueError, e:
    1.13 -            pass
    1.14 -
    1.15 -        self.domains_lock.release()
    1.16 +            try:
    1.17 +                dom = self.get_vm_with_dev_uuid(klass, dev_uuid)
    1.18 +                if dom:
    1.19 +                    value = dom.get_dev_property(klass, dev_uuid, field)
    1.20 +            except ValueError, e:
    1.21 +                pass
    1.22 +        finally:
    1.23 +            self.domains_lock.release()
    1.24          
    1.25          return value
    1.26