WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Replace XendDomainInfo.setStoreChannel with XendDomainIn

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Replace XendDomainInfo.setStoreChannel with XendDomainInfo.closeStoreChannel.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 19 Sep 2005 13:26:15 +0000
Delivery-date: Mon, 19 Sep 2005 13:25:32 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Replace XendDomainInfo.setStoreChannel with XendDomainInfo.closeStoreChannel., Xen patchbot -unstable <=