[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/4] qemu-nbd: Support help options for --object
From: |
Kevin Wolf |
Subject: |
[PATCH 4/4] qemu-nbd: Support help options for --object |
Date: |
Fri, 11 Oct 2019 22:55:51 +0200 |
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 <address@hidden>
---
qemu-nbd.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 9032b6de2a..caacf0ed73 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -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);
--
2.20.1