2016-09-29 11:53-0300, Eduardo Habkost: > On Thu, Sep 29, 2016 at 01:23:23PM +0200, Radim Krčmář wrote: >> Every configuration has only up to one APIC class and we'll be extending >> the class with a function that can be called without an instanced >> object, so a direct access to the class is convenient. >> >> Signed-off-by: Radim Krčmář <rkrc...@redhat.com> >> --- >> v2: assert() instead of error_report() and exit() [Peter] >> --- >> diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c >> @@ -296,6 +297,13 @@ static int apic_load_old(QEMUFile *f, void *opaque, int >> version_id) >> >> static const VMStateDescription vmstate_apic_common; >> >> +APICCommonClass *apic_class; >> + >> +APICCommonClass *apic_get_class(void) >> +{ >> + return apic_class; >> +} >> + > > This will break in case we need to look at the APIC class before > realizing the CPUs for any reason. Instead of adding a global > variable, what about moving the class name logic that's already > inside x86_cpu_apic_create() to the apic_get_class() function? > Then x86_cpu_apic_create() can simply call apic_get_class() too.
Sure, it'll be nicer, thanks. ia64 seems dead, so no issues with making the code x86 specific.