# HG changeset patch
# User emellor@ewan
# Node ID fc97109eb28ea8e0705d247ad7cfd99847dfeab6
# Parent 5db9a237f8ce867ee2a8fa4b19cf3074134ad827
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@xxxxxxxxxxxxx>
diff -r 5db9a237f8ce -r fc97109eb28e tools/python/xen/sv/DomInfo.py
--- a/tools/python/xen/sv/DomInfo.py Mon Oct 3 15:33:09 2005
+++ b/tools/python/xen/sv/DomInfo.py Mon Oct 3 15:39:19 2005
@@ -139,7 +139,7 @@
if not dom is None and dom != '0':
if DEBUG: print ">DomShutDown %s" % dom
try:
- server.xend_domain_shutdown( int( dom ), "halt" )
+ server.xend_domain_shutdown( int( dom ), "poweroff" )
except:
pass
@@ -175,7 +175,7 @@
if not dom is None and dom != '0':
if DEBUG: print ">DomDestroy %s" % dom
try:
- server.xend_domain_destroy( int( dom ), "halt" )
+ server.xend_domain_destroy(int( dom ))
except:
pass
diff -r 5db9a237f8ce -r fc97109eb28e tools/python/xen/xend/XendClient.py
--- a/tools/python/xen/xend/XendClient.py Mon Oct 3 15:33:09 2005
+++ b/tools/python/xen/xend/XendClient.py Mon Oct 3 15:39:19 2005
@@ -232,10 +232,9 @@
{'op' : 'sysrq',
'key' : key})
- def xend_domain_destroy(self, id, reason):
- return self.xendPost(self.domainurl(id),
- {'op' : 'destroy',
- 'reason' : reason })
+ def xend_domain_destroy(self, id):
+ return self.xendPost(self.domainurl(id),
+ {'op' : 'destroy' })
def xend_domain_save(self, id, filename):
return self.xendPost(self.domainurl(id),
diff -r 5db9a237f8ce -r fc97109eb28e tools/python/xen/xend/server/SrvDomain.py
--- a/tools/python/xen/xend/server/SrvDomain.py Mon Oct 3 15:33:09 2005
+++ b/tools/python/xen/xend/server/SrvDomain.py Mon Oct 3 15:39:19 2005
@@ -71,8 +71,7 @@
def op_destroy(self, op, req):
fn = FormFn(self.xd.domain_destroy,
- [['dom', 'int'],
- ['reason', 'str']])
+ [['dom', 'int']])
val = fn(req.args, {'dom': self.dom.domid})
req.setHeader("Location", "%s/.." % req.prePathURL())
return val
@@ -232,8 +231,6 @@
req.write('<form method="post" action="%s">' % url)
req.write('<input type="submit" name="op" value="destroy">')
- req.write('<input type="radio" name="reason" value="halt"
checked>Halt')
- req.write('<input type="radio" name="reason" value="reboot">Reboot')
req.write('</form>')
req.write('<form method="post" action="%s">' % url)
diff -r 5db9a237f8ce -r fc97109eb28e tools/python/xen/xm/destroy.py
--- a/tools/python/xen/xm/destroy.py Mon Oct 3 15:33:09 2005
+++ b/tools/python/xen/xm/destroy.py Mon Oct 3 15:39:19 2005
@@ -21,18 +21,14 @@
from xen.xend.XendClient import server
from xen.xm.opts import *
-gopts = Opts(use="""[options] [DOM]
+gopts = Opts(use="""[DOM]
-Destroy a domain, optionally restarting it.
+Destroy a domain.
""")
gopts.opt('help', short='h',
fn=set_true, default=0,
use="Print this help.")
-
-gopts.opt('reboot', short='R',
- fn=set_true, default=0,
- use='Destroy and restart.')
def main(argv):
opts = gopts
@@ -42,10 +38,4 @@
return
if len(args) < 1: opts.err('Missing domain')
dom = args[0]
- if opts.vals.reboot:
- mode = 'reboot'
- else:
- mode = 'halt'
- server.xend_domain_destroy(dom, mode)
-
-
+ server.xend_domain_destroy(dom)
diff -r 5db9a237f8ce -r fc97109eb28e tools/python/xen/xm/shutdown.py
--- a/tools/python/xen/xm/shutdown.py Mon Oct 3 15:33:09 2005
+++ b/tools/python/xen/xm/shutdown.py Mon Oct 3 15:39:19 2005
@@ -73,19 +73,15 @@
opts.info("All domains terminated")
def shutdown_mode(opts):
- mode = 'poweroff'
- if opts.vals.wait:
- mode = 'halt'
- if opts.vals.reboot:
- opts.err("Can't specify wait and reboot")
+ if opts.vals.halt and opts.vals.reboot:
+ opts.err("Can't specify halt and reboot")
+
+ if opts.vals.halt:
+ return 'halt'
+ elif opts.vals.reboot:
+ return 'reboot'
else:
- if opts.vals.halt and opts.vals.reboot:
- opts.err("Can't specify halt and reboot")
- if opts.vals.halt:
- mode = 'halt'
- elif opts.vals.reboot:
- mode = 'reboot'
- return mode
+ return 'poweroff'
def main_all(opts, args):
mode = shutdown_mode(opts)
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|