aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-03-02 14:25:48 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-03-02 14:25:48 +0000
commitb8a173b25c887a606681fc35a46702c164d5b2d0 (patch)
tree50860f62eacc4e60cc5f0a504d815218f8322676 /linux-user
parent5de090464f1ec5360c4f30faa01d8a9f8826cd58 (diff)
parentde13197a38cf45c990802661a057f64a05426cbc (diff)
Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging
* remotes/ehabkost/tags/x86-pull-request: target-i386: Move APIC ID compatibility code to pc.c target-i386: Require APIC ID to be explicitly set before CPU realize target-i386: Set APIC ID using cpu_index on CONFIG_USER linux-user: Check for cpu_init() errors target-i386: Move CPUX86State.cpuid_apic_id to X86CPU.apic_id target-i386: Simplify error handling on cpu_x86_init_user() target-i386: Eliminate cpu_init() function target-i386: Rename cpu_x86_init() to cpu_x86_init_user() target-i386: Move topology.h to include/hw/i386 target-i386: Eliminate unnecessary get_cpuid_vendor() function target-i386: Simplify listflags() function Conflicts: target-i386/cpu.c Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index d92702a734..111c1ffafc 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3453,10 +3453,17 @@ CPUArchState *cpu_copy(CPUArchState *env)
{
CPUState *cpu = ENV_GET_CPU(env);
CPUArchState *new_env = cpu_init(cpu_model);
- CPUState *new_cpu = ENV_GET_CPU(new_env);
+ CPUState *new_cpu;
CPUBreakpoint *bp;
CPUWatchpoint *wp;
+ if (!new_env) {
+ fprintf(stderr, "cpu_copy: Failed to create new CPU\n");
+ exit(1);
+ }
+
+ new_cpu = ENV_GET_CPU(new_env);
+
/* Reset non arch specific state */
cpu_reset(new_cpu);