direct-io.hg

view tools/python/xen/xm/migrate.py @ 2273:8c886cfa74e0

bitkeeper revision 1.1159.1.74 (4123662aRknZaZVDiDYz5H1bs5ZhmA)

Cset exclude: iap10@labyrinth.cl.cam.ac.uk|ChangeSet|20040817172414|62757
author iap10@labyrinth.cl.cam.ac.uk
date Wed Aug 18 14:22:34 2004 +0000 (2004-08-18)
parents dff63a2cfa54
children a6d73a771367
line source
1 # Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
3 """Domain migration.
4 """
6 import sys
8 from xen.xend.XendClient import server
9 from xen.xm.opts import *
11 DOM0_NAME = 'Domain-0'
12 DOM0_ID = '0'
14 gopts = Opts(use="""[options] DOM HOST
16 Migrate domain DOM to host HOST.
17 The transfer daemon xfrd must be running on the
18 local host and on HOST.
19 """)
21 gopts.opt('help', short='h',
22 fn=set_true, default=0,
23 use="Print this help.")
25 def help(argv):
26 gopts.argv = argv
27 gopts.usage()
29 def main(argv):
30 opts = gopts
31 args = opts.parse(argv)
32 if opts.vals.help:
33 opts.usage()
34 return
35 if len(args) != 2:
36 opts.err('Invalid arguments')
37 dom = args[0]
38 dst = args[1]
39 if dom in [DOM0_NAME, DOM0_ID]:
40 opts.err('Cannot migrate ' + dom)
41 server.xend_domain_migrate(dom, dst)