raw-posix: open flags use BDRV_ namespace, not posix namespace
authorAvi Kivity <avi@redhat.com>
Tue, 16 Jun 2009 13:21:08 +0000 (16:21 +0300)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 16 Jun 2009 20:18:35 +0000 (15:18 -0500)
The flags argument to raw_common_open() contain bits defined by the BDRV_O_*
namespace, not the posix O_* namespace.

Adjust to use the correct constants.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block/raw-posix.c

index 5032348..5790206 100644 (file)
@@ -133,7 +133,7 @@ static int raw_open_common(BlockDriverState *bs, const char *filename,
     s->lseek_err_cnt = 0;
 
     s->open_flags |= O_BINARY;
-    if ((flags & BDRV_O_ACCESS) == O_RDWR) {
+    if ((flags & BDRV_O_ACCESS) == BDRV_O_RDWR) {
         s->open_flags |= O_RDWR;
     } else {
         s->open_flags |= O_RDONLY;