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] [xen-unstable] xm: Add a new option to xm dump-core

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xm: Add a new option to xm dump-core
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 25 Apr 2008 06:30:19 -0700
Delivery-date: Fri, 25 Apr 2008 06:30:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1209127239 -3600
# Node ID 1c6008fc4d9a3607a11719faa87c5a7514c53b4b
# Parent  ffa511df6c2339ac19cee884bfcb254394031c77
xm: Add a new option to xm dump-core

The option is -R|--reset.  A guest domain is reset after saving
a core dump of the guest domain when specified the option.

Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
 tools/python/xen/xm/main.py |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff -r ffa511df6c23 -r 1c6008fc4d9a tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Fri Apr 25 13:40:05 2008 +0100
+++ b/tools/python/xen/xm/main.py       Fri Apr 25 13:40:39 2008 +0100
@@ -133,7 +133,7 @@ SUBCOMMAND_HELP = {
                      'Read and/or clear Xend\'s message buffer.'),
     'domid'       : ('<DomainName>', 'Convert a domain name to domain id.'),
     'domname'     : ('<DomId>', 'Convert a domain id to domain name.'),
-    'dump-core'   : ('[-L|--live] [-C|--crash] <Domain> [Filename]',
+    'dump-core'   : ('[-L|--live] [-C|--crash] [-R|--reset] <Domain> 
[Filename]',
                      'Dump core for a specific domain.'),
     'info'        : ('[-c|--config]', 'Get information about Xen host.'),
     'log'         : ('', 'Print Xend log'),
@@ -243,6 +243,7 @@ SUBCOMMAND_OPTIONS = {
     'dump-core': (
        ('-L', '--live', 'Dump core without pausing the domain'),
        ('-C', '--crash', 'Crash domain after dumping core'),
+       ('-R', '--reset', 'Reset domain after dumping core'),
     ),
     'start': (
        ('-p', '--paused', 'Do not unpause domain after starting it'),
@@ -1280,14 +1281,19 @@ def xm_dump_core(args):
 def xm_dump_core(args):
     live = False
     crash = False
+    reset = False
     try:
-        (options, params) = getopt.gnu_getopt(args, 'LC', ['live','crash'])
+        (options, params) = getopt.gnu_getopt(args, 'LCR', ['live', 'crash', 
'reset'])
         for (k, v) in options:
             if k in ('-L', '--live'):
                 live = True
-            if k in ('-C', '--crash'):
+            elif k in ('-C', '--crash'):
                 crash = True
-
+            elif k in ('-R', '--reset'):
+                reset = True
+
+        if crash and reset:
+            raise OptionError("You may not specify more than one '-CR' option")
         if len(params) not in (1, 2):
             raise OptionError("Expects 1 or 2 argument(s)")
     except getopt.GetoptError, e:
@@ -1309,8 +1315,11 @@ def xm_dump_core(args):
         if crash:
             print "Destroying domain: %s ..." % str(dom)
             server.xend.domain.destroy(dom)
+        elif reset:
+            print "Resetting domain: %s ..." % str(dom)
+            server.xend.domain.reset(dom)
     finally:
-        if not live and not crash and ds == DOM_STATE_RUNNING:
+        if not live and not crash and not reset and ds == DOM_STATE_RUNNING:
             server.xend.domain.unpause(dom)
 
 def xm_rename(args):

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xm: Add a new option to xm dump-core, Xen patchbot-unstable <=