[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Replace XendDomainInfo.setStoreChannel with XendDomainInfo.closeStoreChannel.



# HG changeset patch
# User emellor@ewan
# Node ID 8462eff90433b0fbaaa6a15b1a151fdf7976e4cb
# Parent  b75771a12f79bd6a9d65885b5a3fdb8e7e481f40
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@xxxxxxxxxxxxx>

diff -r b75771a12f79 -r 8462eff90433 tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py   Sat Sep 17 16:34:58 2005
+++ b/tools/python/xen/xend/XendCheckpoint.py   Sat Sep 17 17:09:31 2005
@@ -83,7 +83,7 @@
     if child.wait() != 0:
         raise XendError("xc_save failed: %s" % lasterr)
 
-    dominfo.setStoreChannel(None)
+    dominfo.closeStoreChannel()
     xd.domain_destroy(dominfo.domid)
     return None
 
diff -r b75771a12f79 -r 8462eff90433 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Sat Sep 17 16:34:58 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Sat Sep 17 17:09:31 2005
@@ -348,15 +348,20 @@
         self.store_mfn = ref
         self.storeDom("store/ring-ref", ref)
 
-    def setStoreChannel(self, channel):
-        if self.store_channel and self.store_channel != channel:
-            self.store_channel.close()
-        self.store_channel = channel
-        if channel:
-            port = channel.port1
-        else:
-            port = None
-        self.storeDom("store/port", None)
+
+    def closeStoreChannel(self):
+        """Close the store channel, if any.  Nothrow guarantee."""
+        
+        try:
+            if self.store_channel:
+                try:
+                    self.store_channel.close()
+                    self.removeDom("store/port")
+                finally:
+                    self.store_channel = None
+        except Exception, exn:
+            log.exception(exn)
+
 
     def setConsoleRef(self, ref):
         self.console_mfn = ref
@@ -763,8 +768,7 @@
         """
         self.state = STATE_VM_TERMINATED
         self.release_devices()
-        if self.store_channel:
-            self.setStoreChannel(None)
+        self.closeStoreChannel()
         if self.console_channel:
             # notify processes using this console?
             try:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.