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-devel

[Xen-devel] Do not wait for memory teardown when live migrate

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Do not wait for memory teardown when live migrate
From: Miroslav Rezanina <mrezanin@xxxxxxxxxx>
Date: Mon, 11 Oct 2010 08:52:54 -0400 (EDT)
Delivery-date: Mon, 11 Oct 2010 05:53:48 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1393810365.50891286801563319.JavaMail.root@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,
when trying to live migrate guest with great memory (e.g. 20 GB), there's delay 
caused by destroying source copy of domain. To speed up this process we can 
close socket before starting guest destroy, as source guest is not running 
anymore.

Signed-off-by: Miroslav Rezanina <mrezanin@xxxxxxxxxx>:
--
diff -r 3c4c3d48a835 tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py   Thu Aug 26 11:16:56 2010 +0100
+++ b/tools/python/xen/xend/XendCheckpoint.py   Mon Oct 11 14:15:01 2010 +0200
@@ -65,7 +65,7 @@
     return
 
 
-def save(fd, dominfo, network, live, dst, checkpoint=False, node=-1):
+def save(fd, dominfo, network, live, dst, checkpoint=False, node=-1,sock=None):
     from xen.xend import XendDomain
 
     try:
@@ -162,6 +162,13 @@
         if checkpoint:
             dominfo.resumeDomain()
         else:
+            if live and sock != None:
+                try:
+                    sock.shutdown(2)
+                except:
+                    pass
+                sock.close()
+
             dominfo.destroy()
             dominfo.testDeviceComplete()
         try:
diff -r 3c4c3d48a835 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Thu Aug 26 11:16:56 2010 +0100
+++ b/tools/python/xen/xend/XendDomain.py       Mon Oct 11 14:15:01 2010 +0200
@@ -1412,7 +1412,7 @@
         try:
             try:
                 XendCheckpoint.save(p2cwrite, dominfo, True, live, dst,
-                                    node=node)
+                                    node=node,sock=sock)
             except Exception, ex:
                 m_dsterr = None
                 try:
@@ -1436,6 +1436,7 @@
                     raise XendError("%s (from %s)" % (m_dsterr.group(2), dst))
                 raise
         finally:
+          if not live:
             try:
                 sock.shutdown(2)
             except:
@@ -1469,7 +1470,7 @@
         try:
             try:
                 XendCheckpoint.save(sock.fileno(), dominfo, True, live,
-                                    dst, node=node)
+                                    dst, node=node,sock=sock)
             except Exception, ex:
                 m_dsterr = None
                 try:
@@ -1493,6 +1494,7 @@
                     raise XendError("%s (from %s)" % (m_dsterr.group(2), dst))
                 raise
         finally:
+          if not live:
             try:
                 sock.shutdown(2)
             except:
-- 
Miroslav Rezanina
Software Engineer - Virtualization Team - XEN kernel


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

<Prev in Thread] Current Thread [Next in Thread>