qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v4] block/curl: Don't lose original error when a


From: Stefan Hajnoczi
Subject: Re: [Qemu-block] [PATCH v4] block/curl: Don't lose original error when a connection fails.
Date: Tue, 14 Jul 2015 15:52:59 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Wed, Jul 08, 2015 at 02:37:48PM +0100, Richard W.M. Jones wrote:
> Currently if qemu is connected to a curl source (eg. web server), and
> the web server fails / times out / dies, you always see a bogus EIO
> "Input/output error".
> 
> For example, choose a large file located on any local webserver which
> you control:
> 
>   $ qemu-img convert -p http://example.com/large.iso /tmp/test
> 
> Once it starts copying the file, stop the webserver and you will see
> qemu-img fail with:
> 
>   qemu-img: error while reading sector 61440: Input/output error
> 
> This patch does two things: Firstly print the actual error from curl
> so it doesn't get lost.  Secondly, change EIO to EPROTO.  EPROTO is a
> POSIX.1 compatible errno which more accurately reflects that there was
> a protocol error, rather than some kind of hardware failure.
> 
> After this patch is applied, the error changes to:
> 
>   $ qemu-img convert -p http://example.com/large.iso /tmp/test
>   qemu-img: curl: transfer closed with 469989 bytes remaining to read
>   qemu-img: error while reading sector 16384: Protocol error
> 
> Signed-off-by: Richard W.M. Jones <address@hidden>
> Reviewed-by: Stefan Hajnoczi <address@hidden>
> ---
>  block/curl.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)

I'm still happy.  This should go via Jeff Cody.

Attachment: pgpbB5ZHzKqeT.pgp
Description: PGP signature


reply via email to

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