[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 37/42] qemu-io: Make filename optional
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 37/42] qemu-io: Make filename optional |
Date: |
Wed, 15 Jan 2014 11:22:50 +0100 |
From: Max Reitz <address@hidden>
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 <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
qemu-io.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/qemu-io.c b/qemu-io.c
index bfb773e..d669028 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -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)
--
1.8.1.4
- [Qemu-devel] [PULL 32/42] blkdebug: Allow command-line file configuration, (continued)
- [Qemu-devel] [PULL 32/42] blkdebug: Allow command-line file configuration, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 30/42] block: Allow recursive "file"s, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 33/42] blkverify: Allow command-line configuration, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 35/42] qapi: Add "errno" to the list of polluted words, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 34/42] blkverify: Don't require protocol filename, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 36/42] qapi: QMP interface for blkdebug and blkverify, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 37/42] qemu-io: Make filename optional,
Kevin Wolf <=
- [Qemu-devel] [PULL 39/42] tests: Add test for qdict_flatten(), Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 40/42] iotests: Test new blkdebug/blkverify interface, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 38/42] tests: Add test for qdict_array_split(), Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 41/42] iotests: Test file format nesting, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 42/42] block: fix backing file segfault, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 27/42] block: Allow block devices without files, Kevin Wolf, 2014/01/15