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] Move xm destroy handling out of crufty destroy.py and in

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Move xm destroy handling out of crufty destroy.py and into main.py, where it
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 08 Dec 2005 19:12:10 +0000
Delivery-date: Thu, 08 Dec 2005 19:13:23 +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@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 23168659679678dee6eda3385581c2d825ca2ad6
# Parent  fa1a93f3a322ee47d208e8050ca6dc3a6847917c
Move xm destroy handling out of crufty destroy.py and into main.py, where it
can share the better argument parsing.

Closes bug #443.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r fa1a93f3a322 -r 231686596796 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Thu Dec  8 14:28:53 2005
+++ b/tools/python/xen/xm/main.py       Thu Dec  8 14:30:15 2005
@@ -577,6 +577,13 @@
     from xen.xend.XendClient import server
     server.xend_domain_set_vcpus(args[0], int(args[1]))
 
+
+def xm_destroy(args):
+    arg_check(args, "destroy", 1)
+    from xen.xend.XendClient import server
+    server.xend_domain_destroy(args[0])
+
+
 def xm_domid(args):
     arg_check(args, "domid", 1)
 
@@ -783,6 +790,7 @@
     # xenstat commands
     "top": xm_top,
     # domain commands
+    "destroy": xm_destroy,
     "domid": xm_domid,
     "domname": xm_domname,
     "rename": xm_rename,
@@ -825,7 +833,6 @@
 ## The commands supported by a separate argument parser in xend.xm.
 subcommands = [
     'create',
-    'destroy',
     'migrate',
     'sysrq',
     'shutdown'
diff -r fa1a93f3a322 -r 231686596796 tools/python/xen/xm/destroy.py
--- a/tools/python/xen/xm/destroy.py    Thu Dec  8 14:28:53 2005
+++ /dev/null   Thu Dec  8 14:30:15 2005
@@ -1,41 +0,0 @@
-#============================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#============================================================================
-# Copyright (C) 2004, 2005 Mike Wray <mike.wray@xxxxxx>
-#============================================================================
-
-"""Destroy a domain.
-"""
-
-from xen.xend.XendClient import server
-from xen.xm.opts import *
-
-gopts = Opts(use="""[DOM]
-
-Destroy a domain.
-""")
-
-gopts.opt('help', short='h',
-         fn=set_true, default=0,
-         use="Print this help.")
-
-def main(argv):
-    opts = gopts
-    args = opts.parse(argv)
-    if opts.vals.help:
-        opts.usage()
-        return
-    if len(args) < 1: opts.err('Missing domain')
-    dom = args[0]
-    server.xend_domain_destroy(dom)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Move xm destroy handling out of crufty destroy.py and into main.py, where it, Xen patchbot -unstable <=