Il gio 30 ott 2025, 12:01 BALATON Zoltan <[email protected]> ha scritto:
> > Not sure what's different between > > > > MemoryRegion foo_mr; > > > > in the struct, versus > > > > mr = g_new(MemoryRegion, 1); > > > > in the realize function. It's one line either way. > > Please read back in thread. An example here: > https://lists.nongnu.org/archive/html/qemu-ppc/2025-10/msg00785.html > from this series > https://patchew.org/QEMU/[email protected]/ I did read it of course. There's four people in this thread telling you not to do something. Just stop arguing please. Paolo > >> - Documentation says it should work this way QOM managing memory > regions so > >> it was meant to be that way. I'd rather fix code than documentation as > I > >> think if it just works that's easier than loosing that convenience.No, > >> that's *your* reading of the documentation, and it's based on the > > incorrect assumption that destruction implies freeing the memory. > Akihiko > > explained that > > ( > https://lore.kernel.org/qemu-devel/[email protected]/ > ). > > > > The memory region documentation does not exist in a void, the difference > > between QOM object_initialize() and object_new() exists independent of > that > > documentation. It may be worth improving the QOM documentation on the > object > > lifecycle; that could be. > > I'll try to also clarify documentation but IMO the fix is not dropping > this intended feature but fixing and using it where helps. > > Regards, > BALATON Zoltan > >
