qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/3] Consolidate printing of block driver option


From: Jes Sorensen
Subject: Re: [Qemu-devel] [PATCH 1/3] Consolidate printing of block driver options
Date: Fri, 03 Dec 2010 11:59:18 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101103 Fedora/1.0-0.33.b2pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.6

On 12/03/10 11:57, Stefan Hajnoczi wrote:
> On Thu, Dec 2, 2010 at 5:46 PM,  <address@hidden> wrote:
>> +    create_options = append_option_parameters(create_options,
>> +                                              drv->create_options);
>> +    create_options = append_option_parameters(create_options,
>> +                                              proto_drv->create_options);
>> +    print_option_help(create_options);
> 
> free_option_parameters(create_options);

Hmmm good point

>> @@ -694,6 +720,11 @@ static int img_convert(int argc, char **argv)
>>
>>     out_filename = argv[argc - 1];
>>
>> +    if (options && !strcmp(options, "?")) {
>> +        ret = print_block_option_help(out_filename, out_fmt);
>> +        goto out2;
>> +    }
>> +
>>     if (bs_n > 1 && out_baseimg) {
>>         error("-B makes no sense when concatenating multiple input images");
>>         return 1;
>> @@ -749,10 +780,6 @@ static int img_convert(int argc, char **argv)
>>                                               drv->create_options);
>>     create_options = append_option_parameters(create_options,
>>                                               proto_drv->create_options);
>> -    if (options && !strcmp(options, "?")) {
>> -        print_option_help(create_options);
>> -        goto out;
>> -    }
>>
>>     if (options) {
>>         param = parse_option_parameters(options, create_options, param);
>> @@ -984,6 +1011,7 @@ out:
>>         }
>>     }
>>     free(bs);
>> +out2:
> 
> Not needed, out is fine.  All those free functions are nops on NULL pointers.

Actually tried that, but it segfaulted, which is why I added out2.

Cheers,
Jes



reply via email to

[Prev in Thread] Current Thread [Next in Thread]