From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49417 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POTMN-00047e-RO for qemu-devel@nongnu.org; Fri, 03 Dec 2010 05:59:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1POTMJ-0007tn-OC for qemu-devel@nongnu.org; Fri, 03 Dec 2010 05:59:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1POTMJ-0007tA-Gg for qemu-devel@nongnu.org; Fri, 03 Dec 2010 05:59:23 -0500 Message-ID: <4CF8CD86.6030506@redhat.com> Date: Fri, 03 Dec 2010 11:59:18 +0100 From: Jes Sorensen MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/3] Consolidate printing of block driver options References: <1291312009-24351-1-git-send-email-Jes.Sorensen@redhat.com> <1291312009-24351-2-git-send-email-Jes.Sorensen@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, qemu-devel@nongnu.org On 12/03/10 11:57, Stefan Hajnoczi wrote: > On Thu, Dec 2, 2010 at 5:46 PM, 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