Commit fd0fee34 authored by Max Reitz's avatar Max Reitz Committed by Kevin Wolf

qemu-io: Make filename optional

Giving a filename is actually not essential, since it can be specified
through the options as well - on the contrary: Sometimes a filename must
not be given.
Signed-off-by: default avatarMax Reitz <>
Reviewed-by: default avatarKevin Wolf <>
Signed-off-by: default avatarKevin Wolf <>
parent 1bf20b82
......@@ -163,11 +163,13 @@ static int open_f(BlockDriverState *bs, int argc, char **argv)
flags |= BDRV_O_RDWR;
if (optind != argc - 1) {
if (optind == argc - 1) {
return openfile(argv[optind], flags, growable, opts);
} else if (optind == argc) {
return openfile(NULL, flags, growable, opts);
} else {
return qemuio_command_usage(&open_cmd);
return openfile(argv[optind], flags, growable, opts);
static int quit_f(BlockDriverState *bs, int argc, char **argv)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment