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] [xen-unstable] Block IO safety patch for live migration.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Block IO safety patch for live migration. Xend checks that VBDs are destroyed before unpausing the domain.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 30 Aug 2006 14:50:13 +0000
Delivery-date: Wed, 30 Aug 2006 07:50:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 jchesterfield@xxxxxxxxxxxxxxxxxxxxxxx
# Node ID 550821cdee0ac5fad9b5134eedffa118df4b6e11
# Parent  dc773bf496642b9d2fd58bff05d2619665275409
Block IO safety patch for live migration. Xend checks that VBDs are destroyed 
before unpausing the domain.
---
 tools/python/xen/xend/XendCheckpoint.py |    6 ++++--
 tools/python/xen/xend/XendDomain.py     |    3 ++-
 tools/python/xen/xend/XendDomainInfo.py |   15 +++++++++++++++
 3 files changed, 21 insertions(+), 3 deletions(-)

diff -r dc773bf49664 -r 550821cdee0a tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py   Wed Aug 30 11:05:00 2006 +0100
+++ b/tools/python/xen/xend/XendCheckpoint.py   Wed Aug 30 11:39:27 2006 +0100
@@ -161,10 +161,12 @@ def restore(xd, fd):
         if handler.store_mfn is None or handler.console_mfn is None:
             raise XendError('Could not read store/console MFN')
 
+       #Block until src closes connection
+       os.read(fd, 1)
         dominfo.unpause()
-
+        
         dominfo.completeRestore(handler.store_mfn, handler.console_mfn)
-
+        
         return dominfo
     except:
         dominfo.destroy()
diff -r dc773bf49664 -r 550821cdee0a tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Wed Aug 30 11:05:00 2006 +0100
+++ b/tools/python/xen/xend/XendDomain.py       Wed Aug 30 11:39:27 2006 +0100
@@ -431,7 +431,8 @@ class XendDomain:
         sock.send("receive\n")
         sock.recv(80)
         XendCheckpoint.save(sock.fileno(), dominfo, True, live, dst)
-
+       dominfo.testDeviceComplete()
+       sock.close()
 
     def domain_save(self, domid, dst):
         """Start saving a domain to file.
diff -r dc773bf49664 -r 550821cdee0a tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Wed Aug 30 11:05:00 2006 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Wed Aug 30 11:39:27 2006 +0100
@@ -1493,6 +1493,21 @@ class XendDomainInfo:
             rc = self.migrateDevice(n, c, network, dst, DEV_MIGRATE_TEST)
             if rc != 0:
                 raise XendError("Device of type '%s' refuses migration." % n)
+
+    def testDeviceComplete(self):
+        """ For Block IO migration safety we must ensure that
+        the device has shutdown correctly, i.e. all blocks are
+        flushed to disk
+        """
+        while True:
+            test = 0
+            for i in self.getDeviceController('vbd').deviceIDs():
+                test = 1
+                log.info("Dev %s still active, looping...", i)
+                time.sleep(0.1)
+                
+            if test == 0:
+                break
 
     def migrateDevices(self, network, dst, step, domName=''):
         """Notify the devices about migration

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Block IO safety patch for live migration. Xend checks that VBDs are destroyed before unpausing the domain., Xen patchbot-unstable <=