On Thu, Oct 15, 2026 at 8:55 AM Pierrick Bouvier
<[email protected]> wrote:
>
> This series allows to link multiple targets that define
> qmp_query_cpu_definitions. It simply replaces the duplicated definitions with
> target-specific ones and a single dispatcher. We didn't use yet the dispatcher
> pattern, and it's the first situation where it appears to be a good fit.
>
> A possible alternative would be to introduce this callback directly at
> target-info level, which I think is a less desirable solution, since it would
> ties this API to monitor.
I tried this way and it is much better I think.
>
> If the approach here is accepted, I'll extend this series with
> qmp_query_cpu_model_expansion which follows the same pattern.
> With this, we'll be free to link together almost all the base architectures.
>
> Pierrick Bouvier (8):
> target/arm: rename qmp_query_cpu_definitions to
> qmp_query_arm_cpu_definitions
> target/i386: rename qmp_query_cpu_definitions to
> qmp_query_i386_cpu_definitions
> target/loongarch: rename to qmp_query_loongarch_cpu_definitions
> target/mips: rename qmp_query_cpu_definitions to
> qmp_query_mips_cpu_definitions
> target/ppc: rename qmp_query_cpu_definitions to
> qmp_query_ppc_cpu_definitions
> target/riscv: rename to qmp_query_cpu_definitions to
> qmp_query_riscv_cpu_definitions
> target/s390x: rename qmp_query_cpu_definitions to
> qmp_query_s390x_cpu_definitions
> qmp: reimplement qmp_query_cpu_definitions as a dispatcher function
>
> hw/core/machine-qmp-cmds.c | 32 +++++++++++++++++++++++++++
> include/system/qmp-cpu.h | 20 +++++++++++++++++
> stubs/meson.build | 6 +++++
> stubs/qmp-cpu-arm.c | 9 ++++++++
> stubs/qmp-cpu-i386.c | 9 ++++++++
> stubs/qmp-cpu-loongarch.c | 9 ++++++++
> stubs/qmp-cpu-mips.c | 9 ++++++++
> stubs/qmp-cpu-ppc.c | 9 ++++++++
> stubs/qmp-cpu-riscv.c | 9 ++++++++
> stubs/qmp-cpu-s390x.c | 6 +++++
> stubs/qmp-cpu.c | 7 ------
Introduce this callback directly at target-info level wil avoid these
stubs/qmp-*, basically we indeed can remove more stubs. maybe
qmp-cpu.c be removed.
> target/arm/arm-qmp-cmds.c | 3 ++-
> target/i386/cpu.c | 3 ++-
> target/loongarch/loongarch-qmp-cmds.c | 3 ++-
> target/mips/system/mips-qmp-cmds.c | 3 ++-
> target/ppc/ppc-qmp-cmds.c | 3 ++-
> target/riscv/riscv-qmp-cmds.c | 3 ++-
> target/s390x/cpu_models_system.c | 3 ++-
> 18 files changed, 132 insertions(+), 14 deletions(-)
> create mode 100644 include/system/qmp-cpu.h
> create mode 100644 stubs/qmp-cpu-arm.c
> create mode 100644 stubs/qmp-cpu-i386.c
> create mode 100644 stubs/qmp-cpu-loongarch.c
> create mode 100644 stubs/qmp-cpu-mips.c
> create mode 100644 stubs/qmp-cpu-ppc.c
> create mode 100644 stubs/qmp-cpu-riscv.c
>
> --
> 2.43.0
>
>
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo