From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf6y7-0002ma-7I for qemu-devel@nongnu.org; Wed, 22 May 2013 07:12:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uf6y5-0003vt-5z for qemu-devel@nongnu.org; Wed, 22 May 2013 07:12:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf6y4-0003vh-T1 for qemu-devel@nongnu.org; Wed, 22 May 2013 07:12:29 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4MBCSt2018538 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 22 May 2013 07:12:28 -0400 Date: Wed, 22 May 2013 12:12:24 +0100 From: "Richard W.M. Jones" Message-ID: <20130522111224.GS4515@redhat.com> References: <1369192610-25003-1-git-send-email-famz@redhat.com> <20130522094444.GA28893@redhat.com> <519CA653.3090803@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="AjmyJqqohANyBN/e" Content-Disposition: inline In-Reply-To: <519CA653.3090803@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 00/10] curl: fix curl read List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Fam Zheng , qemu-devel@nongnu.org --AjmyJqqohANyBN/e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 22, 2013 at 01:04:51PM +0200, Paolo Bonzini wrote: > Something is trying to write, but there's no write operation defined for > CURL. >=20 > I guess curl (and other backends too) should reject being opened for > write. Alternatively, block.c could do that for them. Yes, I'd just got to that conclusion as well :-) The attached patch fixes the crash for me. Rich. --=20 Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjon= es virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/ --AjmyJqqohANyBN/e Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-block-curl.c-Refuse-to-open-the-handle-for-writes.patch" Content-Transfer-Encoding: quoted-printable =46rom 0d42755f009c142b85fb07a06a41cee6c7ea68ba Mon Sep 17 00:00:00 2001 =46rom: "Richard W.M. Jones" Date: Wed, 22 May 2013 12:11:45 +0100 Subject: [PATCH] block/curl.c: Refuse to open the handle for writes. --- block/curl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/curl.c b/block/curl.c index b8935fd..f1e302b 100644 --- a/block/curl.c +++ b/block/curl.c @@ -406,6 +406,10 @@ static int curl_open(BlockDriverState *bs, QDict *opti= ons, int flags) =20 static int inited =3D 0; =20 + if (flags & BDRV_O_RDWR) { + return -ENOTSUP; + } + opts =3D qemu_opts_create_nofail(&runtime_opts); qemu_opts_absorb_qdict(opts, options, &local_err); if (error_is_set(&local_err)) { --=20 1.8.2.1 --AjmyJqqohANyBN/e--