On Tue, 7 Jan 2025 at 11:14, Paolo Bonzini <pbonz...@redhat.com> wrote: > > The "concrete_class" field of InterfaceClass is only ever written, and as far > as I can tell is not particularly useful when debugging either; remove it. > > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
I think the reason to have the field would be if we supported "given a pointer to an interface class, get the concrete class"; e.g. supposing i have a ResettableClass *rc it would be nice to be able to do DeviceClass *dc = DEVICE_CLASS(rc); (asserting if your rc isn't actually one provided by a DeviceClass, obviously). This doesn't currently work because we don't have the code to actually do this, but apparently GObject's object model does support this. See this thread from a few years back: https://lore.kernel.org/qemu-devel/CAFEAcA8Q3XZrdLJhJ4Uj1CX6J04ON9f91p=nujxxa+cnefd...@mail.gmail.com/ But we've lived without this forever (and the thing I wanted it for back then I ended up not needing), so it seems fine to remove the field now; easy enough to put it back in future if somebody does decide to implement cast-to-concrete-class. Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> thanks -- PMM