Skip to contentSkip to conversation

Show usage message of xm migrate

PATCH Applied Masaki Kanno 2 participants 2 messages Aug 21, 2006 – Aug 29, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Show usage message of xm migrate

Hi,

I think that error messages of xm migrate command are unkind.

# xm migrate
Error: Invalid arguments: []
# xm migrate vm1 192.168.0.10 XXX
Error: Invalid arguments: ['vm1', '192.168.0.10', 'XXX']

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

# xm migrate
Usage:  migrate [options] DOM HOST

Migrate domain DOM to host HOST.
Xend must be running on the local host and on HOST.

-h, --help
Print this help.

-l, --live
Use live migration.

-p, --port portnum
Use specified port for migration.
Default None

-r, --resource MBIT
Set level of resource usage for migration.
Default None

Best regards,
Kan

tools/python/xen/xm/migrate.py +2 -1
diff -r ec03b24a2d83 tools/python/xen/xm/migrate.py
@@ -57,7 +57,8 @@ def main(argv):
         opts.usage()
         return
     if len(args) != 2:
-        opts.err('Invalid arguments: ' + str(args))
+        opts.usage()
+        sys.exit(1)
     dom = args[0]
     dst = args[1]
     server.xend.domain.migrate(dom, dst, opts.vals.live, opts.vals.resource, opts.vals.port)

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

Applied
#1 lore raw

On Mon, Aug 21, 2006 at 06:51:37PM +0900, Masaki Kanno wrote:

Content-Description: Mail message body

Quoted 11 lines

Hi,

I think that error messages of xm migrate command are unkind.

# xm migrate
Error: Invalid arguments: []
# xm migrate vm1 192.168.0.10 XXX
Error: Invalid arguments: ['vm1', '192.168.0.10', 'XXX']

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

Applied, thanks.

Ewan.