From nobody Sun May 5 17:48:58 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518539558329814.5394147364192; Tue, 13 Feb 2018 08:32:38 -0800 (PST) Received: from localhost ([::1]:51639 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eldVV-0005Zg-EK for importer@patchew.org; Tue, 13 Feb 2018 11:32:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eldIN-0002Iq-Ir for qemu-devel@nongnu.org; Tue, 13 Feb 2018 11:19:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eldIM-0006G1-NV for qemu-devel@nongnu.org; Tue, 13 Feb 2018 11:19:03 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:37348 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eldIM-00067h-Ij for qemu-devel@nongnu.org; Tue, 13 Feb 2018 11:19:02 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DB1274040853; Tue, 13 Feb 2018 16:18:55 +0000 (UTC) Received: from redhat.com (ovpn-125-92.rdu2.redhat.com [10.10.125.92]) by smtp.corp.redhat.com (Postfix) with SMTP id 682B42026DFD; Tue, 13 Feb 2018 16:18:55 +0000 (UTC) Date: Tue, 13 Feb 2018 18:18:54 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1518538727-952-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 13 Feb 2018 16:18:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 13 Feb 2018 16:18:55 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH] qom: print out type name on lookup failure 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: Andreas =?utf-8?Q?F=C3=A4rber?= 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 Content-Type: text/plain; charset="utf-8" this makes debugging a bit easier. Signed-off-by: Michael S. Tsirkin --- qom/object.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qom/object.c b/qom/object.c index c58c52d..a1e5f99 100644 --- a/qom/object.c +++ b/qom/object.c @@ -499,6 +499,10 @@ Object *object_new(const char *typename) { TypeImpl *ti =3D type_get_by_name(typename); =20 + if (!ti) { + g_error("Object type not found: %s\n", typename); + } + return object_new_with_type(ti); } =20 --=20 MST