[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/7] target-i386: Call x86_cpu_load_def() earlier
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PATCH 5/7] target-i386: Call x86_cpu_load_def() earlier |
Date: |
Wed, 27 Nov 2013 17:34:07 -0200 |
As we will initialize the X86CPU fields on instance_init eventually,
move the code that initializes the X86CPU data based on the CPU model
name closer to the object_new() call.
Signed-off-by: Eduardo Habkost <address@hidden>
---
target-i386/cpu.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index f55caea..7f94a08 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1874,6 +1874,11 @@ X86CPU *cpu_x86_create(const char *cpu_model,
DeviceState *icc_bridge,
features = model_pieces[1];
cpu = X86_CPU(object_new(TYPE_X86_CPU));
+ x86_cpu_load_def(cpu, name, &error);
+ if (error) {
+ goto out;
+ }
+
#ifndef CONFIG_USER_ONLY
if (icc_bridge == NULL) {
error_setg(&error, "Invalid icc-bridge value");
@@ -1883,11 +1888,6 @@ X86CPU *cpu_x86_create(const char *cpu_model,
DeviceState *icc_bridge,
object_unref(OBJECT(cpu));
#endif
- x86_cpu_load_def(cpu, name, &error);
- if (error) {
- goto out;
- }
-
/* Emulate per-model subclasses for global properties */
typename = g_strdup_printf("%s-" TYPE_X86_CPU, name);
qdev_prop_set_globals_for_type(DEVICE(cpu), typename, &error);
--
1.8.3.1
- [Qemu-devel] [PATCH 0/7] x86 CPU subclasses, take 6, Eduardo Habkost, 2013/11/27
- [Qemu-devel] [PATCH 1/7] target-i386: Eliminate CONFIG_KVM #ifdefs, Eduardo Habkost, 2013/11/27
- [Qemu-devel] [PATCH 2/7] target-i386: Don't change x86_def_t struct on cpu_x86_register(), Eduardo Habkost, 2013/11/27
- [Qemu-devel] [PATCH 3/7] target-i386: Move KVM default-vendor hack to instance_init, Eduardo Habkost, 2013/11/27
- [Qemu-devel] [PATCH 4/7] target-i386: Rename cpu_x86_register() to x86_cpu_load_def(), Eduardo Habkost, 2013/11/27
- [Qemu-devel] [PATCH 5/7] target-i386: Call x86_cpu_load_def() earlier,
Eduardo Habkost <=
- [Qemu-devel] [RFC 7/7] target-i386: CPU model subclasses, Eduardo Habkost, 2013/11/27
- [Qemu-devel] [PATCH 6/7] target-i386: Rename x86_def_t to X86CPUDefinition, Eduardo Habkost, 2013/11/27