Re: [PATCH 2/2] qom: Manage references to embedded child objects
Peter Maydell <[email protected]> Mon, 15 Jun 2026 09:31:36 +0100
| Newsgroups | org.nongnu.qemu-rust,org.nongnu.qemu-devel |
|---|---|
| Message-ID | <CAFEAcA_nFiQyXyCuvwUrJ+-0fhmGoMfswK-+KsZbxahAGatTXw@mail.gmail.com> |
On Mon, 15 Jun 2026 at 09:13, Daniel P. Berrang=C3=A9 <[email protected]>= wrote: > Do we know how many examples we have of embedding objects inside > another ? It is an extremely common pattern for device and SoC model implementations; we've been recommending it for years. > I would much prefer if we forbid the embedding of objects. It is > horrible design practice to have some QOM objects which can be > freed via reference count and some which cannot. That would be a very large amount of code to rewrite to the new paradigm. I don't object inherently ("you have pointers to your child objects" works better when they might be implemented in Rust and might play better with being able to create machines and wire them up on the command line); I'm just noting how much work it would be if you wanted to make embedding forbidden. thanks -- PMM