On Fri, 16 Oct 2026 at 15:26, Daniel P. Berrangé <[email protected]> wrote: > > On Fri, Oct 16, 2026 at 03:09:55PM +0100, Peter Maydell wrote: > > On Fri, 16 Oct 2026 at 11:53, Daniel P. Berrangé <[email protected]> > > wrote: > > > but many (most) of qdev impls don't use the relatively new > > > OBJECT_DEFINE_TYPE macros. They would have to instead explicitly > > > reference the parent type name: > > > > > > DeviceClass *dc = DEVICE_CLASS(object_class_by_name(TYPE_PL050)); > > > dc->realize(dev, errp); > > > > I still don't understand why we need to get the parent's > > object class by name here, rather than saying "give me > > the parent class of this object's class". > > No matter which realize() method we are executing in, the "dev" > object parameter will always be an instance of the leaf class "C" > and thus the result of object_class_get_parent(objct_get_class(dev)) > will always be B. That is only correct if executgnig "C"s realize > method, so breaks if we need to chain up realize many times.
Ah, thanks -- I finally get it. -- PMM
