From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nr9QL-0003ER-EZ for qemu-devel@nongnu.org; Mon, 15 Mar 2010 08:29:33 -0400 Received: from [199.232.76.173] (port=36998 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nr9QJ-0003Da-My for qemu-devel@nongnu.org; Mon, 15 Mar 2010 08:29:31 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nr9QI-0004Rl-Sg for qemu-devel@nongnu.org; Mon, 15 Mar 2010 08:29:31 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:39790) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nr9QI-0004Rb-L0 for qemu-devel@nongnu.org; Mon, 15 Mar 2010 08:29:30 -0400 Received: by gwaa18 with SMTP id a18so558704gwa.4 for ; Mon, 15 Mar 2010 05:29:29 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4B9E2823.8030107@redhat.com> Date: Mon, 15 Mar 2010 13:29:23 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1268572797-31664-1-git-send-email-nsprei@redhat.com> In-Reply-To: <1268572797-31664-1-git-send-email-nsprei@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH v2 1/2] read-only: minor cleanup List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Naphtali Sprei Cc: qemu-devel@nongnu.org On 03/14/2010 02:19 PM, Naphtali Sprei wrote: > 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..a393583 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); Acked-by: Paolo Bonzini Paolo