From: Glauber Costa <glommer@redhat.com>
To: qemu-devel@nongnu.org
Cc: Ian.Jackson@eu.citrix.com, avi@redhat.com, kvm@vger.kernel.org,
stefano.stabellini@eu.citrix.com
Subject: [Qemu-devel] [PATCH 1/2] simplify cpu_x86_register
Date: Tue, 30 Dec 2008 09:52:05 -0500 [thread overview]
Message-ID: <1230648726-17163-2-git-send-email-glommer@redhat.com> (raw)
In-Reply-To: <1230648726-17163-1-git-send-email-glommer@redhat.com>
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 <glommer@redhat.com>
---
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
next prev parent reply other threads:[~2008-12-30 14:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-30 14:52 [Qemu-devel] [PATCH 0/2] Hook into vcpu creation Glauber Costa
2008-12-30 14:52 ` Glauber Costa [this message]
2008-12-30 14:52 ` [Qemu-devel] [PATCH 2/2] hook " Glauber Costa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1230648726-17163-2-git-send-email-glommer@redhat.com \
--to=glommer@redhat.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=stefano.stabellini@eu.citrix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).