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 --- qemu-io.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'qemu-io.c') diff --git a/qemu-io.c b/qemu-io.c index 1c19b92c0..b159bc9c3 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -1359,10 +1359,9 @@ open_f(int argc, char **argv) } } - if (readonly) - flags |= BDRV_O_RDONLY; - else - flags |= BDRV_O_RDWR; + if (!readonly) { + flags |= BDRV_O_RDWR; + } if (optind != argc - 1) return command_usage(&open_cmd); @@ -1506,10 +1505,9 @@ int main(int argc, char **argv) add_check_command(init_check_command); /* open the device */ - if (readonly) - flags |= BDRV_O_RDONLY; - else - flags |= BDRV_O_RDWR; + if (!readonly) { + flags |= BDRV_O_RDWR; + } if ((argc - optind) == 1) openfile(argv[optind], flags, growable); -- cgit v1.2.3