[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH RFC 2/8] target-i386: cpu: move xcc->kvm_required chec
From: |
Igor Mammedov |
Subject: |
[Qemu-arm] [PATCH RFC 2/8] target-i386: cpu: move xcc->kvm_required check to reaize time |
Date: |
Wed, 1 Jun 2016 18:37:24 +0200 |
it will allow to drop custom cpu_x86_init() and use
cpu_generic_init() instead reducing cpu_x86_create()
to a simple 3-liner.
Signed-off-by: Igor Mammedov <address@hidden>
---
target-i386/cpu.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 6159a7f..c31afc7 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -2200,7 +2200,6 @@ static void x86_cpu_load_def(X86CPU *cpu,
X86CPUDefinition *def, Error **errp)
X86CPU *cpu_x86_create(const char *cpu_model, Error **errp)
{
X86CPU *cpu = NULL;
- X86CPUClass *xcc;
ObjectClass *oc;
gchar **model_pieces;
char *name, *features;
@@ -2219,12 +2218,6 @@ X86CPU *cpu_x86_create(const char *cpu_model, Error
**errp)
error_setg(&error, "Unable to find CPU definition: %s", name);
goto out;
}
- xcc = X86_CPU_CLASS(oc);
-
- if (xcc->kvm_required && !kvm_enabled()) {
- error_setg(&error, "CPU model '%s' requires KVM", name);
- goto out;
- }
cpu = X86_CPU(object_new(object_class_get_name(oc)));
@@ -2901,6 +2894,13 @@ static void x86_cpu_realizefn(DeviceState *dev, Error
**errp)
static bool ht_warned;
FeatureWord w;
+ if (xcc->kvm_required && !kvm_enabled()) {
+ char *name = g_strdup(object_get_typename(OBJECT(dev)));
+ *strstr(name, X86_CPU_TYPE_SUFFIX) = 0;
+ error_setg(&local_err, "CPU model '%s' requires KVM", name);
+ goto out;
+ }
+
if (cpu->apic_id < 0) {
error_setg(errp, "apic-id property was not initialized properly");
return;
--
1.8.3.1
- Re: [Qemu-arm] [PATCH RFC 4/8] target-i386: cpu: consolidate calls of object_property_parse() in x86_cpu_parse_featurestr, (continued)
- Re: [Qemu-arm] [PATCH RFC 4/8] target-i386: cpu: consolidate calls of object_property_parse() in x86_cpu_parse_featurestr, Eduardo Habkost, 2016/06/02
- Re: [Qemu-arm] [PATCH RFC 4/8] target-i386: cpu: consolidate calls of object_property_parse() in x86_cpu_parse_featurestr, Eduardo Habkost, 2016/06/02
- Re: [Qemu-arm] [PATCH RFC 4/8] target-i386: cpu: consolidate calls of object_property_parse() in x86_cpu_parse_featurestr, Peter Krempa, 2016/06/02
- Re: [Qemu-arm] [PATCH RFC 4/8] target-i386: cpu: consolidate calls of object_property_parse() in x86_cpu_parse_featurestr, Igor Mammedov, 2016/06/02
- Re: [Qemu-arm] [PATCH RFC 4/8] target-i386: cpu: consolidate calls of object_property_parse() in x86_cpu_parse_featurestr, Peter Krempa, 2016/06/03
- Re: [Qemu-arm] [Qemu-devel] [PATCH RFC 4/8] target-i386: cpu: consolidate calls of object_property_parse() in x86_cpu_parse_featurestr, Igor Mammedov, 2016/06/03
- Re: [Qemu-arm] [Qemu-devel] [PATCH RFC 4/8] target-i386: cpu: consolidate calls of object_property_parse() in x86_cpu_parse_featurestr, Eduardo Habkost, 2016/06/03
- Re: [Qemu-arm] [Qemu-devel] [PATCH RFC 4/8] target-i386: cpu: consolidate calls of object_property_parse() in x86_cpu_parse_featurestr, Igor Mammedov, 2016/06/02
- [Qemu-arm] [PATCH] target-i386: Remove xlevel & hv-spinlocks option fixups, Eduardo Habkost, 2016/06/02
- Re: [Qemu-arm] [libvirt] [PATCH] target-i386: Remove xlevel & hv-spinlocks option fixups, Eric Blake, 2016/06/02
[Qemu-arm] [PATCH RFC 2/8] target-i386: cpu: move xcc->kvm_required check to reaize time,
Igor Mammedov <=
[Qemu-arm] [PATCH RFC 5/8] target-sparc: cpu: use sparc_cpu_parse_features() directly, Igor Mammedov, 2016/06/01
[Qemu-arm] [PATCH RFC 6/8] cpu: use CPUClass->parse_features() as convertor to global properties, Igor Mammedov, 2016/06/01
[Qemu-arm] [PATCH RFC 7/8] arm: virt: parse cpu_model only once, Igor Mammedov, 2016/06/01
[Qemu-arm] [PATCH RFC 8/8] pc: parse cpu features only once, Igor Mammedov, 2016/06/01
Re: [Qemu-arm] [PATCH RFC 0/8] cpus: make "-cpu cpux, features" global properties, Peter Maydell, 2016/06/01