diff options
author | Naphtali Sprei | 2010-01-17 15:48:15 +0100 |
---|---|---|
committer | Anthony Liguori | 2010-01-20 15:25:22 +0100 |
commit | 03cbdac7efc20994d0a87015e24e835d0139df7b (patch) | |
tree | 9a6bfd0de583fee45604a4d85bb1745f7637d2ff | |
parent | Added drives' readonly option (diff) | |
download | qemu-03cbdac7efc20994d0a87015e24e835d0139df7b.tar.gz qemu-03cbdac7efc20994d0a87015e24e835d0139df7b.tar.xz qemu-03cbdac7efc20994d0a87015e24e835d0139df7b.zip |
Disable fall-back to read-only when cannot open drive's file for read-write
Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | block.c | 6 |
1 files changed, 0 insertions, 6 deletions
@@ -444,8 +444,6 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags, if (flags & (BDRV_O_CACHE_WB|BDRV_O_NOCACHE)) bs->enable_write_cache = 1; - /* Note: for compatibility, we open disk image files as RDWR, and - RDONLY as fallback */ bs->read_only = (flags & BDRV_O_RDWR) == 0; if (!(flags & BDRV_O_FILE)) { open_flags = (flags & (BDRV_O_RDWR | BDRV_O_CACHE_MASK|BDRV_O_NATIVE_AIO)); @@ -459,10 +457,6 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags, ret = -ENOTSUP; } else { ret = drv->bdrv_open(bs, filename, open_flags); - if ((ret == -EACCES || ret == -EPERM) && !(flags & BDRV_O_FILE)) { - ret = drv->bdrv_open(bs, filename, open_flags & ~BDRV_O_RDWR); - bs->read_only = 1; - } } if (ret < 0) { qemu_free(bs->opaque); |