From f5edb014ed221db6942225ec675aafe2675632dd Mon Sep 17 00:00:00 2001 From: Naphtali Sprei Date: Sun, 17 Jan 2010 16:48:13 +0200 Subject: Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE. Instead of using the field 'readonly' of the BlockDriverState struct for passing the request, pass the request in the flags parameter to the function. Signed-off-by: Naphtali Sprei Signed-off-by: Anthony Liguori --- block/vmdk.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'block/vmdk.c') diff --git a/block/vmdk.c b/block/vmdk.c index 4e48622..ddc2fcb 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -357,7 +357,7 @@ static int vmdk_parent_open(BlockDriverState *bs, const char * filename) return -1; } parent_open = 1; - if (bdrv_open(bs->backing_hd, parent_img_name, BDRV_O_RDONLY) < 0) + if (bdrv_open(bs->backing_hd, parent_img_name, 0) < 0) goto failure; parent_open = 0; } @@ -371,9 +371,10 @@ static int vmdk_open(BlockDriverState *bs, const char *filename, int flags) uint32_t magic; int l1_size, i, ret; - if (parent_open) - // Parent must be opened as RO. - flags = BDRV_O_RDONLY; + if (parent_open) { + /* Parent must be opened as RO, no RDWR. */ + flags = 0; + } ret = bdrv_file_open(&s->hd, filename, flags); if (ret < 0) -- cgit v1.1