From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlksX-0003YL-7j for qemu-devel@nongnu.org; Wed, 27 Nov 2013 14:34:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlksR-0006r9-6y for qemu-devel@nongnu.org; Wed, 27 Nov 2013 14:34:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlksQ-0006qd-W6 for qemu-devel@nongnu.org; Wed, 27 Nov 2013 14:34:23 -0500 From: Eduardo Habkost Date: Wed, 27 Nov 2013 17:34:07 -0200 Message-Id: <1385580849-10777-6-git-send-email-ehabkost@redhat.com> In-Reply-To: <1385580849-10777-1-git-send-email-ehabkost@redhat.com> References: <1385580849-10777-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 5/7] target-i386: Call x86_cpu_load_def() earlier List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= Cc: Igor Mammedov , Jiri Denemark 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 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