From c9ac1458430e4794adc8f0418d263befc3917886 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Wed, 7 Oct 2020 18:49:02 +0200 Subject: qom: Add user_creatable_print_help_from_qdict() This adds a function that, given a QDict of non-help options, prints help for user creatable objects. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster Message-Id: <20201007164903.282198-4-kwolf@redhat.com> Signed-off-by: Kevin Wolf --- qom/object_interfaces.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'qom') diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index 3fd1da1..ed896fe 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -279,6 +279,15 @@ bool user_creatable_print_help(const char *type, QemuOpts *opts) return false; } +void user_creatable_print_help_from_qdict(QDict *args) +{ + const char *type = qdict_get_try_str(args, "qom-type"); + + if (!type || !user_creatable_print_type_properites(type)) { + user_creatable_print_types(); + } +} + bool user_creatable_del(const char *id, Error **errp) { Object *container; -- cgit v1.1