diff mbox

[1/2] read-only: minor cleanup

Message ID 1268318674-10607-1-git-send-email-nsprei@redhat.com
State New
Headers show

Commit Message

Naphtali Sprei March 11, 2010, 2:44 p.m. UTC
Really use read-only flags for opening the file when asked for read-only

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
---
 qemu-nbd.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Paolo Bonzini March 12, 2010, 12:03 p.m. UTC | #1
On 03/11/2010 03:44 PM, Naphtali Sprei wrote:
>           case 'r':
>               readonly = true;
> +            flags &= BDRV_O_RDWR;

I'm pretty sure a ~ is missing there. :-)

Paolo
diff mbox

Patch

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);