]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
xen: Simplify halting of first CPU
authorAndreas Färber <afaerber@suse.de>
Mon, 17 Dec 2012 18:39:30 +0000 (19:39 +0100)
committerAndreas Färber <afaerber@suse.de>
Tue, 15 Jan 2013 03:09:14 +0000 (04:09 +0100)
Use the global first_cpu variable to halt the CPU rather than using a
local first_cpu initialized from qemu_get_cpu(0).

This will allow to change qemu_get_cpu() return type to CPUState
despite use of the CPU_COMMON halted field in the reset handler.

Signed-off-by: Andreas Färber <afaerber@suse.de>
xen-all.c

index 19bcfd1510ebfe8e6419fce7e4258e009dac0539..110f958a5353a5c5d9013b76e122e8c512b5f072 100644 (file)
--- a/xen-all.c
+++ b/xen-all.c
@@ -585,9 +585,7 @@ static void xen_reset_vcpu(void *opaque)
 
 void xen_vcpu_init(void)
 {
-    CPUArchState *first_cpu;
-
-    if ((first_cpu = qemu_get_cpu(0))) {
+    if (first_cpu != NULL) {
         qemu_register_reset(xen_reset_vcpu, first_cpu);
         xen_reset_vcpu(first_cpu);
     }