From nobody Sun Apr 28 21:46:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507823203010389.7572450188421; Thu, 12 Oct 2017 08:46:43 -0700 (PDT) Received: from localhost ([::1]:46153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2fgo-0000gJ-SA for importer@patchew.org; Thu, 12 Oct 2017 11:46:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2ffn-0000Ci-Ql for qemu-devel@nongnu.org; Thu, 12 Oct 2017 11:45:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2ffj-0005Nn-OI for qemu-devel@nongnu.org; Thu, 12 Oct 2017 11:45:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39168) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2ffj-0005Mx-BM; Thu, 12 Oct 2017 11:45:19 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1B6282D0FB9; Thu, 12 Oct 2017 15:45:18 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.34.112.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id A90C06EE2B; Thu, 12 Oct 2017 15:45:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1B6282D0FB9 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=imammedo@redhat.com From: Igor Mammedov To: qemu-devel@nongnu.org Date: Thu, 12 Oct 2017 17:45:14 +0200 Message-Id: <1507823114-270153-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 12 Oct 2017 15:45:18 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] fixup! ppc: spapr: use cpu type name directly X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: groug@kaod.org, qemu-ppc@nongnu.org, agraf@suse.de, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" follow up commit that registers host-spapr-cpu-core type unconditionally "ppc: spapr: register 'host' core type along with the rest of core types" makes 'non' machine crash ppc64-softmmu/qemu-system-ppc64 -M none -device host-spapr-cpu-core ERROR:qom/object.c:217:object_type_get_instance_size: assertion failed: (t= ype !=3D NULL) Aborted before it qemu fails cleanly with ppc64-softmmu/qemu-system-ppc64 -M none -device host-spapr-cpu-core qemu-system-ppc64: -device host-spapr-cpu-core: 'host-spapr-cpu-core' is n= ot a valid device model name spapr_cpu_core_realize() already has explicit check for pseries machine, so move access to host cpu type after it so 'none' machine would fail cleanly as expected. Reported-by: Greg Kurz Signed-off-by: Igor Mammedov --- hw/ppc/spapr_cpu_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index b5bbb6a..7dbf9c3 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -151,7 +151,7 @@ static void spapr_cpu_core_realize(DeviceState *dev, Er= ror **errp) sPAPRCPUCore *sc =3D SPAPR_CPU_CORE(OBJECT(dev)); sPAPRCPUCoreClass *scc =3D SPAPR_CPU_CORE_GET_CLASS(OBJECT(dev)); CPUCore *cc =3D CPU_CORE(OBJECT(dev)); - size_t size =3D object_type_get_instance_size(scc->cpu_type); + size_t size; Error *local_err =3D NULL; void *obj; int i, j; @@ -162,6 +162,7 @@ static void spapr_cpu_core_realize(DeviceState *dev, Er= ror **errp) return; } =20 + size =3D object_type_get_instance_size(scc->cpu_type); sc->threads =3D g_malloc0(size * cc->nr_threads); for (i =3D 0; i < cc->nr_threads; i++) { char id[32]; --=20 2.7.4