mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-01 22:23:23 -10:00
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: Max Reitz <[email protected]> Reviewed-by: Kevin Wolf <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
This commit is contained in:
1 parent
1bf20b8280
commit
fd0fee34b5
1 file changed
+5
-3
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user