Patchwork [v2,1/2] read-only: minor cleanup

login
register
mail settings
Submitter Naphtali Sprei
Date March 14, 2010, 1:19 p.m.
Message ID <1268572797-31664-1-git-send-email-nsprei@redhat.com>
Download mbox | patch
Permalink /patch/47728/
State New
Headers show

Comments

Naphtali Sprei - March 14, 2010, 1:19 p.m.
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(-)
Paolo Bonzini - March 15, 2010, 12:29 p.m.
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<nsprei@redhat.com>
> ---
>   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 <pbonzini@redhat.com>

Paolo
Anthony Liguori - March 17, 2010, 4:59 p.m.
On 03/14/2010 08:19 AM, Naphtali Sprei wrote:
> Really use read-only flags for opening the file when asked for read-only
>
> Signed-off-by: Naphtali Sprei<nsprei@redhat.com>
>    

Applied all.  Thanks.

Regards,

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

Patch

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