From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9bI2-0008OR-Qi for qemu-devel@nongnu.org; Mon, 29 Jun 2015 11:48:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9bHx-0004QM-RV for qemu-devel@nongnu.org; Mon, 29 Jun 2015 11:48:10 -0400 Date: Mon, 29 Jun 2015 16:48:02 +0100 From: Stefan Hajnoczi Message-ID: <20150629154802.GB24772@stefanha-thinkpad.redhat.com> References: <1435261196-8068-1-git-send-email-rjones@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8P1HSweYDcXXzwPJ" Content-Disposition: inline In-Reply-To: <1435261196-8068-1-git-send-email-rjones@redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] 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: agraf@suse.de, Jeff Cody , qemu-devel@nongnu.org, qemu-block@nongnu.org, armbru@redhat.com --8P1HSweYDcXXzwPJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 25, 2015 at 08:39:56PM +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 > --- > block/curl.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) According to scripts/get_maintainer.pl this patch goes via Jeff Cody. Reviewed-by: Stefan Hajnoczi --8P1HSweYDcXXzwPJ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVkWiyAAoJEJykq7OBq3PIvaIIAKJJzvONUfzKZkRBIK3ichVa b9e9vJKxvk1ZtS+2QRIwJ3axB5g1hEahWmuFvrTbftNe2GG/vwOEIJF/XnxyBF/f QiqbxWAyLw8DpVOVPjApSsGBJRbIRqdvWmFate4uejy2HAJBC/S0so1ze1JIrMDI Mx1T3Zx+EPMcHGRo/TIb2Gl0Jua3S/c2l+m/8p3eBdLT+8AUi/69Altml0aFu63Y gUi1JSdyodfv2vPcZ1rhi3+hyuofvv6cxzlN40Ya2izcIPGUn5g7yGFL3Nm/AXVX 2ZUkOZpojYcIdCqUu6T+uvp/BI5v7jmB/Wi9RiQJxJ6NeemGxeGcWlZisTPQlzE= =yXQP -----END PGP SIGNATURE----- --8P1HSweYDcXXzwPJ--