From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZF1Zz-0004z1-Ku for qemu-devel@nongnu.org; Tue, 14 Jul 2015 10:53:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZF1Zw-0000ik-E6 for qemu-devel@nongnu.org; Tue, 14 Jul 2015 10:53:07 -0400 Date: Tue, 14 Jul 2015 15:52:59 +0100 From: Stefan Hajnoczi Message-ID: <20150714145259.GA6920@stefanha-thinkpad.redhat.com> References: <1436362668-29745-1-git-send-email-rjones@redhat.com> <1436362668-29745-2-git-send-email-rjones@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Kj7319i9nmIyA2yE" Content-Disposition: inline In-Reply-To: <1436362668-29745-2-git-send-email-rjones@redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v4] block/curl: Don't lose original error when a connection fails. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Richard W.M. Jones" Cc: kwolf@redhat.com, agraf@suse.de, armbru@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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". >=20 > For example, choose a large file located on any local webserver which > you control: >=20 > $ qemu-img convert -p http://example.com/large.iso /tmp/test >=20 > Once it starts copying the file, stop the webserver and you will see > qemu-img fail with: >=20 > qemu-img: error while reading sector 61440: Input/output error >=20 > 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. >=20 > After this patch is applied, the error changes to: >=20 > $ 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 >=20 > Signed-off-by: Richard W.M. Jones > Reviewed-by: Stefan Hajnoczi > --- > block/curl.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) I'm still happy. This should go via Jeff Cody. --Kj7319i9nmIyA2yE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVpSJLAAoJEJykq7OBq3PI38YH/Aqxg0WdKo5hDb3Sx+6xKcf1 i2NH3IfWXwEcFyXpw7buiFmsSjqSE2ZH9MrKADmCr9r403bFXu14a0sazbLQZ0Ex tni7JhHC5/QxsczCT4y0FHRuOR7SvkC32ksDynsApjR+CdvqzcEaA2096gsUJFiz 5QYKFGeSqLoBo4JhTSslyOk+FcplFq4CvNQ0a/0c9Ca94upLF/Gs/lkixSTMLV5m Acfv6yuroJi3qyLJVQ13n/NhSJfQFjZy6VrX7LyxU5IsY8pFL3f/sLUh4WFIwFIZ JRdZ7VIQ+ozSPdxiIyZaH0aLko/KQz2tGheGdO+f1ku4Gs9JRUmRy9s9+r0rsdE= =KOtg -----END PGP SIGNATURE----- --Kj7319i9nmIyA2yE--