From: Stefan Hajnoczi <stefanha@gmail.com>
To: "Richard W.M. Jones" <rjones@redhat.com>
Cc: kwolf@redhat.com, agraf@suse.de, armbru@redhat.com,
qemu-block@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v4] block/curl: Don't lose original error when a connection fails.
Date: Tue, 14 Jul 2015 15:52:59 +0100 [thread overview]
Message-ID: <20150714145259.GA6920@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1436362668-29745-2-git-send-email-rjones@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1387 bytes --]
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 <rjones@redhat.com>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> block/curl.c | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
I'm still happy. This should go via Jeff Cody.
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
prev parent reply other threads:[~2015-07-14 14:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-08 13:37 [Qemu-devel] [PATCH v4] block/curl: Don't lose original error when a connection Richard W.M. Jones
2015-07-08 13:37 ` [Qemu-devel] [PATCH v4] block/curl: Don't lose original error when a connection fails Richard W.M. Jones
2015-07-14 14:52 ` Stefan Hajnoczi [this message]
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=20150714145259.GA6920@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=agraf@suse.de \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=rjones@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).