We don't need to pass the model string by parameter,
since it ough to be part of the CPUState anyway at
the call time. Also, don't declare it as static,
so kvm can call it in the future.

Signed-off-by: Glauber Costa <[email protected]>
---
 target-i386/cpu.h    |    2 ++
 target-i386/helper.c |    5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index ce9b3fe..5235919 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -643,6 +643,8 @@ typedef struct CPUX86State {
 } CPUX86State;
 
 CPUX86State *cpu_x86_init(const char *cpu_model);
+int cpu_x86_register (CPUX86State *env);
+
 int cpu_x86_exec(CPUX86State *s);
 void cpu_x86_close(CPUX86State *s);
 void x86_cpu_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt,
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 7d3321a..1389a0a 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -368,9 +368,10 @@ void x86_cpu_list (FILE *f, int (*cpu_fprintf)(FILE *f, 
const char *fmt, ...))
         (*cpu_fprintf)(f, "x86 %16s\n", x86_defs[i].name);
 }
 
-static int cpu_x86_register (CPUX86State *env, const char *cpu_model)
+int cpu_x86_register (CPUX86State *env)
 {
     x86_def_t def1, *def = &def1;
+    const char *cpu_model = env->cpu_model_str;
 
     if (cpu_x86_find_by_name(def, cpu_model) < 0)
         return -1;
@@ -1626,7 +1627,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
             cpu_set_debug_excp_handler(breakpoint_handler);
 #endif
     }
-    if (cpu_x86_register(env, cpu_model) < 0) {
+    if (cpu_x86_register(env) < 0) {
         cpu_x86_close(env);
         return NULL;
     }
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to