diff options
author | Christoph Hellwig <hch@lst.de> | 2010-01-20 18:13:42 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-01-26 15:42:02 -0600 |
commit | 9a2d77ad0dd6b3e93669543b846a75c02878eba7 (patch) | |
tree | b9c5bac76f770d1def9446c3853664197eb6e69f /block | |
parent | 6987307ca30aead67e8545934186c92f942710f6 (diff) |
block: kill BDRV_O_CREAT
The BDRV_O_CREAT option is unused inside qemu and partially duplicates
the bdrv_create method. Remove it, and the -C option to qemu-io which
isn't used in qemu-iotests anyway.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/nbd.c | 3 | ||||
-rw-r--r-- | block/raw-posix.c | 6 | ||||
-rw-r--r-- | block/raw-win32.c | 10 |
3 files changed, 4 insertions, 15 deletions
diff --git a/block/nbd.c b/block/nbd.c index 47d4778999..7bac38d086 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -49,9 +49,6 @@ static int nbd_open(BlockDriverState *bs, const char* filename, int flags) size_t blocksize; int ret; - if ((flags & BDRV_O_CREAT)) - return -EINVAL; - if (!strstart(filename, "nbd:", &host)) return -EINVAL; diff --git a/block/raw-posix.c b/block/raw-posix.c index 52bbcdae76..325d2265f5 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -205,13 +205,9 @@ out_close: static int raw_open(BlockDriverState *bs, const char *filename, int flags) { BDRVRawState *s = bs->opaque; - int open_flags = 0; s->type = FTYPE_FILE; - if (flags & BDRV_O_CREAT) - open_flags = O_CREAT | O_TRUNC; - - return raw_open_common(bs, filename, flags, open_flags); + return raw_open_common(bs, filename, flags, 0); } /* XXX: use host sector size if necessary with: diff --git a/block/raw-win32.c b/block/raw-win32.c index 01a6d2519e..526764f62f 100644 --- a/block/raw-win32.c +++ b/block/raw-win32.c @@ -76,7 +76,7 @@ static int set_sparse(int fd) static int raw_open(BlockDriverState *bs, const char *filename, int flags) { BDRVRawState *s = bs->opaque; - int access_flags, create_flags; + int access_flags; DWORD overlapped; s->type = FTYPE_FILE; @@ -86,11 +86,7 @@ static int raw_open(BlockDriverState *bs, const char *filename, int flags) } else { access_flags = GENERIC_READ; } - if (flags & BDRV_O_CREAT) { - create_flags = CREATE_ALWAYS; - } else { - create_flags = OPEN_EXISTING; - } + overlapped = FILE_ATTRIBUTE_NORMAL; if ((flags & BDRV_O_NOCACHE)) overlapped |= FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH; @@ -98,7 +94,7 @@ static int raw_open(BlockDriverState *bs, const char *filename, int flags) overlapped |= FILE_FLAG_WRITE_THROUGH; s->hfile = CreateFile(filename, access_flags, FILE_SHARE_READ, NULL, - create_flags, overlapped, NULL); + OPEN_EXISTING, overlapped, NULL); if (s->hfile == INVALID_HANDLE_VALUE) { int err = GetLastError(); |