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] XendDomain.py:

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] XendDomain.py:
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Tue, 31 May 2005 17:13:05 +0000
Delivery-date: Tue, 31 May 2005 18:02:51 +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 Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1618, 2005/05/31 18:13:05+01:00, cl349@xxxxxxxxxxxxxxxxxxxx

        XendDomain.py:
          Allow migration to localhost.
          g/c XendDomain.domain_exists().
        Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>



 XendDomain.py |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)


diff -Nru a/tools/python/xen/xend/XendDomain.py 
b/tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       2005-05-31 14:03:42 -04:00
+++ b/tools/python/xen/xend/XendDomain.py       2005-05-31 14:03:42 -04:00
@@ -8,6 +8,7 @@
 import errno
 import os
 import scheduler
+import string
 import sys
 import traceback
 import time
@@ -357,9 +358,6 @@
         except Exception, ex:
             log.exception("Error creating domain info: id=%s", name)
 
-    def domain_exists(self, name):
-        return self.domain_lookup(name) != None
-
     def domain_unpause(self, id):
         """Unpause domain execution.
 
@@ -514,7 +512,17 @@
         port = xroot.get_xend_relocation_port()
         sock = relocate.setupRelocation(dst, port)
 
-        XendCheckpoint.save(self, sock.fileno(), dominfo)
+        # temporarily rename domain for localhost migration
+        if dst == "localhost":
+            dominfo.name = "tmp-" + dominfo.name
+
+        try:
+            XendCheckpoint.save(self, sock.fileno(), dominfo)
+        except:
+            if dst == "localhost":
+                dominfo.name = string.replace(dominfo.name, "tmp-", "", 1)
+            raise
+        
         return None
 
     def domain_save(self, id, dst, progress=False):

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

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