From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR54Q-0008ME-5V for qemu-devel@nongnu.org; Wed, 24 Oct 2012 13:48:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TR54K-0002rk-W0 for qemu-devel@nongnu.org; Wed, 24 Oct 2012 13:48:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR54K-0002qs-N0 for qemu-devel@nongnu.org; Wed, 24 Oct 2012 13:48:40 -0400 From: Eduardo Habkost Date: Wed, 24 Oct 2012 15:49:53 -0200 Message-Id: <1351101001-14589-20-git-send-email-ehabkost@redhat.com> In-Reply-To: <1351101001-14589-1-git-send-email-ehabkost@redhat.com> References: <1351101001-14589-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 19/27] cpu_x86_init: check for x86_cpu_realize() errors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Paolo Bonzini If x86_cpu_realize() set any errors, print an error message and return NULL. Signed-off-by: Eduardo Habkost --- target-i386/helper.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/target-i386/helper.c b/target-i386/helper.c index c5d42c5..1e5f61f 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -19,6 +19,7 @@ #include "cpu.h" #include "kvm.h" +#include "qemu-error.h" #ifndef CONFIG_USER_ONLY #include "sysemu.h" #include "monitor.h" @@ -1243,6 +1244,7 @@ X86CPU *cpu_x86_init(const char *cpu_model) { X86CPU *cpu; CPUX86State *env; + Error *err = NULL; cpu = X86_CPU(object_new(TYPE_X86_CPU)); env = &cpu->env; @@ -1253,7 +1255,11 @@ X86CPU *cpu_x86_init(const char *cpu_model) return NULL; } - x86_cpu_realize(OBJECT(cpu), NULL); + x86_cpu_realize(OBJECT(cpu), &err); + if (err) { + error_report("cpu_x86_init: %s\n", error_get_pretty(err)); + return NULL; + } return cpu; } -- 1.7.11.7