On Mon, Feb 28, 2022 at 04:44:47PM +0000, Peter Maydell wrote: > On Mon, 28 Feb 2022 at 16:32, Alex Bennée <[email protected]> wrote: > > Stefan Hajnoczi <[email protected]> writes: > > > On Fri, Feb 25, 2022 at 05:32:43PM +0000, Alex Bennée wrote: > > >> (aside: this continues my QOM confusion about when things should be in a > > >> class or instance init, up until this point I hadn't needed it in my > > >> stub). > > > > > > Class init is a one-time per-class initializer function. It is mostly > > > used for setting up callbacks/overridden methods from the base class. > > > > > > Instance init is like an object constructor in object-oriented > > > programming. > > > > I phrased my statement poorly. What I meant to say is I sometimes find > > QEMUs approach to using class over instance initialisation inconsistent. > > I think I understand the "policy" as use class init until there is a > > case where you can't (e.g. having individual control of each instance of > > a device). > > Do you have examples of inconsistency? (I'm sure there are some, > we're inconsistent about almost everything...)
Phew, at least we're inconsistent about being inconsistent. If we were inconsistent about absolutely everything that just wouldn't do! Stefan
signature.asc
Description: PGP signature
