target-i386: Inline APIC cpu_env property setting
authorAndreas Färber <afaerber@suse.de>
Wed, 10 Oct 2012 10:18:02 +0000 (12:18 +0200)
committerAndreas Färber <afaerber@suse.de>
Tue, 30 Oct 2012 21:38:37 +0000 (22:38 +0100)
This prepares for changing the variable type from void*.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
hw/apic_common.c
target-i386/cpu.c

index d68116d4904325374eee4c948d24754effc5d805..b13f23c9910696a647e5e31af7ba5db7d0de1e98 100644 (file)
@@ -368,7 +368,6 @@ static const VMStateDescription vmstate_apic_common = {
 
 static Property apic_properties_common[] = {
     DEFINE_PROP_UINT8("id", APICCommonState, id, -1),
-    DEFINE_PROP_PTR("cpu_env", APICCommonState, cpu_env),
     DEFINE_PROP_BIT("vapic", APICCommonState, vapic_control, VAPIC_ENABLE_BIT,
                     true),
     DEFINE_PROP_END_OF_LIST(),
index 18b8549a6f8fef24114aa2c54570a9f8939a45f8..c30cc799dea022399c829250ffa3e29d87a85852 100644 (file)
@@ -41,6 +41,7 @@
 #ifndef CONFIG_USER_ONLY
 #include "hw/xen.h"
 #include "hw/sysbus.h"
+#include "hw/apic_internal.h"
 #endif
 
 /* feature flags taken from "Intel Processor Identification and the CPUID
@@ -1892,6 +1893,7 @@ static void x86_cpu_apic_init(X86CPU *cpu, Error **errp)
 {
     static int apic_mapped;
     CPUX86State *env = &cpu->env;
+    APICCommonState *apic;
     const char *apic_type = "apic";
 
     if (kvm_irqchip_in_kernel()) {
@@ -1910,7 +1912,8 @@ static void x86_cpu_apic_init(X86CPU *cpu, Error **errp)
                               OBJECT(env->apic_state), NULL);
     qdev_prop_set_uint8(env->apic_state, "id", env->cpuid_apic_id);
     /* TODO: convert to link<> */
-    qdev_prop_set_ptr(env->apic_state, "cpu_env", env);
+    apic = APIC_COMMON(env->apic_state);
+    apic->cpu_env = env;
 
     if (qdev_init(env->apic_state)) {
         error_setg(errp, "APIC device '%s' could not be initialized",