aboutsummaryrefslogtreecommitdiff
path: root/util/qemu-config.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2021-07-21 16:10:55 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2021-07-22 14:44:47 +0200
commit40e07370f21f12f020c1eb8a8d8c5321774e488a (patch)
tree74b6826846c363cebb1d59f2fb1acc107f0fb1a9 /util/qemu-config.c
parent670b35919301213e45ef42ed689f6ea67004d714 (diff)
qemu-config: restore "machine" in qmp_query_command_line_options()
Commit d8fb7d0969d5c32b3d1b9e20b63ec6c0abe80be4 ("vl: switch -M parsing to keyval") stopped adding the "machine" QemuOptsList. This causes "machine" options to not show up in QMP query-command-line-options output. For example, libvirt cannot detect that kernel_irqchip support is available. Adjust the "machine" opts enumeration in qmp_query_command_line_options() so that options are properly reported. Fixes: d8fb7d0969d5 ("vl: switch -M parsing to keyval") Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20210721151055.424580-1-stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'util/qemu-config.c')
-rw-r--r--util/qemu-config.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/util/qemu-config.c b/util/qemu-config.c
index fdf6cd69fc..436ab63b16 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -255,8 +255,6 @@ CommandLineOptionInfoList *qmp_query_command_line_options(bool has_option,
info->option = g_strdup(vm_config_groups[i]->name);
if (!strcmp("drive", vm_config_groups[i]->name)) {
info->parameters = get_drive_infolist();
- } else if (!strcmp("machine", vm_config_groups[i]->name)) {
- info->parameters = query_option_descs(machine_opts.desc);
} else {
info->parameters =
query_option_descs(vm_config_groups[i]->desc);
@@ -265,6 +263,13 @@ CommandLineOptionInfoList *qmp_query_command_line_options(bool has_option,
}
}
+ if (!has_option || !strcmp(option, "machine")) {
+ info = g_malloc0(sizeof(*info));
+ info->option = g_strdup("machine");
+ info->parameters = query_option_descs(machine_opts.desc);
+ QAPI_LIST_PREPEND(conf_list, info);
+ }
+
if (conf_list == NULL) {
error_setg(errp, "invalid option name: %s", option);
}