ia64/xen-unstable

view tools/python/xen/xm/sysrq.py @ 6552:a9873d384da4

Merge.
author adsharma@los-vmm.sc.intel.com
date Thu Aug 25 12:24:48 2005 -0700 (2005-08-25)
parents 112d44270733 fa0754a9f64f
children dfaf788ab18c
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)