From: Kevin Wolf <kwolf@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH 2/8] block: bdrv_img_create(): add param_list argument
Date: Fri, 19 Oct 2012 11:13:39 +0200 [thread overview]
Message-ID: <508119C3.4010406@redhat.com> (raw)
In-Reply-To: <20121018141838.61d53a41@doriath.home>
Am 18.10.2012 19:18, schrieb Luiz Capitulino:
> On Thu, 18 Oct 2012 10:33:30 -0300
> Luiz Capitulino <lcapitulino@redhat.com> wrote:
>
>> On Thu, 18 Oct 2012 13:57:45 +0200
>> Kevin Wolf <kwolf@redhat.com> wrote:
>>
>>> Am 17.10.2012 21:35, schrieb Luiz Capitulino:
>>>> If set returns a copy of the parameter list used by the block driver
>>>> to create the new image.
>>>>
>>>> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
>>>> ---
>>>> block.c | 7 ++++++-
>>>> block.h | 3 ++-
>>>> blockdev.c | 2 +-
>>>> qemu-img.c | 2 +-
>>>> 4 files changed, 10 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/block.c b/block.c
>>>> index e95f613..254a5c2 100644
>>>> --- a/block.c
>>>> +++ b/block.c
>>>> @@ -4294,7 +4294,8 @@ bdrv_acct_done(BlockDriverState *bs, BlockAcctCookie *cookie)
>>>>
>>>> int bdrv_img_create(const char *filename, const char *fmt,
>>>> const char *base_filename, const char *base_fmt,
>>>> - char *options, uint64_t img_size, int flags)
>>>> + char *options, uint64_t img_size, int flags,
>>>> + QEMUOptionParameter **param_list)
>>>> {
>>>> QEMUOptionParameter *param = NULL, *create_options = NULL;
>>>> QEMUOptionParameter *backing_fmt, *backing_file, *size;
>>>> @@ -4430,6 +4431,10 @@ int bdrv_img_create(const char *filename, const char *fmt,
>>>> }
>>>>
>>>> out:
>>>> + if (param_list && ret == 0) {
>>>> + *param_list = append_option_parameters(NULL, param);
>>>> + }
>>>
>>> If you put this above the out: label, the ret == 0 check wouldn't be
>>> necessary.
>>
>> I'll maintain it it there but will drop the ret check, so that we're
>> able to return the options on error too and thus keep the "Formatting"
>> message the way it's today.
>
> Actually my idea didn't work. I can think of the following options:
>
> 1. Change it to "Formatted" as you suggested. Cons: will only be
> printed after the image is created
>
> 2. Print "Formatting 'foo', 'qcow2' " before the image is created
> and the options afterwards. Cons: weird?
>
> 3. Don't change this. Cons: will keep spitting stuff to stdout while in
> QMP
>
> I think we should do 2.
How about leaving the code printing the message where it is, but putting
an if (!cur_mon) around it?
Kevin
next prev parent reply other threads:[~2012-10-19 9:13 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-17 19:35 [Qemu-devel] [PATCH 0/8] block: bdrv_img_create(): propagate errors Luiz Capitulino
2012-10-17 19:35 ` [Qemu-devel] [PATCH 1/8] error: add error_set_errno and error_setg_errno Luiz Capitulino
2012-10-17 19:35 ` [Qemu-devel] [PATCH 2/8] block: bdrv_img_create(): add param_list argument Luiz Capitulino
2012-10-18 11:57 ` Kevin Wolf
2012-10-18 13:33 ` Luiz Capitulino
2012-10-18 17:18 ` Luiz Capitulino
2012-10-19 9:13 ` Kevin Wolf [this message]
2012-10-19 12:49 ` Luiz Capitulino
2012-10-17 19:35 ` [Qemu-devel] [PATCH 3/8] block: bdrv_img_create(): move parameter list printing to qemu-img Luiz Capitulino
2012-10-18 12:01 ` Kevin Wolf
2012-10-18 12:16 ` Kevin Wolf
2012-10-18 13:34 ` Luiz Capitulino
2012-10-17 19:35 ` [Qemu-devel] [PATCH 4/8] block: bdrv_img_create(): add Error ** argument Luiz Capitulino
2012-10-18 12:08 ` Kevin Wolf
2012-10-18 13:41 ` Luiz Capitulino
2012-10-17 19:35 ` [Qemu-devel] [PATCH 5/8] qemu-img: img_create(): use Error object Luiz Capitulino
2012-10-18 12:11 ` Kevin Wolf
2012-10-18 13:49 ` Luiz Capitulino
2012-10-18 14:02 ` Kevin Wolf
2012-10-23 9:58 ` Markus Armbruster
2012-10-23 10:08 ` Kevin Wolf
2012-10-23 13:07 ` Luiz Capitulino
2012-10-17 19:35 ` [Qemu-devel] [PATCH 6/8] qemu-img: img_create(): simplify Luiz Capitulino
2012-10-17 19:35 ` [Qemu-devel] [PATCH 7/8] qmp: qmp_transaction(): pass Error object to bdrv_img_create() Luiz Capitulino
2012-10-17 19:35 ` [Qemu-devel] [PATCH 8/8] block: bdrv_img_create(): drop unused error handling code Luiz Capitulino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=508119C3.4010406@redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.