qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Max Reitz <mreitz@redhat.com>, qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] qemu-img: Use strerror() for generic resize error
Date: Wed, 15 Jun 2016 09:44:50 -0600	[thread overview]
Message-ID: <576177F2.1020507@redhat.com> (raw)
In-Reply-To: <20160615153630.2116-2-mreitz@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1156 bytes --]

On 06/15/2016 09:36 AM, Max Reitz wrote:
> Emitting the plain error number is not very helpful. Use strerror()
> instead.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  qemu-img.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/qemu-img.c b/qemu-img.c
> index 14e2661..d5ccd9a 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -3277,7 +3277,7 @@ static int img_resize(int argc, char **argv)
>          error_report("Image is read-only");
>          break;
>      default:
> -        error_report("Error resizing image (%d)", -ret);
> +        error_report("Error resizing image: %s", strerror(-ret));
>          break;

I've argued in the past that we have lots of error_report() callers
using strerror(), and may want to add an error_report_errno() (similar
to error_setg_errno()); this just adds to the list of things that would
benefit.  But such a conversion would be a separate BiteSized task, and
doesn't invalidate your patch.

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
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 --]

  reply	other threads:[~2016-06-15 15:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15 15:36 [Qemu-devel] [PATCH 0/2] qcow2: Avoid making the L1 table too big Max Reitz
2016-06-15 15:36 ` [Qemu-devel] [PATCH 1/2] qemu-img: Use strerror() for generic resize error Max Reitz
2016-06-15 15:44   ` Eric Blake [this message]
2016-06-15 15:36 ` [Qemu-devel] [PATCH 2/2] qcow2: Avoid making the L1 table too big Max Reitz
2016-06-15 15:43   ` Eric Blake
2016-07-06  8:40   ` Kevin Wolf
2016-07-06 12:47     ` Max Reitz
2016-07-06 12:54       ` Kevin Wolf
2016-07-05 17:37 ` [Qemu-devel] [PATCH 0/2] " Max Reitz

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=576177F2.1020507@redhat.com \
    --to=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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 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).