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

[Xen-changelog] Refuse to save dom0, and move the check that refuses to migrate dom0 from



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 05b37057b1cf9ca018a024e69712b37c5d946a44
# Parent  b215584242c43415eccd008b90c812f3d04b398d
Refuse to save dom0, and move the check that refuses to migrate dom0 from
migrate.py into XendDomain.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r b215584242c4 -r 05b37057b1cf tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Wed Dec  7 16:26:07 2005
+++ b/tools/python/xen/xend/XendDomain.py       Thu Dec  8 12:08:59 2005
@@ -395,6 +395,9 @@
 
         dominfo = self.domain_lookup(domid)
 
+        if dominfo.getDomid() == PRIV_DOMAIN:
+            raise XendError("Cannot migrate privileged domain %i" % domid)
+
         port = xroot.get_xend_relocation_port()
         try:
             sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@@ -415,6 +418,9 @@
 
         try:
             dominfo = self.domain_lookup(domid)
+
+            if dominfo.getDomid() == PRIV_DOMAIN:
+                raise XendError("Cannot save privileged domain %i" % domid)
 
             fd = os.open(dst, os.O_WRONLY | os.O_CREAT | os.O_TRUNC)
             try:
diff -r b215584242c4 -r 05b37057b1cf tools/python/xen/xm/migrate.py
--- a/tools/python/xen/xm/migrate.py    Wed Dec  7 16:26:07 2005
+++ b/tools/python/xen/xm/migrate.py    Thu Dec  8 12:08:59 2005
@@ -13,6 +13,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #============================================================================
 # Copyright (C) 2004, 2005 Mike Wray <mike.wray@xxxxxx>
+# Copyright (c) 2005 XenSource Ltd.
 #============================================================================
 
 """Domain migration.
@@ -22,9 +23,6 @@
 
 from xen.xend.XendClient import server
 from xen.xm.opts import *
-
-DOM0_NAME = 'Domain-0'
-DOM0_ID = '0'
 
 gopts = Opts(use="""[options] DOM HOST
 
@@ -58,7 +56,4 @@
         opts.err('Invalid arguments: ' + str(args))
     dom = args[0]
     dst = args[1]
-    if dom in [DOM0_NAME, DOM0_ID]:
-        opts.err('Cannot migrate ' + dom)
     server.xend_domain_migrate(dom, dst, opts.vals.live, opts.vals.resource)
-        

_______________________________________________
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®.