On 10/14/26 10:58 PM, Markus Armbruster wrote:
Pierrick Bouvier <[email protected]> writes:

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'm curious... why would such a tie be undesirable?


We have a unique definition of target-info for all targets (https://gitlab.com/qemu-project/qemu/-/blob/master/target-info-def.c), which is simple and nice.

We could consider adding callbacks in this "generic" file only if they are implemented for all targets, but as we can see in this series, only a few targets implement this. It would be more boilerplate for the same result.

IMHO the two concerned functions (qmp_query_cpu*) look more like an exception than a proper rule. dump functions (posted in another series) are more related to cpu, and not to target themselves.

I would happy to revisit this if community prefers to go in a different direction though.

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.

Series
Acked-by: Markus Armbruster <[email protected]>


Regards,
Pierrick

Reply via email to