On 11/12/2026 5:30 AM, Daniel P. Berrangé wrote:
> The TYPE_ACCEL_CPU QOM type name currently expands to a dynamic
> string based on the target CPU resolving type name. So we have
> a hierarchy that looks like:
>
> object
> +- accel-{x86_64,ppc64,riscv64,...}-cpu
> +- kvm-accel-x86_64-cpu
> +- tcg-accel-x86_64-cpu
> +- mshv-accel-x86_64-cpu
> +- tcg-accel-riscv-cpu
>
> where the middle class changes its name at runtime, so if leaf
> CPU classes from different targets are linked together, their
> immediate parent will be missing unless the selected target
> matches.
>
> The TYPE_ACCEL_CPU class is an abstract base class that does
> not inherantly have target specific logic. It is expected to
> be subclassed with children from different targets, and only
> those childrenneed to have names derived from the CPU resolving
> type name to ensure unique QOM naming.
>
> IOW, TYPE_ACCEL_CPU can be given a fixed name while keeping
> the same hierarchy structure:
>
> object
> +- accel-cpu
> +- kvm-accel-x86_64-cpu
> +- tcg-accel-x86_64-cpu
> +- mshv-accel-x86_64-cpu
> +- tcg-accel-riscv-cpu
>
> Signed-off-by: Daniel P. Berrangé <[email protected]>
> ---
> accel/accel-common.c | 3 +--
> include/accel/accel-cpu-target.h | 3 +--
> include/accel/accel-cpu.h | 2 ++
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
Reviewed-by: Pierrick Bouvier <[email protected]>