From 49a67a8a1077ecd289b01ca7769e7b3040c99ff3 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Mon, 1 Aug 2016 08:11:26 +0200 Subject: [PATCH 26/99] target-i386: Use cpu_generic_init() in cpu_x86_init() RH-Author: Igor Mammedov Message-id: <1470039143-24450-22-git-send-email-imammedo@redhat.com> Patchwork-id: 71637 O-Subject: [RHEV-7.3 qemu-kvm-rhev PATCH 21/78] target-i386: Use cpu_generic_init() in cpu_x86_init() Bugzilla: 1087672 RH-Acked-by: Marcel Apfelbaum RH-Acked-by: David Gibson RH-Acked-by: Eduardo Habkost Now cpu_x86_init() does nothing more or less than duplicating cpu_generic_init() logic. So simplify it by using cpu_generic_init(). Signed-off-by: Igor Mammedov Reviewed-by: Eduardo Habkost Signed-off-by: Eduardo Habkost (cherry picked from commit a57d0163e74a7f486203ef1f8ff1cb0218453457) Signed-off-by: Miroslav Rezanina --- target-i386/cpu.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 1e3ae19..0732afe 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -2247,25 +2247,7 @@ out: X86CPU *cpu_x86_init(const char *cpu_model) { - Error *error = NULL; - X86CPU *cpu; - - cpu = cpu_x86_create(cpu_model, &error); - if (error) { - goto out; - } - - object_property_set_bool(OBJECT(cpu), true, "realized", &error); - -out: - if (error) { - error_report_err(error); - if (cpu != NULL) { - object_unref(OBJECT(cpu)); - cpu = NULL; - } - } - return cpu; + return X86_CPU(cpu_generic_init(TYPE_X86_CPU, cpu_model)); } static void x86_cpu_cpudef_class_init(ObjectClass *oc, void *data) -- 1.8.3.1