From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Habkost Subject: [uq/master PATCH 5/7] target-i386: Call x86_cpu_load_def() earlier Date: Thu, 30 Jan 2014 17:48:57 -0200 Message-ID: <1391111339-6958-6-git-send-email-ehabkost@redhat.com> References: <1391111339-6958-1-git-send-email-ehabkost@redhat.com> Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Paolo Bonzini , Igor Mammedov , kvm@vger.kernel.org, libvir-list@redhat.com, Jiri Denemark To: qemu-devel@nongnu.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36089 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753445AbaA3TtP (ORCPT ); Thu, 30 Jan 2014 14:49:15 -0500 In-Reply-To: <1391111339-6958-1-git-send-email-ehabkost@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 --- 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 58b4c71..5c13ed6 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1893,6 +1893,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"); @@ -1902,11 +1907,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.4.2