ia64/xen-unstable

changeset 7175:c70829a6edac

Remove the reason code from the destroy action -- the reason is only of value
on a graceful shutdown. Clarify the semantic difference between poweroff and
halt (we use halt to mean 'shutdown and stop' and poweroff to mean 'shutdown
and do whatever the configured behaviour is').

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Tue Oct 04 00:57:34 2005 +0100 (2005-10-04)
parents 600f3d2b78d6
children 0e1838de9db8
files tools/python/xen/xm/destroy.py tools/python/xen/xm/shutdown.py
line diff
     1.1 --- a/tools/python/xen/xm/destroy.py	Tue Oct 04 00:56:24 2005 +0100
     1.2 +++ b/tools/python/xen/xm/destroy.py	Tue Oct 04 00:57:34 2005 +0100
     1.3 @@ -21,19 +21,15 @@
     1.4  from xen.xend.XendClient import server
     1.5  from xen.xm.opts import *
     1.6  
     1.7 -gopts = Opts(use="""[options] [DOM]
     1.8 +gopts = Opts(use="""[DOM]
     1.9  
    1.10 -Destroy a domain, optionally restarting it.
    1.11 +Destroy a domain.
    1.12  """)
    1.13  
    1.14  gopts.opt('help', short='h',
    1.15           fn=set_true, default=0,
    1.16           use="Print this help.")
    1.17  
    1.18 -gopts.opt('reboot', short='R',
    1.19 -          fn=set_true, default=0,
    1.20 -          use='Destroy and restart.')
    1.21 -
    1.22  def main(argv):
    1.23      opts = gopts
    1.24      args = opts.parse(argv)
    1.25 @@ -42,10 +38,4 @@ def main(argv):
    1.26          return
    1.27      if len(args) < 1: opts.err('Missing domain')
    1.28      dom = args[0]
    1.29 -    if opts.vals.reboot:
    1.30 -        mode = 'reboot'
    1.31 -    else:
    1.32 -        mode = 'halt'
    1.33 -    server.xend_domain_destroy(dom, mode)
    1.34 -    
    1.35 -        
    1.36 +    server.xend_domain_destroy(dom)
     2.1 --- a/tools/python/xen/xm/shutdown.py	Tue Oct 04 00:56:24 2005 +0100
     2.2 +++ b/tools/python/xen/xm/shutdown.py	Tue Oct 04 00:57:34 2005 +0100
     2.3 @@ -73,19 +73,15 @@ def shutdown(opts, doms, mode, wait):
     2.4          opts.info("All domains terminated")
     2.5  
     2.6  def shutdown_mode(opts):
     2.7 -    mode = 'poweroff'
     2.8 -    if opts.vals.wait:
     2.9 -        mode = 'halt'
    2.10 -        if opts.vals.reboot:
    2.11 -           opts.err("Can't specify wait and reboot") 
    2.12 +    if opts.vals.halt and opts.vals.reboot:
    2.13 +        opts.err("Can't specify halt and reboot")
    2.14 +
    2.15 +    if opts.vals.halt:
    2.16 +        return 'halt'
    2.17 +    elif opts.vals.reboot:
    2.18 +        return 'reboot'
    2.19      else:
    2.20 -        if opts.vals.halt and opts.vals.reboot:
    2.21 -            opts.err("Can't specify halt and reboot")
    2.22 -        if opts.vals.halt:
    2.23 -            mode = 'halt'
    2.24 -        elif opts.vals.reboot:
    2.25 -            mode = 'reboot'
    2.26 -    return mode
    2.27 +        return 'poweroff'
    2.28  
    2.29  def main_all(opts, args):
    2.30      mode = shutdown_mode(opts)