From patchwork Wed May 22 11:12:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Richard W.M. Jones" X-Patchwork-Id: 245587 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6328F2C0087 for ; Wed, 22 May 2013 21:13:29 +1000 (EST) Received: from localhost ([::1]:34259 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf6z1-0003aG-H6 for incoming@patchwork.ozlabs.org; Wed, 22 May 2013 07:13:27 -0400 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 Received: from localhost (vpn1-7-57.ams2.redhat.com [10.36.7.57]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4MBCRhM021949; Wed, 22 May 2013 07:12:27 -0400 Date: Wed, 22 May 2013 12:12:24 +0100 From: "Richard W.M. Jones" To: Paolo Bonzini 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-Disposition: inline In-Reply-To: <519CA653.3090803@redhat.com> User-Agent: Mutt/1.5.20 (2009-12-10) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Fam Zheng , qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [PATCH v4 00/10] curl: fix curl read X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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. > > 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. 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 *options, int flags) static int inited = 0; + if (flags & BDRV_O_RDWR) { + return -ENOTSUP; + } + opts = qemu_opts_create_nofail(&runtime_opts); qemu_opts_absorb_qdict(opts, options, &local_err); if (error_is_set(&local_err)) {