summaryrefslogtreecommitdiffstats
path: root/qom
diff options
context:
space:
mode:
authorKevin Wolf2020-10-07 18:49:02 +0200
committerKevin Wolf2020-10-15 16:06:27 +0200
commitc9ac1458430e4794adc8f0418d263befc3917886 (patch)
tree5c11a59fbf6f7435b78d568b255af9408bd00249 /qom
parentqom: Factor out helpers from user_creatable_print_help() (diff)
downloadqemu-c9ac1458430e4794adc8f0418d263befc3917886.tar.gz
qemu-c9ac1458430e4794adc8f0418d263befc3917886.tar.xz
qemu-c9ac1458430e4794adc8f0418d263befc3917886.zip
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 <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201007164903.282198-4-kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qom')
-rw-r--r--qom/object_interfaces.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
index 3fd1da157e..ed896fe764 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;