From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nd9od-0006Ot-Aj for qemu-devel@nongnu.org; Thu, 04 Feb 2010 17:04:47 -0500 Received: from [199.232.76.173] (port=46746 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nd9oc-0006O7-AO for qemu-devel@nongnu.org; Thu, 04 Feb 2010 17:04:46 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nd9oZ-0000oJ-QV for qemu-devel@nongnu.org; Thu, 04 Feb 2010 17:04:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36362) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nd9oZ-0000o8-Bz for qemu-devel@nongnu.org; Thu, 04 Feb 2010 17:04:43 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o14M4g11007995 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 4 Feb 2010 17:04:42 -0500 From: Naphtali Sprei Date: Fri, 5 Feb 2010 00:04:29 +0200 Message-Id: <1265321069-4105-5-git-send-email-nsprei@redhat.com> In-Reply-To: <1265321069-4105-4-git-send-email-nsprei@redhat.com> References: <1265321069-4105-1-git-send-email-nsprei@redhat.com> <1265321069-4105-2-git-send-email-nsprei@redhat.com> <1265321069-4105-3-git-send-email-nsprei@redhat.com> <1265321069-4105-4-git-send-email-nsprei@redhat.com> Subject: [Qemu-devel] [PATCH v2 resend 4/4] Open backing file read-only also for snapshot mode List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Naphtali Sprei Signed-off-by: Naphtali Sprei --- block.c | 10 +--------- 1 files changed, 1 insertions(+), 9 deletions(-) diff --git a/block.c b/block.c index 4a9df91..780cea9 100644 --- a/block.c +++ b/block.c @@ -483,19 +483,11 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags, if (bs->backing_format[0] != '\0') back_drv = bdrv_find_format(bs->backing_format); - open_flags &= ~BDRV_O_RDWR; /* clear RW, then restore from orig */ - if (bs->is_temporary) { - open_flags |= (flags & BDRV_O_RDWR); - } + open_flags &= ~BDRV_O_RDWR; ret = bdrv_open2(bs->backing_hd, backing_filename, open_flags, back_drv); if (ret < 0) { - open_flags &= ~BDRV_O_RDWR; /* Fall-back to read-only for the backing file */ - ret = bdrv_open2(bs->backing_hd, backing_filename, open_flags, - back_drv); - } - if (ret < 0) { bdrv_close(bs); return ret; } -- 1.6.3.3