Following the discussion with Peter on my "cpus: Step toward removing global 'first_cpu'" series [*], we now pass the array of CPUs via property. Since we can not pass array of "link" properties, we pass the QOM path of each CPU as a QList(String).
Tagged as RFC to discuss the idea of using qdev_prop_set_array with qlist_append_str(object_get_canonical_path). Personally I find it super simple. Regards, Phil. [*] https://lore.kernel.org/qemu-devel/cafeaca9ft+qmyqslceljd7tefaos9jazmkywqe++s1amf7n...@mail.gmail.com/ Kevin Wolf (1): qdev: Add qdev_prop_set_array() Philippe Mathieu-Daudé (4): hw/ppc/e500: Declare CPU QOM types using DEFINE_TYPES() macro hw/ppc/e500: QOM-attach CPUs to the machine container hw/ppc/e500: Inline sysbus_create_simple(E500_SPIN) hw/ppc/e500: Pass array of CPUs as array of canonical QOM paths include/hw/qdev-properties.h | 3 ++ hw/core/qdev-properties.c | 21 +++++++++++ hw/ppc/e500.c | 11 +++++- hw/ppc/ppce500_spin.c | 69 ++++++++++++++++++++++++++---------- 4 files changed, 84 insertions(+), 20 deletions(-) -- 2.41.0