From patchwork Thu Mar 11 14:44:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naphtali Sprei X-Patchwork-Id: 47335 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 50BB3B7CB9 for ; Fri, 12 Mar 2010 02:07:08 +1100 (EST) Received: from localhost ([127.0.0.1]:49582 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NpjyM-0004q0-4q for incoming@patchwork.ozlabs.org; Thu, 11 Mar 2010 10:06:50 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Npjcv-0004lJ-0S for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:44:41 -0500 Received: from [199.232.76.173] (port=55452 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Npjcu-0004ki-E7 for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:44:40 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Npjct-0007I3-BR for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:44:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48376) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Npjcs-0007Ht-Uh for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:44:39 -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 o2BEiabx010225 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 11 Mar 2010 09:44:37 -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 o2BEiZSO005186 for ; Thu, 11 Mar 2010 09:44:35 -0500 From: Naphtali Sprei To: qemu-devel@nongnu.org Date: Thu, 11 Mar 2010 16:44:33 +0200 Message-Id: <1268318674-10607-1-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. Subject: [Qemu-devel] [PATCH 1/2] read-only: minor cleanup 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 Really use read-only flags for opening the file when asked for read-only Signed-off-by: Naphtali Sprei --- qemu-nbd.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index eac0c21..d803bfd 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -258,6 +258,7 @@ int main(int argc, char **argv) break; case 'r': readonly = true; + flags &= BDRV_O_RDWR; break; case 'P': partition = strtol(optarg, &end, 0);