qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qemu-img: Use strerror() for g


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qemu-img: Use strerror() for generic resize error
Date: Wed, 15 Jun 2016 09:44:50 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

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 <address@hidden>
> ---
>  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 <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]