diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-09-06 17:05:34 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-10-05 16:27:09 +0400 |
commit | 1195fa2b08d98ab503155c5cee8831d1ef91aac5 (patch) | |
tree | 896773a259ab9c6a86db6b713a6205d92dab5be3 /qom/object_interfaces.c | |
parent | 033bfc5e0e450c5f6566cb9dab7e4095d06199c8 (diff) | |
download | qemu-1195fa2b08d98ab503155c5cee8831d1ef91aac5.zip qemu-1195fa2b08d98ab503155c5cee8831d1ef91aac5.tar.gz qemu-1195fa2b08d98ab503155c5cee8831d1ef91aac5.tar.bz2 |
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/object_interfaces.c')
-rw-r--r-- | qom/object_interfaces.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index 72b97a8..941fd63 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; } |