[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xl: fix off-by-one mistake in block-attach handler



>>> On 21.09.10 at 17:14, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> wrote:
> Jan Beulich writes ("[Xen-devel] [PATCH] xl: fix off-by-one mistake in 
> block-attach handler"):
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
>> 
>> --- 2010-09-20.orig/tools/libxl/xl_cmdimpl.c 2010-09-15 17:59:07.000000000 
>> +0200
>> +++ 2010-09-20/tools/libxl/xl_cmdimpl.c      2010-09-21 12:06:58.000000000 
>> +0200
>> @@ -4280,7 +4280,7 @@ int main_blockattach(int argc, char **ar
>>      }
>>      disk.virtpath = argv[optind+2];
>>      disk.unpluggable = 1;
>> -    disk.readwrite = ((argc-optind <= 2) || (argv[optind+3][0] == 'w'));
>> +    disk.readwrite = ((argc-optind <= 3) || (argv[optind+3][0] == 'w'));
> 
> This idiom is pretty nasty.  Perhaps we should rewrite it to:
> 
>   +    disk.readwrite = (argc-optind > 3) ? (argv[optind+3][0] == 'w') : 1;
> 
> or some such ?

Honestly, I don't really care.

Jan


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.