aboutsummaryrefslogtreecommitdiff
path: root/qemu-io.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2019-10-11 21:49:17 +0200
committerKevin Wolf <kwolf@redhat.com>2019-10-14 17:12:48 +0200
commit4fa1f0dc052968b41d2bdffd9cb9fcab8137cdaf (patch)
treeadc04289e0c57cdef33b2cf07764c49257785312 /qemu-io.c
parent3e9297f3659701a72110f0f560b4cc22452972f1 (diff)
downloadqemu-4fa1f0dc052968b41d2bdffd9cb9fcab8137cdaf.zip
qemu-4fa1f0dc052968b41d2bdffd9cb9fcab8137cdaf.tar.gz
qemu-4fa1f0dc052968b41d2bdffd9cb9fcab8137cdaf.tar.bz2
qemu-io: Support help options for --object
Instead of parsing help options as normal object properties and returning an error, provide the same help functionality as the system emulator in qemu-io, too. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'qemu-io.c')
-rw-r--r--qemu-io.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/qemu-io.c b/qemu-io.c
index f64eca6..91e3276 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -475,6 +475,13 @@ static QemuOptsList qemu_object_opts = {
},
};
+static bool qemu_io_object_print_help(const char *type, QemuOpts *opts)
+{
+ if (user_creatable_print_help(type, opts)) {
+ exit(0);
+ }
+ return true;
+}
static QemuOptsList file_opts = {
.name = "file",
@@ -622,7 +629,7 @@ int main(int argc, char **argv)
qemu_opts_foreach(&qemu_object_opts,
user_creatable_add_opts_foreach,
- NULL, &error_fatal);
+ qemu_io_object_print_help, &error_fatal);
if (!trace_init_backends()) {
exit(1);