From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCvQr-000878-HV for qemu-devel@nongnu.org; Tue, 14 Jun 2016 16:59:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCvQp-0007i7-MB for qemu-devel@nongnu.org; Tue, 14 Jun 2016 16:59:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49109) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCvQp-0007i0-Fe for qemu-devel@nongnu.org; Tue, 14 Jun 2016 16:59:31 -0400 From: Eduardo Habkost Date: Tue, 14 Jun 2016 17:59:06 -0300 Message-Id: <1465937948-548-9-git-send-email-ehabkost@redhat.com> In-Reply-To: <1465937948-548-1-git-send-email-ehabkost@redhat.com> References: <1465937948-548-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PULL 08/10] target-i386: Use cpu_generic_init() in cpu_x86_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , qemu-devel@nongnu.org, Richard Henderson , Paolo Bonzini , Igor Mammedov From: Igor Mammedov 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 --- 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 7db632b..329d85c 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -2226,25 +2226,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) -- 2.5.5