On Tue, 09 Apr 2013 13:20:27 +0200 Paolo Bonzini <pbonz...@redhat.com> wrote:
> Il 08/04/2013 22:13, Eduardo Habkost ha scritto: > > So you are initializing a field of CPUClass struct inside a CPU object > > initialization function. And that's a function that is not even > > converted to QOM yet, and buried inside a non-trivial function call tree > > (hence easy to be called at the wrong time if one day we reorder the > > initialization steps). > > > > Can't we do this on class_init(), where it belongs? If we need different > > implementations for softmmu/user, we can add a stub for *-user. > > Yes, please add a stub for the new function and override it in cpus.c. Ok, I'll revert it to a way as it was in RFC http://lists.gnu.org/archive/html/qemu-devel/2013-03/msg03774.html minus crept in cpu_synchronize_post_init() line. There is no much use in introducing resume method when there are only one implementation and stub. > > > I think even an explicit #ifdef inside resume_vcpu() would be > > preferable to this. > > Using an #ifdef basically means putting it in exec.c. I'm not sure > about that, it seems to fit more in cpus.c. > > Paolo >