Handle cpu_model in copy_cpu(), by Kirill A. Shutemov.
[qemu] / exec.c
diff --git a/exec.c b/exec.c
index 046e967..3fe340a 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -1317,9 +1317,7 @@ void cpu_abort(CPUState *env, const char *fmt, ...)
 
 CPUState *cpu_copy(CPUState *env)
 {
-#if 0
-    /* XXX: broken, must be handled by each CPU */
-    CPUState *new_env = cpu_init();
+    CPUState *new_env = cpu_init(env->cpu_model_str);
     /* preserve chaining and index */
     CPUState *next_cpu = new_env->next_cpu;
     int cpu_index = new_env->cpu_index;
@@ -1327,9 +1325,6 @@ CPUState *cpu_copy(CPUState *env)
     new_env->next_cpu = next_cpu;
     new_env->cpu_index = cpu_index;
     return new_env;
-#else
-    return NULL;
-#endif
 }
 
 #if !defined(CONFIG_USER_ONLY)