ia64/xen-unstable

view tools/python/xen/xm/sysrq.py @ 6538:84ee014ebd41

Merge xen-vtx-unstable.hg
author adsharma@los-vmm.sc.intel.com
date Wed Aug 17 12:34:38 2005 -0800 (2005-08-17)
parents 23979fb12c49 38e6467df0e6
children 99914b54f7bf
line source
1 # (C) Matthew Bloch <matthew@bytemark.co.uk> 2004
3 """Domain shutdown.
4 """
5 import string
6 import sys
7 import time
9 from xen.xend.XendClient import server
10 from xen.xm.opts import *
12 DOM0_NAME = 'Domain-0'
13 DOM0_ID = '0'
15 gopts = Opts(use="""[DOM] [letter]
17 Sends a Linux sysrq to a domain.
18 """)
20 gopts.opt('help', short='h',
21 fn=set_true, default=0,
22 use="Print this help.")
24 def main(argv):
25 opts = gopts
26 args = opts.parse(argv)
27 if opts.vals.help:
28 opts.usage()
29 return
31 # no options for the moment
32 if len(args) < 1: opts.err('Missing domain')
33 if len(args) < 2: opts.err('Missing sysrq character')
34 dom = args[0]
35 req = ord(args[1][0])
36 server.xend_domain_sysrq(dom, req)