From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXwLd-00034b-Sn for qemu-devel@nongnu.org; Thu, 21 Jan 2010 07:41:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXwLZ-00030h-D9 for qemu-devel@nongnu.org; Thu, 21 Jan 2010 07:41:17 -0500 Received: from [199.232.76.173] (port=37383 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXwLZ-00030a-25 for qemu-devel@nongnu.org; Thu, 21 Jan 2010 07:41:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56064) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXwLY-00081u-IJ for qemu-devel@nongnu.org; Thu, 21 Jan 2010 07:41:12 -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 o0LCfBXO031878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 21 Jan 2010 07:41:11 -0500 From: Naphtali Sprei Date: Thu, 21 Jan 2010 14:40:41 +0200 Message-Id: <1264077641-17902-8-git-send-email-nsprei@redhat.com> In-Reply-To: <1264077641-17902-7-git-send-email-nsprei@redhat.com> References: <1264077641-17902-1-git-send-email-nsprei@redhat.com> <1264077641-17902-2-git-send-email-nsprei@redhat.com> <1264077641-17902-3-git-send-email-nsprei@redhat.com> <1264077641-17902-4-git-send-email-nsprei@redhat.com> <1264077641-17902-5-git-send-email-nsprei@redhat.com> <1264077641-17902-6-git-send-email-nsprei@redhat.com> <1264077641-17902-7-git-send-email-nsprei@redhat.com> Subject: [Qemu-devel] [PATCH 3/3] Read-only device changed to opens it's file for read-only. 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/bochs.c | 6 ++---- block/parallels.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/block/bochs.c b/block/bochs.c index 3489258..fb83594 100644 --- a/block/bochs.c +++ b/block/bochs.c @@ -116,11 +116,9 @@ static int bochs_open(BlockDriverState *bs, const char *filename, int flags) struct bochs_header bochs; struct bochs_header_v1 header_v1; - fd = open(filename, O_RDWR | O_BINARY); + fd = open(filename, O_RDONLY | O_BINARY); if (fd < 0) { - fd = open(filename, O_RDONLY | O_BINARY); - if (fd < 0) - return -1; + return -1; } bs->read_only = 1; // no write support yet diff --git a/block/parallels.c b/block/parallels.c index 63b6738..41b3a7c 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -74,11 +74,9 @@ static int parallels_open(BlockDriverState *bs, const char *filename, int flags) int fd, i; struct parallels_header ph; - fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE); + fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE); if (fd < 0) { - fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE); - if (fd < 0) - return -1; + return -1; } bs->read_only = 1; // no write support yet -- 1.6.3.3