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

2010-12-06 Thread Stefan Hajnoczi
On Mon, Dec 6, 2010 at 10:47 AM, Jes Sorensen wrote: > On 12/06/10 11:37, Stefan Hajnoczi wrote: >> On Mon, Dec 6, 2010 at 10:20 AM, Jes Sorensen >> wrote: >>> On 12/06/10 10:32, Stefan Hajnoczi wrote: On Mon, Dec 6, 2010 at 8:17 AM,   wrote: Why goto out2 and not just return like the

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

2010-12-06 Thread Jes Sorensen
On 12/06/10 11:37, Stefan Hajnoczi wrote: > On Mon, Dec 6, 2010 at 10:20 AM, Jes Sorensen wrote: >> On 12/06/10 10:32, Stefan Hajnoczi wrote: >>> On Mon, Dec 6, 2010 at 8:17 AM, wrote: >>> Why goto out2 and not just return like the bs > 1 && out_baseimg check? >> >> It is cleaner, I'd rather con

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

2010-12-06 Thread Stefan Hajnoczi
On Mon, Dec 6, 2010 at 10:20 AM, Jes Sorensen wrote: > On 12/06/10 10:32, Stefan Hajnoczi wrote: >> On Mon, Dec 6, 2010 at 8:17 AM,   wrote: >>> @@ -694,6 +721,11 @@ static int img_convert(int argc, char **argv) >>> >>>     out_filename = argv[argc - 1]; >>> >>> +    if (options && !strcmp(options

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

2010-12-06 Thread Jes Sorensen
On 12/06/10 10:32, Stefan Hajnoczi wrote: > On Mon, Dec 6, 2010 at 8:17 AM, wrote: >> @@ -694,6 +721,11 @@ static int img_convert(int argc, char **argv) >> >> out_filename = argv[argc - 1]; >> >> +if (options && !strcmp(options, "?")) { >> +ret = print_block_option_help(out_filena

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

2010-12-06 Thread Stefan Hajnoczi
On Mon, Dec 6, 2010 at 8:17 AM, wrote: > @@ -694,6 +721,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; > +    } > + >

[Qemu-devel] [PATCH 1/3] Consolidate printing of block driver options

2010-12-06 Thread Jes . Sorensen
From: Jes Sorensen This consolidates the printing of block driver options in print_block_option_help() which is called from both img_create() and img_convert(). This allows for the "?" detection to be done just after the parsing of options and the filename, instead of half way down the codepath

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

2010-12-03 Thread Stefan Hajnoczi
On Fri, Dec 3, 2010 at 10:57 AM, Stefan Hajnoczi wrote: > On Thu, Dec 2, 2010 at 5:46 PM,   wrote: >> @@ -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_

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

2010-12-03 Thread Jes Sorensen
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, >> +

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

2010-12-03 Thread Stefan Hajnoczi
On Thu, Dec 2, 2010 at 5:46 PM, wrote: > @@ -188,6 +188,32 @@ static int read_password(char *buf, int buf_size) >  } >  #endif > > +static int print_block_option_help(const char *filename, const char *fmt) > +{ > +    BlockDriver *drv, *proto_drv; > +    QEMUOptionParameter *create_options = NULL

[Qemu-devel] [PATCH 1/3] Consolidate printing of block driver options

2010-12-02 Thread Jes . Sorensen
From: Jes Sorensen This consolidates the printing of block driver options in print_block_option_help() which is called from both img_create() and img_convert(). This allows for the "?" detection to be done just after the parsing of options and the filename, instead of half way down the codepath