From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nd21X-0005ca-JB for qemu-devel@nongnu.org; Thu, 04 Feb 2010 08:45:35 -0500 Received: from [199.232.76.173] (port=49140 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nd21X-0005cB-5c for qemu-devel@nongnu.org; Thu, 04 Feb 2010 08:45:35 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nd21V-0001Tv-DI for qemu-devel@nongnu.org; Thu, 04 Feb 2010 08:45:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:12366) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nd21U-0001TR-Ui for qemu-devel@nongnu.org; Thu, 04 Feb 2010 08:45:33 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o14DjWpc015971 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 4 Feb 2010 08:45:32 -0500 From: Naphtali Sprei Date: Thu, 4 Feb 2010 15:45:22 +0200 Message-Id: <1265291122-31159-2-git-send-email-nsprei@redhat.com> In-Reply-To: <1265291122-31159-1-git-send-email-nsprei@redhat.com> References: <1265291122-31159-1-git-send-email-nsprei@redhat.com> Subject: [Qemu-devel] [PATCH v2 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 527b146..1db9961 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