From patchwork Wed Jan 23 12:07:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 214916 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CF1BC2C007B for ; Wed, 23 Jan 2013 23:21:15 +1100 (EST) Received: from localhost ([::1]:59538 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Txz8S-0005vH-Ff for incoming@patchwork.ozlabs.org; Wed, 23 Jan 2013 07:08:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Txz7i-0004L3-5f for qemu-devel@nongnu.org; Wed, 23 Jan 2013 07:08:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Txz7a-0004I0-Fr for qemu-devel@nongnu.org; Wed, 23 Jan 2013 07:08:09 -0500 Received: from cantor2.suse.de ([195.135.220.15]:41303 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Txz7a-0004Hh-A9 for qemu-devel@nongnu.org; Wed, 23 Jan 2013 07:08:02 -0500 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id DA697A50DE; Wed, 23 Jan 2013 13:08:01 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Wed, 23 Jan 2013 13:07:38 +0100 Message-Id: <1358942867-8612-6-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1358942867-8612-1-git-send-email-afaerber@suse.de> References: <1358942867-8612-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Richard Henderson Subject: [Qemu-devel] [PATCH qom-cpu for-1.4 05/14] target-alpha: Detect attempt to instantiate non-CPU type in cpu_init() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Check in alpha_cpu_class_by_name() whether the type found is actually (a sub-type of) TYPE_ALPHA_CPU. This fixes, e.g., -cpu typhoon-pcihost asserting. Signed-off-by: Andreas Färber --- target-alpha/cpu.c | 2 +- 1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-) diff --git a/target-alpha/cpu.c b/target-alpha/cpu.c index 3ac0fde..0d6975e 100644 --- a/target-alpha/cpu.c +++ b/target-alpha/cpu.c @@ -96,7 +96,7 @@ static ObjectClass *alpha_cpu_class_by_name(const char *cpu_model) } oc = object_class_by_name(cpu_model); - if (oc != NULL) { + if (oc != NULL && object_class_dynamic_cast(oc, TYPE_ALPHA_CPU) != NULL) { return oc; }