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

xen-devel

[Top] [All Lists]

Re: [Xen-devel] [PATCH] Fix xm commands so that the Traceback does not o

To: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Fix xm commands so that the Traceback does not occur
From: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
Date: 2006年6月15日 18:10:28 +0900
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: 2006年6月15日 02:11:05 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060614143545.GC6955@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <F1C68F5C39DF69kanno.masaki@xxxxxxxxxxxxxx> <20060614143545.GC6955@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi Ewan,
Thanks for your comment.
We will correct and resend our patch.
Best regards,
 Kan
>On Wed, Jun 14, 2006 at 11:42:49AM +0900, Masaki Kanno wrote:
>
>Content-Description: Mail message body
>> Hi,
>> 
>> When we tested xm commands, the xm commands occurred the Traceback.
>> The following are the examples.
>> 
>> # xm sched-sedf domUtemp -s xx
>> Unexpected error: exceptions.ValueError
>> 
>> Please report to xen-devel@xxxxxxxxxxxxxxxxxxx
>> Traceback (most recent call last):
>> File "/usr/sbin/xm", line 10, in ?
>> main.main(sys.argv)
>> File "//usr/lib/python/xen/xm/main.py", line 1169, in main
>> rc = cmd(args)
>> File "//usr/lib/python/xen/xm/main.py", line 701, in xm_sched_sedf
>> opts['slice'] = ms_to_ns(v)
>> File "//usr/lib/python/xen/xm/main.py", line 665, in ms_to_ns
>> return (float(val) / 0.000001)
>> ValueError: invalid literal for float(): xx
>
>> [Snip]
>
>> The cause of the Traceback are entering wrong xm commands.
>> We suggest this patch so that the Traceback does not occur.
>> 
>> Signed-off-by: Hiroyuki Yamamoto <yamamoto.hiroyu@xxxxxxxxxxxxxx>
>> Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
>> 
>> Best regards,
>> Kan
>> 
>
>> diff -r aa2298739112 tools/python/xen/xm/main.py
>> --- a/tools/python/xen/xm/main.py Fri Jun 09 10:40:31 2006 -0600
>> +++ b/tools/python/xen/xm/main.py Mon Jun 12 20:40:13 2006 +0900
>> @@ -597,8 +597,16 @@ def xm_vcpu_pin(args):
>> arg_check(args, "vcpu-pin", 3)
>> 
>> dom = args[0]
>> - vcpu = int(args[1])
>> - cpumap = cpu_make_map(args[2])
>> + try:
>> + vcpu = int(args[1])
>> + except (ValueError, OverflowError):
>> + err('Invalid argument: %s' % args[1])
>> + sys.exit(1)
>> + try:
>> + cpumap = cpu_make_map(args[2])
>> + except (ValueError, OverflowError):
>> + err('Invalid argument: %s' % args[2])
>> + sys.exit(1)
>> 
>> server.xend.domain.pincpu(dom, vcpu, cpumap)
>> 
>> [Snip]
>
>It would be a lot nicer if you let the exceptions propagate, and then caught
>them in the main exception handler at the bottom of main.py. It would also
> be
>better if you printed out the usage of the command to tell the user what 
>error
>they made.
>
>Thanks,
>
>Ewan.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
Previous by Date: [Xen-devel] VMX status report 10351:ee482dc60eab , Zheng, Jeff
Next by Date: Re: [Xen-devel] Powernow-k8 support , Christian Roessner
Previous by Thread: Re: [Xen-devel] [PATCH] Fix xm commands so that the Traceback does not occur , Ewan Mellor
Next by Thread: [Xen-devel] [PATCH] [RESEND] Fix xm commands so that the Traceback does not occur , Masaki Kanno
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /