From: "Graf (AWS), Alexander" <graf@amazon.de>
To: Markus Armbruster <armbru@redhat.com>
Cc: "BALATON Zoltan" <balaton@eik.bme.hu>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"Aditya Gupta" <adityag@linux.ibm.com>,
"Alexandre Iooss" <erdnaxe@crans.org>,
"Alexey Kardashevskiy" <aik@ozlabs.ru>,
"Alistair Francis" <Alistair.Francis@wdc.com>,
"Alistair Francis" <alistair@alistair23.me>,
"Antony Pavlov" <antonynpavlov@gmail.com>,
"Artyom Tarasenko" <atar4qemu@gmail.com>,
"Bernhard Beschow" <shentey@gmail.com>,
"Bibo Mao" <maobibo@loongson.cn>,
"Brian Cain" <brian.cain@oss.qualcomm.com>,
"Chao Liu" <chao.liu@processmission.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Clément Chigot" <chigot@adacore.com>,
"Cédric Le Goater" <clg@kaod.org>,
"Dorjoy Chowdhury" <dorjoychy111@gmail.com>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
"Eric Farman" <farman@linux.ibm.com>,
"Farhan Ali" <alifm@linux.ibm.com>,
"Felipe Balbi" <balbi@kernel.org>,
"Francisco Iglesias" <francisco.iglesias@amd.com>,
"Frederic Konrad" <konrad.frederic@yahoo.fr>,
"Gaurav Sharma" <gaurav.sharma_7@nxp.com>,
"Gautam Gala" <ggala@linux.ibm.com>,
"Glenn Miles" <milesg@linux.ibm.com>,
"Halil Pasic" <pasic@linux.ibm.com>,
"Hao Wu" <wuhaotsh@google.com>,
"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
"Helge Deller" <deller@gmx.de>,
"Hendrik Brueckner" <brueckner@linux.ibm.com>,
"Hervé Poussineau" <hpoussin@reactos.org>,
"Huacai Chen" <chenhuacai@kernel.org>,
"Jan Kiszka" <jan.kiszka@web.de>,
"Jared Rossi" <jrossi@linux.ibm.com>,
"Joel Stanley" <joel@jms.id.au>,
"Laurent Vivier" <laurent@vivier.eu>,
"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Matthew Rosato" <mjrosato@linux.ibm.com>,
"Max Filippov" <jcmvbkbc@gmail.com>,
"Michael Rolnik" <mrolnik@gmail.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Niek Linnenbank" <nieklinnenbank@gmail.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@mailo.com>,
"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
"Ran Wang" <wangran@bosc.ac.cn>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Sai Pavan Boddu" <sai.pavan.boddu@amd.com>,
"Samuel Tardieu" <sam@rfc1149.net>,
"Sergio Lopez" <slp@redhat.com>, "Song Gao" <17746591750@163.com>,
"Stafford Horne" <shorne@gmail.com>,
"Subbaraya Sundeep" <sundeep.lkml@gmail.com>,
"Thomas Huth" <th.huth+qemu@posteo.eu>,
"Tyrone Ting" <kfting@nuvoton.com>,
"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
"qemu-riscv@nongnu.org" <qemu-riscv@nongnu.org>,
"qemu-s390x@nongnu.org" <qemu-s390x@nongnu.org>
Subject: Re: Call to clean up QOM onboard devices lacking a parent
Date: Fri, 10 Jul 2026 07:38:07 +0000 [thread overview]
Message-ID: <b5176cd7-385f-4e09-a2da-4f697de63bf0@amazon.de> (raw)
In-Reply-To: <87h5m7xsxi.fsf@pond.sub.org>
On 10.07.26 08:25, Markus Armbruster wrote:
> "Graf (AWS), Alexander" <graf@amazon.de> writes:
>
>> Hi Markus,
> [...]
>
>> I'm also curious on whether there is anything that makes sysbus device
>> spawns both easy (as they are today) and at the same time fully QOM
>> parent compliant.
>>
>> I had a quick look at the vmapple machine and most of the offenders are
>> sysbus devices I spawn via qdev_new(). Would you want all of these to
>> get their parent declared via object_property_add_child()? If that's the
>> case, why don't we introduce a new qdev_new_child() which does that
>> automatically?
> We do have such convenience functions at the QOM layer: object_new() and
> object_property_add_child() etc., are basic building blocks, and
> object_new_with_props() etc. combine them in useful ways.
>
> We don't have such convenience functions at the qdev layer. Can't see
> why we couldn't add them.
>
> Number of orphaned device types I see by bus_type:
>
> 69 busless
> 15 ISA
> 33 PCI
> 11 SSI
> 209 System
> 2 apple-desktop-bus
> 23 i2c-bus
> 2 sd-bus
> 1 spapr-vio-bus
> 2 usb-bus
>
> Again, not a problem with the device types, but the code that creates
> and realizes them.
>
> Bus types commonly provide a layer above qdev for that. Perhaps these
> layers could also use convenience functions to more easily deal with
> setting the QOM parent.
I think the crux of the problem is that we ended up inheriting creation
APIs that didn't necessarily express a clear parent/child relationship,
so we end up orphaning these type of objects in the QOM tree. So the
*real* answer IMHO is to rebuild all these APIs into something that
enforces that. This way we also won't have new offenders sneaking in.
I won't be able to spend the weeks it requires to do this by hand, but I
can have a stab at it with AI - which is likely much more reliable at
getting this done correctly than me too :). I can post it as RFC and
then we decide whether we want to take it or leave it.
Alex
next prev parent reply other threads:[~2026-07-10 7:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 14:59 Call to clean up QOM onboard devices lacking a parent Markus Armbruster
2026-07-09 16:02 ` BALATON Zoltan
2026-07-09 16:45 ` Graf (AWS), Alexander
2026-07-10 6:25 ` Markus Armbruster
2026-07-10 7:38 ` Graf (AWS), Alexander [this message]
2026-07-10 8:03 ` Markus Armbruster
2026-07-10 7:05 ` Markus Armbruster
2026-07-10 12:13 ` BALATON Zoltan
2026-07-13 6:43 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b5176cd7-385f-4e09-a2da-4f697de63bf0@amazon.de \
--to=graf@amazon.de \
--cc=17746591750@163.com \
--cc=Alistair.Francis@wdc.com \
--cc=adityag@linux.ibm.com \
--cc=aik@ozlabs.ru \
--cc=alifm@linux.ibm.com \
--cc=alistair@alistair23.me \
--cc=antonynpavlov@gmail.com \
--cc=armbru@redhat.com \
--cc=atar4qemu@gmail.com \
--cc=balaton@eik.bme.hu \
--cc=balbi@kernel.org \
--cc=borntraeger@linux.ibm.com \
--cc=brian.cain@oss.qualcomm.com \
--cc=brueckner@linux.ibm.com \
--cc=chao.liu@processmission.com \
--cc=chenhuacai@kernel.org \
--cc=chigot@adacore.com \
--cc=clg@kaod.org \
--cc=deller@gmx.de \
--cc=dorjoychy111@gmail.com \
--cc=edgar.iglesias@gmail.com \
--cc=erdnaxe@crans.org \
--cc=farman@linux.ibm.com \
--cc=francisco.iglesias@amd.com \
--cc=gaurav.sharma_7@nxp.com \
--cc=ggala@linux.ibm.com \
--cc=harshpb@linux.ibm.com \
--cc=hpoussin@reactos.org \
--cc=jan.kiszka@web.de \
--cc=jcmvbkbc@gmail.com \
--cc=joel@jms.id.au \
--cc=jrossi@linux.ibm.com \
--cc=kfting@nuvoton.com \
--cc=konrad.frederic@yahoo.fr \
--cc=laurent@vivier.eu \
--cc=manos.pitsidianakis@linaro.org \
--cc=maobibo@loongson.cn \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=milesg@linux.ibm.com \
--cc=mjrosato@linux.ibm.com \
--cc=mrolnik@gmail.com \
--cc=mst@redhat.com \
--cc=nieklinnenbank@gmail.com \
--cc=npiggin@gmail.com \
--cc=palmer@dabbelt.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@mailo.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sai.pavan.boddu@amd.com \
--cc=sam@rfc1149.net \
--cc=shentey@gmail.com \
--cc=shorne@gmail.com \
--cc=slp@redhat.com \
--cc=sundeep.lkml@gmail.com \
--cc=th.huth+qemu@posteo.eu \
--cc=wangran@bosc.ac.cn \
--cc=wuhaotsh@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.