On 13.07.26 10:47, Daniel P. Berrangé wrote: > On Sat, Jul 11, 2026 at 10:34:54PM +0000, Alexander Graf wrote: >> We already have two ways of creating a QOM object with a parent set >> from birth: object_initialize_child() for objects embedded in the >> parent struct, and object_new_with_props() for heap-allocated objects >> that also want a list of string properties applied. What we do not >> have is the plain heap-allocated dual of object_initialize_child(): >> create the object, add it as a child<> of a given parent under a given >> name, and hand the reference to the parent. >> >> Board and composite-device code that heap-allocates children today >> therefore either open-codes object_new()+object_property_add_child() >> +object_unref(), or skips the parenting step entirely and lets >> device_set_realized() dump the object into /machine/unattached. >> >> Add object_new_child(parent, id, typename) as that missing primitive. >> The reference created by object_new() is transferred to the parent's >> child<> property, so on return the sole reference is held by @parent >> and the caller does not need to unref. Later patches build the qdev >> and per-bus creation helpers on top of this. >> >> Suggested-by: Markus Armbruster <[email protected]> >> Link: https://lore.kernel.org/qemu-devel/[email protected]/ >> Assisted-by: Kiro > QEMU does not currently permit contributions assisted by AI > coding tools. > > There is an open discussion about altering the policy but that > is not conclude with agreement yet.
Yup, which is why I called out exactly that in the cover letter too. Is is also the main reason that this patch set is RFC :). This set is a follow-up from a request by Markus to fix up the QOM parent hierarchy. I said that I (and probably nobody else in CC) had the dedicated time to perform that conversion by hand. And if we "distribute" the work, then IMHO it will just never get done. But I could easily leave an AI running on the side to get it done. This is so that we can see whether we want to 1/ change our AI stance or 2/ get inspired by the AI code and have someone else redo it by hand or 3/ leave it be and continue living with the QOM tech debt. Alex
