WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Remove the reason code from the destroy action -- the re

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Remove the reason code from the destroy action -- the reason is only of value
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 04 Oct 2005 01:32:11 +0000
Delivery-date: Tue, 04 Oct 2005 01:29:45 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@ewan
# Node ID c70829a6edac6e64c0df5b94ada08b0ce8f7778e
# Parent  600f3d2b78d63b606a88c5b4fa4aa049106ac0e7
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 600f3d2b78d6 -r c70829a6edac tools/python/xen/xm/destroy.py
--- a/tools/python/xen/xm/destroy.py    Mon Oct  3 23:56:24 2005
+++ b/tools/python/xen/xm/destroy.py    Mon Oct  3 23:57:34 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 600f3d2b78d6 -r c70829a6edac tools/python/xen/xm/shutdown.py
--- a/tools/python/xen/xm/shutdown.py   Mon Oct  3 23:56:24 2005
+++ b/tools/python/xen/xm/shutdown.py   Mon Oct  3 23:57:34 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

<Prev in Thread] Current Thread [Next in Thread>