From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UocLg-0000Ac-TS for qemu-devel@nongnu.org; Mon, 17 Jun 2013 12:32:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UocLf-0004iO-MJ for qemu-devel@nongnu.org; Mon, 17 Jun 2013 12:32:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UocLf-0004iE-Ew for qemu-devel@nongnu.org; Mon, 17 Jun 2013 12:32:07 -0400 From: Kevin Wolf Date: Mon, 17 Jun 2013 18:31:46 +0200 Message-Id: <1371486710-17793-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1371486710-17793-1-git-send-email-kwolf@redhat.com> References: <1371486710-17793-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 3/7] block/curl.c: Refuse to open the handle for writes. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: "Richard W.M. Jones" Signed-off-by: Richard W.M. Jones Signed-off-by: Fam Zheng Signed-off-by: Kevin Wolf --- block/curl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/block/curl.c b/block/curl.c index 4dc3b4b..0fba451 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.1.4