aboutsummaryrefslogtreecommitdiff
path: root/qemu-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu-io.c')
-rw-r--r--qemu-io.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/qemu-io.c b/qemu-io.c
index 1c19b92c0a..b159bc9c32 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);