mirror of https://github.com/proxmox/mirror_qemu
target-i386: Call x86_cpu_load_def() earlier
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 <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>master
parent
c080e30ec8
commit
285f025d2c
|
@ -1893,6 +1893,11 @@ X86CPU *cpu_x86_create(const char *cpu_model, DeviceState *icc_bridge,
|
||||||
features = model_pieces[1];
|
features = model_pieces[1];
|
||||||
|
|
||||||
cpu = X86_CPU(object_new(TYPE_X86_CPU));
|
cpu = X86_CPU(object_new(TYPE_X86_CPU));
|
||||||
|
x86_cpu_load_def(cpu, name, &error);
|
||||||
|
if (error) {
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_USER_ONLY
|
#ifndef CONFIG_USER_ONLY
|
||||||
if (icc_bridge == NULL) {
|
if (icc_bridge == NULL) {
|
||||||
error_setg(&error, "Invalid icc-bridge value");
|
error_setg(&error, "Invalid icc-bridge value");
|
||||||
|
@ -1902,11 +1907,6 @@ X86CPU *cpu_x86_create(const char *cpu_model, DeviceState *icc_bridge,
|
||||||
object_unref(OBJECT(cpu));
|
object_unref(OBJECT(cpu));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
x86_cpu_load_def(cpu, name, &error);
|
|
||||||
if (error) {
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Emulate per-model subclasses for global properties */
|
/* Emulate per-model subclasses for global properties */
|
||||||
typename = g_strdup_printf("%s-" TYPE_X86_CPU, name);
|
typename = g_strdup_printf("%s-" TYPE_X86_CPU, name);
|
||||||
qdev_prop_set_globals_for_type(DEVICE(cpu), typename, &error);
|
qdev_prop_set_globals_for_type(DEVICE(cpu), typename, &error);
|
||||||
|
|
Loading…
Reference in New Issue