Am 06.02.2012 20:24, schrieb Anthony Liguori: > On 02/02/2012 08:59 PM, Andreas Färber wrote: >> +/** >> + * cpu_common_reset: >> + * @cpu: The CPU whose common state is to be reset. >> + * >> + * To be used by derived classes. >> + */ >> +void cpu_common_reset(CPU *cpu); > > Make this static, initialize reset = cpu_common_reset in > cpu_class_initfn, then in the derived class initfn, save the pointer to > the parent reset function so it can be called later.
I don't see how that would work. To initialize, e.g., the ARMCPUClass with additional class fields I'm overriding the .class_init. So in order to let CPUClass initialize the reset callback to its static one I'd need to make CPU's class_init function non-static so that I can call that from my derived class' class_init function, no? Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg