From patchwork Thu Jan 21 12:40:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naphtali Sprei X-Patchwork-Id: 43433 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 62387B7CB9 for ; Thu, 21 Jan 2010 23:56:47 +1100 (EST) Received: from localhost ([127.0.0.1]:41220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXwYx-00075H-9S for incoming@patchwork.ozlabs.org; Thu, 21 Jan 2010 07:55:03 -0500 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 Received: from localhost.localdomain (dhcp-0-60.tlv.redhat.com [10.35.0.60]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0LCewTU029585; Thu, 21 Jan 2010 07:41:10 -0500 From: Naphtali Sprei To: qemu-devel@nongnu.org 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> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Naphtali Sprei Subject: [Qemu-devel] [PATCH 3/3] Read-only device changed to opens it's file for read-only. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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