diff options
author | Kevin Wolf <kwolf@redhat.com> | 2019-10-11 21:49:17 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2019-10-14 17:12:48 +0200 |
commit | 495bf893b0db2621726815b5625a6a788d3958aa (patch) | |
tree | 13b000968039404376652d7edf1f04bf15f01a52 /qemu-nbd.c | |
parent | c6e5cdfd4b06918a6bcefa2039af7253dbd5e3c0 (diff) | |
download | qemu-495bf893b0db2621726815b5625a6a788d3958aa.zip qemu-495bf893b0db2621726815b5625a6a788d3958aa.tar.gz qemu-495bf893b0db2621726815b5625a6a788d3958aa.tar.bz2 |
qemu-nbd: 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-nbd, too.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'qemu-nbd.c')
-rw-r--r-- | qemu-nbd.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -507,6 +507,13 @@ static QemuOptsList qemu_object_opts = { }, }; +static bool qemu_nbd_object_print_help(const char *type, QemuOpts *opts) +{ + if (user_creatable_print_help(type, opts)) { + exit(0); + } + return true; +} static QCryptoTLSCreds *nbd_get_tls_creds(const char *id, bool list, @@ -902,7 +909,7 @@ int main(int argc, char **argv) qemu_opts_foreach(&qemu_object_opts, user_creatable_add_opts_foreach, - NULL, &error_fatal); + qemu_nbd_object_print_help, &error_fatal); if (!trace_init_backends()) { exit(1); |