Skip to contentSkip to conversation

Show usage message of xm sysrq

PATCH Applied Masaki Kanno 2 participants 2 messages Sep 11, 2006 – Sep 14, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Show usage message of xm sysrq

Hi,

Even if the "xm sysrq" command specified invalid arguments as below, the command error did not occur.

# xm sysrq vm1 m xyz
# 

If invalid arguments are specified, this patch shows an usage message.

# xm sysrq vm1 m xyz
Usage:  sysrq [DOM] [letter]

Sends a Linux sysrq to a domain.

-h, --help
Print this help.

Best regards,
Kan

tools/python/xen/xm/sysrq.py +3 -2
diff -r 7acaba46e15e tools/python/xen/xm/sysrq.py
@@ -24,8 +24,9 @@ def main(argv):
         return
         
     # no options for the moment
-    if len(args) < 1: opts.err('Missing domain')
-    if len(args) < 2: opts.err('Missing sysrq character')
+    if len(args) != 2:
+        opts.usage()
+        sys.exit(1)
     dom = args[0]
     req = ord(args[1][0])
     server.xend.domain.send_sysrq(dom, req)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Applied
#1 lore raw

On Mon, Sep 11, 2006 at 06:40:01PM +0900, Masaki Kanno wrote:

Content-Description: Mail message body

Quoted 15 lines

Hi,

Even if the "xm sysrq" command specified invalid arguments as below, the command error did not occur.

# xm sysrq vm1 m xyz
# 

If invalid arguments are specified, this patch shows an usage message.

# xm sysrq vm1 m xyz
Usage:  sysrq [DOM] [letter]
Quoted 8 lines

Sends a Linux sysrq to a domain.

-h, --help
Print this help.

Applied, thank you.

Ewan.