In a future commit, a single target-agnostic qmp_query_cpu_definitions() will dispatch call to the per-architecture implementations based on target_arch(). Introduce the header holding those declarations and rename the arm implementation.
We keep the existing qmp_query_cpu_definitions() function to not break the build. Acked-by: Markus Armbruster <[email protected]> Reviewed-by: Daniel P. Berrangé <[email protected]> Link: https://lore.kernel.org/qemu-devel/[email protected] Signed-off-by: Pierrick Bouvier <[email protected]> --- include/system/qmp-cpu.h | 14 ++++++++++++++ target/arm/arm-qmp-cmds.c | 8 +++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 include/system/qmp-cpu.h diff --git a/include/system/qmp-cpu.h b/include/system/qmp-cpu.h new file mode 100644 index 00000000000..e969aec667a --- /dev/null +++ b/include/system/qmp-cpu.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Per-architecture implementations of CPU-related QMP commands. + */ + +#ifndef SYSTEM_QMP_CPU_H +#define SYSTEM_QMP_CPU_H + +#include "qapi/error.h" +#include "qapi/qapi-types-machine.h" + +CpuDefinitionInfoList *qmp_query_arm_cpu_definitions(Error **errp); + +#endif diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c index 83ec95c290f..d227a06e2c6 100644 --- a/target/arm/arm-qmp-cmds.c +++ b/target/arm/arm-qmp-cmds.c @@ -28,6 +28,7 @@ #include "qapi/visitor.h" #include "qapi/qobject-input-visitor.h" #include "qapi/qapi-commands-machine.h" +#include "system/qmp-cpu.h" #include "qapi/qapi-commands-misc-arm.h" #include "qobject/qdict.h" #include "qom/qom-qobject.h" @@ -216,7 +217,7 @@ static void arm_cpu_add_definition(gpointer data, gpointer user_data) QAPI_LIST_PREPEND(*cpu_list, info); } -CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) +CpuDefinitionInfoList *qmp_query_arm_cpu_definitions(Error **errp) { CpuDefinitionInfoList *cpu_list = NULL; GSList *list; @@ -227,3 +228,8 @@ CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) return cpu_list; } + +CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) +{ + return qmp_query_arm_cpu_definitions(errp); +} -- 2.43.0
