ia64/xen-unstable

changeset 6941:8462eff90433

Replace XendDomainInfo.setStoreChannel with XendDomainInfo.closeStoreChannel.
setStoreChannel was only ever called with channel=None (implying that the
current channel would be closed) so the other code there was superfluous.

Signed-off-by: Ewan Mellor<ewan@xensource.com>
author emellor@ewan
date Sat Sep 17 18:09:31 2005 +0100 (2005-09-17)
parents b75771a12f79
children fb1fa3a4106f
files tools/python/xen/xend/XendCheckpoint.py tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendCheckpoint.py	Sat Sep 17 17:34:58 2005 +0100
     1.2 +++ b/tools/python/xen/xend/XendCheckpoint.py	Sat Sep 17 18:09:31 2005 +0100
     1.3 @@ -83,7 +83,7 @@ def save(xd, fd, dominfo, live):
     1.4      if child.wait() != 0:
     1.5          raise XendError("xc_save failed: %s" % lasterr)
     1.6  
     1.7 -    dominfo.setStoreChannel(None)
     1.8 +    dominfo.closeStoreChannel()
     1.9      xd.domain_destroy(dominfo.domid)
    1.10      return None
    1.11  
     2.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Sat Sep 17 17:34:58 2005 +0100
     2.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Sat Sep 17 18:09:31 2005 +0100
     2.3 @@ -348,15 +348,20 @@ class XendDomainInfo:
     2.4          self.store_mfn = ref
     2.5          self.storeDom("store/ring-ref", ref)
     2.6  
     2.7 -    def setStoreChannel(self, channel):
     2.8 -        if self.store_channel and self.store_channel != channel:
     2.9 -            self.store_channel.close()
    2.10 -        self.store_channel = channel
    2.11 -        if channel:
    2.12 -            port = channel.port1
    2.13 -        else:
    2.14 -            port = None
    2.15 -        self.storeDom("store/port", None)
    2.16 +
    2.17 +    def closeStoreChannel(self):
    2.18 +        """Close the store channel, if any.  Nothrow guarantee."""
    2.19 +        
    2.20 +        try:
    2.21 +            if self.store_channel:
    2.22 +                try:
    2.23 +                    self.store_channel.close()
    2.24 +                    self.removeDom("store/port")
    2.25 +                finally:
    2.26 +                    self.store_channel = None
    2.27 +        except Exception, exn:
    2.28 +            log.exception(exn)
    2.29 +
    2.30  
    2.31      def setConsoleRef(self, ref):
    2.32          self.console_mfn = ref
    2.33 @@ -763,8 +768,7 @@ class XendDomainInfo:
    2.34          """
    2.35          self.state = STATE_VM_TERMINATED
    2.36          self.release_devices()
    2.37 -        if self.store_channel:
    2.38 -            self.setStoreChannel(None)
    2.39 +        self.closeStoreChannel()
    2.40          if self.console_channel:
    2.41              # notify processes using this console?
    2.42              try: