|
| From: | Eric Blake |
| Subject: | Re: [Qemu-devel] [PATCH 08/10] vl: handle -object ? |
| Date: | Thu, 6 Sep 2018 10:34:52 -0500 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 09/06/2018 10:12 AM, Marc-André Lureau wrote: In the subject, s/\?/help/
Signed-off-by: Marc-André Lureau <address@hidden>
---
vl.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/vl.c b/vl.c
index 5ba06adf78..8a5fd0c81f 100644
--- a/vl.c
+++ b/vl.c
@@ -2731,6 +2731,19 @@ static int machine_set_property(void *opaque,
*/
static bool object_create_initial(const char *type)
{
+ if (is_help_option(type)) {
+ GSList *l, *list;
+
+ error_printf("List of user creatable objects:\n");
+ list = object_class_get_list_sorted(TYPE_USER_CREATABLE, false);
+ for (l = list; l != NULL; l = l->next) {
+ ObjectClass *oc = OBJECT_CLASS(l->data);
+ error_printf("%s\n", object_class_get_name(oc));
This prints to stderr,
+ } + g_slist_free(list); + exit(0);
then exits with status 0. I'd much rather successful help text be printed to stdout.
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
| [Prev in Thread] | Current Thread | [Next in Thread] |