]> git.proxmox.com Git - qemu.git/blobdiff - xen-all.c
extract/unify the constant 0xfee00000 as APIC_DEFAULT_ADDRESS
[qemu.git] / xen-all.c
index 50edaecbf17cc0fb8227623898c8c5dc60a0e48d..8c05843faf0f535a8c3bfdd04bab3e95e1eaf93b 100644 (file)
--- a/xen-all.c
+++ b/xen-all.c
@@ -16,6 +16,7 @@
 #include "hw/xen_backend.h"
 #include "qmp-commands.h"
 
+#include "char/char.h"
 #include "qemu/range.h"
 #include "sysemu/xen-mapcache.h"
 #include "trace.h"
@@ -577,18 +578,18 @@ void qmp_xen_set_global_dirty_log(bool enable, Error **errp)
 
 static void xen_reset_vcpu(void *opaque)
 {
-    CPUArchState *env = opaque;
+    CPUState *cpu = opaque;
 
-    env->halted = 1;
+    cpu->halted = 1;
 }
 
 void xen_vcpu_init(void)
 {
-    CPUArchState *first_cpu;
+    if (first_cpu != NULL) {
+        CPUState *cpu = ENV_GET_CPU(first_cpu);
 
-    if ((first_cpu = qemu_get_cpu(0))) {
-        qemu_register_reset(xen_reset_vcpu, first_cpu);
-        xen_reset_vcpu(first_cpu);
+        qemu_register_reset(xen_reset_vcpu, cpu);
+        xen_reset_vcpu(cpu);
     }
     /* if rtc_clock is left to default (host_clock), disable it */
     if (rtc_clock == host_clock) {