ia64/xen-unstable

changeset 8275:05b37057b1cf

Refuse to save dom0, and move the check that refuses to migrate dom0 from
migrate.py into XendDomain.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Thu Dec 08 12:08:59 2005 +0000 (2005-12-08)
parents b215584242c4
children cdf76916951a
files tools/python/xen/xend/XendDomain.py tools/python/xen/xm/migrate.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Wed Dec 07 16:26:07 2005 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Thu Dec 08 12:08:59 2005 +0000
     1.3 @@ -395,6 +395,9 @@ class XendDomain:
     1.4  
     1.5          dominfo = self.domain_lookup(domid)
     1.6  
     1.7 +        if dominfo.getDomid() == PRIV_DOMAIN:
     1.8 +            raise XendError("Cannot migrate privileged domain %i" % domid)
     1.9 +
    1.10          port = xroot.get_xend_relocation_port()
    1.11          try:
    1.12              sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    1.13 @@ -416,6 +419,9 @@ class XendDomain:
    1.14          try:
    1.15              dominfo = self.domain_lookup(domid)
    1.16  
    1.17 +            if dominfo.getDomid() == PRIV_DOMAIN:
    1.18 +                raise XendError("Cannot save privileged domain %i" % domid)
    1.19 +
    1.20              fd = os.open(dst, os.O_WRONLY | os.O_CREAT | os.O_TRUNC)
    1.21              try:
    1.22                  # For now we don't support 'live checkpoint' 
     2.1 --- a/tools/python/xen/xm/migrate.py	Wed Dec 07 16:26:07 2005 +0000
     2.2 +++ b/tools/python/xen/xm/migrate.py	Thu Dec 08 12:08:59 2005 +0000
     2.3 @@ -13,6 +13,7 @@
     2.4  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     2.5  #============================================================================
     2.6  # Copyright (C) 2004, 2005 Mike Wray <mike.wray@hp.com>
     2.7 +# Copyright (c) 2005 XenSource Ltd.
     2.8  #============================================================================
     2.9  
    2.10  """Domain migration.
    2.11 @@ -23,9 +24,6 @@ import sys
    2.12  from xen.xend.XendClient import server
    2.13  from xen.xm.opts import *
    2.14  
    2.15 -DOM0_NAME = 'Domain-0'
    2.16 -DOM0_ID = '0'
    2.17 -
    2.18  gopts = Opts(use="""[options] DOM HOST
    2.19  
    2.20  Migrate domain DOM to host HOST.
    2.21 @@ -58,7 +56,4 @@ def main(argv):
    2.22          opts.err('Invalid arguments: ' + str(args))
    2.23      dom = args[0]
    2.24      dst = args[1]
    2.25 -    if dom in [DOM0_NAME, DOM0_ID]:
    2.26 -        opts.err('Cannot migrate ' + dom)
    2.27      server.xend_domain_migrate(dom, dst, opts.vals.live, opts.vals.resource)
    2.28 -