[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/24] vl: make -accel help to list enabled accelerat
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 02/24] vl: make -accel help to list enabled accelerators only |
Date: |
Mon, 3 Jun 2019 19:10:21 +0200 |
From: Wainer dos Santos Moschetta <address@hidden>
Currently, -accel help shows all possible accelerators regardless
if they are enabled in the binary or not. That is a different
semantic from -cpu and -machine helps, for example. So this change
makes it to list only the accelerators which support is compiled
in the binary target.
Note that it does not check if the accelerator is enabled in the
host, so the help message's header was rewritten to emphasize
that. Also qtest is not displayed given that it is used for
internal testing purpose only.
Signed-off-by: Wainer dos Santos Moschetta <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
vl.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/vl.c b/vl.c
index 139658d..f023a8c 100644
--- a/vl.c
+++ b/vl.c
@@ -3576,7 +3576,23 @@ int main(int argc, char **argv, char **envp)
optarg, true);
optarg = qemu_opt_get(accel_opts, "accel");
if (!optarg || is_help_option(optarg)) {
- printf("Possible accelerators: kvm, xen, hax, tcg\n");
+ printf("Accelerators supported in QEMU binary:\n");
+ GSList *el, *accel_list = object_class_get_list(TYPE_ACCEL,
+ false);
+ for (el = accel_list; el; el = el->next) {
+ gchar *typename = g_strdup(object_class_get_name(
+ OBJECT_CLASS(el->data)));
+ /* omit qtest which is used for tests only */
+ if (g_strcmp0(typename, ACCEL_CLASS_NAME("qtest")) &&
+ g_str_has_suffix(typename, ACCEL_CLASS_SUFFIX)) {
+ gchar **optname = g_strsplit(typename,
+ ACCEL_CLASS_SUFFIX,
0);
+ printf("%s\n", optname[0]);
+ g_free(optname);
+ }
+ g_free(typename);
+ }
+ g_slist_free(accel_list);
exit(0);
}
opts = qemu_opts_create(qemu_find_opts("machine"), NULL,
--
1.8.3.1
- [Qemu-devel] [PULL 00/24] Misc patches for 2019-06-03, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 01/24] test-thread-pool: be more reliable, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 02/24] vl: make -accel help to list enabled accelerators only,
Paolo Bonzini <=
- [Qemu-devel] [PULL 03/24] checkpatch: allow SPDX-License-Identifier, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 04/24] memory: Remove memory_region_get_dirty(), Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 07/24] edu: mmio: allow 64-bit access in read dispatch, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 08/24] edu: uses uint64_t in dma operation, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 09/24] qgraph: allow extra_device_opts on contains nodes, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 05/24] i386: Enable IA32_MISC_ENABLE MWAIT bit when exposing mwait/monitor, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 20/24] tests: convert ds1338-test to qtest, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 17/24] libqos: add ARM n800 machine object, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 14/24] imx25-pdk: create ds1338 for qtest inside the test, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 18/24] libqos: add ARM imx25-pdk machine object, Paolo Bonzini, 2019/06/03