aboutsummaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-09-06 17:05:34 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2018-10-05 16:27:09 +0400
commit1195fa2b08d98ab503155c5cee8831d1ef91aac5 (patch)
tree896773a259ab9c6a86db6b713a6205d92dab5be3 /qom
parent033bfc5e0e450c5f6566cb9dab7e4095d06199c8 (diff)
vl: list user creatable properties when 'help' is argument
Iterate over the writable class properties, sort and print them out with the description if available. Ex: qemu -object memory-backend-file,help memory-backend-file.align=int memory-backend-file.discard-data=bool memory-backend-file.dump=bool - Set to 'off' to exclude from core dump memory-backend-file.host-nodes=int - Binds memory to the list of NUMA host nodes memory-backend-file.mem-path=string memory-backend-file.merge=bool - Mark memory as mergeable memory-backend-file.pmem=bool memory-backend-file.policy=HostMemPolicy - Set the NUMA policy memory-backend-file.prealloc=bool - Preallocate memory memory-backend-file.share=bool - Mark the memory as private to QEMU or shared memory-backend-file.size=int - Size of the memory region (ex: 500M) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qom')
-rw-r--r--qom/object_interfaces.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
index 72b97a8bed..941fd63afd 100644
--- a/qom/object_interfaces.c
+++ b/qom/object_interfaces.c
@@ -141,14 +141,14 @@ Object *user_creatable_add_opts(QemuOpts *opts, Error **errp)
int user_creatable_add_opts_foreach(void *opaque, QemuOpts *opts, Error **errp)
{
- bool (*type_predicate)(const char *) = opaque;
+ bool (*type_opt_predicate)(const char *, QemuOpts *) = opaque;
Object *obj = NULL;
Error *err = NULL;
const char *type;
type = qemu_opt_get(opts, "qom-type");
- if (type && type_predicate &&
- !type_predicate(type)) {
+ if (type && type_opt_predicate &&
+ !type_opt_predicate(type, opts)) {
return 0;
}