From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: blauwirbel@gmail.com, imammedo@redhat.com, ehabkost@redhat.com,
"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH qom-cpu 1/4] target-i386: Inline -cpu host check into cpu_x86_register()
Date: Sun, 9 Dec 2012 20:45:50 +0100 [thread overview]
Message-ID: <1355082353-322-2-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1355082353-322-1-git-send-email-afaerber@suse.de>
Simplifies the upcoming cleanup of cpu_x86_find_by_name().
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
target-i386/cpu.c | 12 +++++++-----
1 Datei geändert, 7 Zeilen hinzugefügt(+), 5 Zeilen entfernt(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 7be3ad8..a46faa2 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1217,9 +1217,7 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *name)
break;
}
}
- if (kvm_enabled() && name && strcmp(name, "host") == 0) {
- kvm_cpu_fill_host(x86_cpu_def);
- } else if (!def) {
+ if (!def) {
return -1;
} else {
memcpy(x86_cpu_def, def, sizeof(*def));
@@ -1505,8 +1503,12 @@ int cpu_x86_register(X86CPU *cpu, const char *cpu_model)
name = model_pieces[0];
features = model_pieces[1];
- if (cpu_x86_find_by_name(def, name) < 0) {
- goto error;
+ if (kvm_enabled() && strcmp(name, "host") == 0) {
+ kvm_cpu_fill_host(def);
+ } else {
+ if (cpu_x86_find_by_name(def, name) < 0) {
+ goto error;
+ }
}
if (cpu_x86_parse_featurestr(def, features) < 0) {
--
1.7.10.4
next prev parent reply other threads:[~2012-12-09 19:46 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-04 18:32 [Qemu-devel] [PATCH] finally kill cpudef config section support Eduardo Habkost
2012-12-04 18:41 ` Andreas Färber
2012-12-04 18:53 ` Eduardo Habkost
2012-12-08 17:54 ` Blue Swirl
2012-12-08 18:02 ` Andreas Färber
2012-12-08 20:00 ` Blue Swirl
2012-12-09 19:13 ` Andreas Färber
2012-12-09 20:46 ` Blue Swirl
2012-12-10 0:13 ` Andreas Färber
2012-12-12 13:03 ` Eduardo Habkost
2012-12-10 18:03 ` Eduardo Habkost
2012-12-09 19:45 ` [Qemu-devel] [PATCH qom-cpu 0/4] target-i386: Finish killing cpudef support Andreas Färber
2012-12-09 19:45 ` Andreas Färber [this message]
2012-12-10 12:46 ` [Qemu-devel] [PATCH qom-cpu 1/4] target-i386: Inline -cpu host check into cpu_x86_register() Eduardo Habkost
2012-12-10 18:55 ` Igor Mammedov
2012-12-10 23:21 ` Andreas Färber
2012-12-10 23:33 ` Eduardo Habkost
2012-12-09 19:45 ` [Qemu-devel] [PATCH qom-cpu 2/4] target-i386: Drop redundant list of CPU definitions Andreas Färber
2012-12-10 18:22 ` Eduardo Habkost
2012-12-09 19:45 ` [Qemu-devel] [PATCH qom-cpu 3/4] Really finally kill cpudef config section support Andreas Färber
2012-12-10 18:09 ` Eduardo Habkost
2012-12-10 23:12 ` Andreas Färber
2012-12-10 23:53 ` Eduardo Habkost
2012-12-11 8:41 ` Wenchao Xia
2012-12-09 19:45 ` [Qemu-devel] [PATCH qom-cpu 4/4] MAINTAINERS: Include X86CPU in CPU maintenance area Andreas Färber
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=1355082353-322-2-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=blauwirbel@gmail.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).