From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:35215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLPqU-00027N-Dz for qemu-devel@nongnu.org; Tue, 30 Apr 2019 06:18:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLPqT-000353-8X for qemu-devel@nongnu.org; Tue, 30 Apr 2019 06:18:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42768) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLPqT-00034Y-2X for qemu-devel@nongnu.org; Tue, 30 Apr 2019 06:18:41 -0400 Date: Tue, 30 Apr 2019 11:18:33 +0100 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Message-ID: <20190430101833.GC6818@redhat.com> Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= References: <20190427135642.16464-1-philmd@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190427135642.16464-1-philmd@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] qom/object: Display more helpful message when an object type is missing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Cc: Eduardo Habkost , qemu-devel@nongnu.org, Andreas =?utf-8?Q?F=C3=A4rber?= , Eric Blake , Markus Armbruster On Sat, Apr 27, 2019 at 03:56:42PM +0200, Philippe Mathieu-Daud=C3=A9 wro= te: > When writing a new board, adding device which uses other devices > (container) or simply refactoring, one can discover the hard way > his machine misses some devices. In the case of containers, the > error is not obvious: >=20 > $ qemu-system-microblaze -M xlnx-zynqmp-pmu > ** > ERROR:/source/qemu/qom/object.c:454:object_initialize_with_type: asse= rtion failed: (type !=3D NULL) > Aborted (core dumped) >=20 > And we have to look at the coredump to figure the error: >=20 > (gdb) bt > #1 0x00007f84773cf895 in abort () at /lib64/libc.so.6 > #2 0x00007f847961fb53 in () at /lib64/libglib-2.0.so.0 > #3 0x00007f847967a4de in g_assertion_message_expr () at /lib64/libgl= ib-2.0.so.0 > #4 0x000055c4bcac6c11 in object_initialize_with_type (data=3Ddata@en= try=3D0x55c4bdf239e0, size=3Dsize@entry=3D2464, type=3D) a= t /source/qemu/qom/object.c:454 > #5 0x000055c4bcac6e6d in object_initialize (data=3Ddata@entry=3D0x55= c4bdf239e0, size=3Dsize@entry=3D2464, typename=3Dtypename@entry=3D0x55c4b= cc7c643 "xlnx.zynqmp_ipi") at /source/qemu/qom/object.c:474 > #6 0x000055c4bc9ea474 in xlnx_zynqmp_pmu_init (machine=3D0x55c4bdd46= 000) at /source/qemu/hw/microblaze/xlnx-zynqmp-pmu.c:176 > #7 0x000055c4bca3b6cb in machine_run_board_init (machine=3D0x55c4bdd= 46000) at /source/qemu/hw/core/machine.c:1030 > #8 0x000055c4bc95f6d2 in main (argc=3D, argv=3D, envp=3D) at /source/qemu/vl.c:4479 >=20 > Since the caller knows the type name requested, we can simply display i= t > to ease development. >=20 > With this patch applied we get: >=20 > $ qemu-system-microblaze -M xlnx-zynqmp-pmu > qemu-system-microblaze: missing object type 'xlnx.zynqmp_ipi' > Aborted (core dumped) >=20 > Since the assert(type) check in object_initialize_with_type() is > now impossible, remove it. >=20 > Signed-off-by: Philippe Mathieu-Daud=C3=A9 > --- > qom/object.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) Reviewed-by: Daniel P. Berrang=C3=A9 Regards, Daniel --=20 |: https://berrange.com -o- https://www.flickr.com/photos/dberran= ge :| |: https://libvirt.org -o- https://fstop138.berrange.c= om :| |: https://entangle-photo.org -o- https://www.instagram.com/dberran= ge :| From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=FROM_EXCESS_BASE64, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFCBDC43219 for ; Tue, 30 Apr 2019 10:23:09 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8C22F2080C for ; Tue, 30 Apr 2019 10:23:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8C22F2080C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([127.0.0.1]:42662 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLPum-0005gt-N8 for qemu-devel@archiver.kernel.org; Tue, 30 Apr 2019 06:23:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLPqU-00027N-Dz for qemu-devel@nongnu.org; Tue, 30 Apr 2019 06:18:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLPqT-000353-8X for qemu-devel@nongnu.org; Tue, 30 Apr 2019 06:18:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42768) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLPqT-00034Y-2X for qemu-devel@nongnu.org; Tue, 30 Apr 2019 06:18:41 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 086B830BC665; Tue, 30 Apr 2019 10:18:40 +0000 (UTC) Received: from redhat.com (unknown [10.42.22.189]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9D7E82AA8C; Tue, 30 Apr 2019 10:18:35 +0000 (UTC) Date: Tue, 30 Apr 2019 11:18:33 +0100 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= To: Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Message-ID: <20190430101833.GC6818@redhat.com> References: <20190427135642.16464-1-philmd@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: <20190427135642.16464-1-philmd@redhat.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 30 Apr 2019 10:18:40 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] [PATCH] qom/object: Display more helpful message when an object type is missing 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: , Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Cc: Markus Armbruster , Eduardo Habkost , Andreas =?utf-8?Q?F=C3=A4rber?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Message-ID: <20190430101833.OEcTufX_jMaY06nzMFag0PgtUEHGDezL3WKmv-WVb-I@z> On Sat, Apr 27, 2019 at 03:56:42PM +0200, Philippe Mathieu-Daud=C3=A9 wro= te: > When writing a new board, adding device which uses other devices > (container) or simply refactoring, one can discover the hard way > his machine misses some devices. In the case of containers, the > error is not obvious: >=20 > $ qemu-system-microblaze -M xlnx-zynqmp-pmu > ** > ERROR:/source/qemu/qom/object.c:454:object_initialize_with_type: asse= rtion failed: (type !=3D NULL) > Aborted (core dumped) >=20 > And we have to look at the coredump to figure the error: >=20 > (gdb) bt > #1 0x00007f84773cf895 in abort () at /lib64/libc.so.6 > #2 0x00007f847961fb53 in () at /lib64/libglib-2.0.so.0 > #3 0x00007f847967a4de in g_assertion_message_expr () at /lib64/libgl= ib-2.0.so.0 > #4 0x000055c4bcac6c11 in object_initialize_with_type (data=3Ddata@en= try=3D0x55c4bdf239e0, size=3Dsize@entry=3D2464, type=3D) a= t /source/qemu/qom/object.c:454 > #5 0x000055c4bcac6e6d in object_initialize (data=3Ddata@entry=3D0x55= c4bdf239e0, size=3Dsize@entry=3D2464, typename=3Dtypename@entry=3D0x55c4b= cc7c643 "xlnx.zynqmp_ipi") at /source/qemu/qom/object.c:474 > #6 0x000055c4bc9ea474 in xlnx_zynqmp_pmu_init (machine=3D0x55c4bdd46= 000) at /source/qemu/hw/microblaze/xlnx-zynqmp-pmu.c:176 > #7 0x000055c4bca3b6cb in machine_run_board_init (machine=3D0x55c4bdd= 46000) at /source/qemu/hw/core/machine.c:1030 > #8 0x000055c4bc95f6d2 in main (argc=3D, argv=3D, envp=3D) at /source/qemu/vl.c:4479 >=20 > Since the caller knows the type name requested, we can simply display i= t > to ease development. >=20 > With this patch applied we get: >=20 > $ qemu-system-microblaze -M xlnx-zynqmp-pmu > qemu-system-microblaze: missing object type 'xlnx.zynqmp_ipi' > Aborted (core dumped) >=20 > Since the assert(type) check in object_initialize_with_type() is > now impossible, remove it. >=20 > Signed-off-by: Philippe Mathieu-Daud=C3=A9 > --- > qom/object.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) Reviewed-by: Daniel P. Berrang=C3=A9 Regards, Daniel --=20 |: https://berrange.com -o- https://www.flickr.com/photos/dberran= ge :| |: https://libvirt.org -o- https://fstop138.berrange.c= om :| |: https://entangle-photo.org -o- https://www.instagram.com/dberran= ge :|