Received: from eggs.gnu.org ([2001:4830:134:3::10]:37337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um0R5-00010o-Mm for qemu-devel@nongnu.org; Mon, 10 Jun 2013 07:38:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Um0R4-0003Bz-LI for qemu-devel@nongnu.org; Mon, 10 Jun 2013 07:38:55 -0400 From: "Richard W.M. Jones" Date: Mon, 10 Jun 2013 12:38:43 +0100 Message-Id: <1370864323-25679-2-git-send-email-rjones@redhat.com> In-Reply-To: <1370864323-25679-1-git-send-email-rjones@redhat.com> References: <1370864323-25679-1-git-send-email-rjones@redhat.com> Subject: [Qemu-devel] [PATCH v2] block/curl.c: Refuse to open the handle for writes. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-trivial@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com From: "Richard W.M. Jones" Signed-off-by: Richard W.M. Jones Signed-off-by: Fam Zheng --- block/curl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/block/curl.c b/block/curl.c index b8935fd..b634ccf 100644 --- a/block/curl.c +++ b/block/curl.c @@ -406,6 +406,12 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags) static int inited = 0; + if (flags & BDRV_O_RDWR) { + qerror_report(ERROR_CLASS_GENERIC_ERROR, + "curl block device does not support writes"); + return -EROFS; + } + opts = qemu_opts_create_nofail(&runtime_opts); qemu_opts_absorb_qdict(opts, options, &local_err); if (error_is_set(&local_err)) { -- 1.8.2.1