From: Eric Blake <eblake@redhat.com>
To: Jeff Cody <jcody@redhat.com>, Kevin Wolf <kwolf@redhat.com>
Cc: armbru@redhat.com, famz@redhat.com, qemu-devel@nongnu.org,
stefanha@redhat.com, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 3/6] qemu-img convert: Support multiple -o options
Date: Thu, 20 Feb 2014 12:38:35 -0700 [thread overview]
Message-ID: <530659BB.7010004@redhat.com> (raw)
In-Reply-To: <20140220193330.GE30664@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 1659 bytes --]
On 02/20/2014 12:33 PM, Jeff Cody wrote:
> On Thu, Feb 20, 2014 at 03:57:20PM +0100, Kevin Wolf wrote:
>> Instead of ignoring all option values but the last one, multiple -o
>> options now have the same meaning as having a single option with all
>> settings in the order of their respective -o options.
>>
> There is a 'return -1' that is missed, that I think needs to be 'goto
> out;' for cleanup. It is right after the call to
> bdrv_parse_cache_flags() in the img_convert() function:
>
> ret = bdrv_parse_cache_flags(cache, &flags);
> if (ret < 0) {
> error_report("Invalid cache option: %s", cache);
> return -1;
> }
>
> Looks like this has been this way for a while, though. And this is an
> instance (the only instance) where img_convert returns -1 instead of 0
> or 1. I'm not sure the implications if that changed, and became '1',
> so we'd probably want to preserve the return value.
No, exit status of 255 on an invalid cache option is a bug; fixing it to
return EXIT_FAILURE (1) is indeed correct.
[Hmm, this shows that I only reviewed the changed sections, rather than
also looking for all other 'return' statements - thanks Jeff for the
more thorough review]
>
> Since this doesn't have anything to do with this patch (although
> leaking 'options' now, in addition to the other stuff leaked), I'll go
> ahead and give my reviewed-by, and we can fix this in another
> follow-up patch:
Agreed to that plan of attack (we've now racked up several good followups).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2014-02-20 19:38 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-20 14:57 [Qemu-devel] [PATCH v2 0/6] qemu-img: Support multiple -o options Kevin Wolf
2014-02-20 14:57 ` [Qemu-devel] [PATCH v2 1/6] qemu-option: Introduce has_help_option() Kevin Wolf
2014-02-20 15:28 ` Eric Blake
2014-02-20 20:21 ` Jeff Cody
2014-02-20 14:57 ` [Qemu-devel] [PATCH v2 2/6] qemu-img create: Support multiple -o options Kevin Wolf
2014-02-20 15:52 ` Eric Blake
2014-02-20 16:24 ` Eric Blake
2014-02-20 19:14 ` Jeff Cody
2014-02-20 14:57 ` [Qemu-devel] [PATCH v2 3/6] qemu-img convert: " Kevin Wolf
2014-02-20 16:01 ` Eric Blake
2014-02-20 19:33 ` Jeff Cody
2014-02-20 19:38 ` Eric Blake [this message]
2014-02-20 14:57 ` [Qemu-devel] [PATCH v2 4/6] qemu-img amend: " Kevin Wolf
2014-02-20 16:18 ` Eric Blake
2014-02-20 19:39 ` Jeff Cody
2014-02-20 14:57 ` [Qemu-devel] [PATCH v2 5/6] qemu-img: Allow -o help with incomplete argument list Kevin Wolf
2014-02-20 16:58 ` Eric Blake
2014-02-20 20:05 ` Jeff Cody
2014-02-20 14:57 ` [Qemu-devel] [PATCH v2 6/6] qemu-iotests: Check qemu-img command line parsing Kevin Wolf
2014-02-20 17:51 ` Eric Blake
2014-02-20 18:42 ` Jeff Cody
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=530659BB.7010004@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=famz@redhat.com \
--cc=jcody@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).