From nobody Mon Feb 9 18:00:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579796114; cv=none; d=zohomail.com; s=zohoarc; b=kz7pLRSbsb9bRr6m8IiL/4N7wb+EeNXwglYDUKuo+3bFbAUOL5Fz8Azmkqd3PDAgJWhiC/W9eVRIvot1BEEnPpcYcUZLULks+xLqlDyTMKtWmW+SETvidT9FZQLJxKJUSO6K8a/cQro7Q0594S3n6j/4DQAEu3xoDpLTkoK8OUQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579796114; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kxEhjtEiGmz3JhKefGP6i9CMB+/OyKskAJ9ppHwR4AA=; b=BXB1oalQKTXQuyEt9NrBOZ5WoPlsW7X5hpRAucow+7irw/LcXDVSrjiZigOqQTglOR84k0x66BiOo+yo2+pA0yHoforA55RmULlkUtp0QkXXsWAQO34l/dfen/5momZSUbU0n+QXzZtNtf4YNxeZWhGYe/CRYdbDEfSlbK0z/3Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579796114014410.8303201525122; Thu, 23 Jan 2020 08:15:14 -0800 (PST) Received: from localhost ([::1]:60142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuf8R-0002Z3-VA for importer@patchew.org; Thu, 23 Jan 2020 11:15:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51555) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrV-00059Q-DL for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrU-0003dp-Cr for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:33 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:32914) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrU-0003bQ-6U for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:32 -0500 Received: by mail-wr1-x432.google.com with SMTP id b6so3193706wrq.0 for ; Thu, 23 Jan 2020 05:49:32 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kxEhjtEiGmz3JhKefGP6i9CMB+/OyKskAJ9ppHwR4AA=; b=tde2CATV/AmzKhBEGnx/NvDvcAKpIhm8SOFlQELRr47kL6SKdwP6NdgSl5BuFH7dhE Mnf6+H7k8wP8udSMVikFuEZ8zhKyDNzggPLdkBUb0jPCmutsAcHmPPzIHVU0ho/e/rAZ 5JMFQJAhOCq6V3cyYPzcB/SqtHCYDfV+fY43nVWBfQxE33rxCfavq7Gxs6Lk/Rgle0wq 2L1srQtNk3CrUEFXeKXLJHR18X4mYpl5Wxb5c0tmmwnLP08L6ZFUwUxNLNG7+FdAJnMW JuAvHz1sYai+tWULzOWf1TcWLiOAeK7hYJcM4F5hC56EbeipLUKmiSk/Tn37WSW+MPzn s6Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=kxEhjtEiGmz3JhKefGP6i9CMB+/OyKskAJ9ppHwR4AA=; b=q0bpYFTNyODJyDRcCqol71xOE+QYVpJgz6Y6nz/MRN4PCtkXPZ3Nx1yEplnkcNh5RI diTXoiEYHnUGx1Km6X+Gcy3zWvmc6MTdiyR5CEQTWyVfrz8SYRXUpRuZJtd5ewfRVj4h J1eIbjCNjC1K6OlM+O6M/Kq8n+JuEg6w62R58WOFJZ2SuMidiqYu8xppbpWd/wuulxAX FU/tttuRcT4RWmLzDW3zgtBDcm0UupA0dxI7ofdLQWSpg9Lkysjoij9iI9/bNmtMkXeZ xbyUGOhf/TsS0cBlFFJLpBeZq4nv73woQKEPWIVzmZFQxxdc1xxoLM8F8NBvLUby/Ebq BsQw== X-Gm-Message-State: APjAAAWvSXA/LtEZNj9fjZ3iSLiwDIyJohEEfJuesv6+OzpI8G1KyMAZ csjqw4TmeVWiJBmVKDhai1a/AD8L X-Google-Smtp-Source: APXvYqyRDq0QrH4BKXg8dN08K58gOGxaSkPRa/rF45H3B4dP12rQZtjRs4LtC23dD26wJwzM/8TU5w== X-Received: by 2002:adf:ee82:: with SMTP id b2mr17037429wro.194.1579787370954; Thu, 23 Jan 2020 05:49:30 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 27/59] qom/object: Display more helpful message when a parent is missing Date: Thu, 23 Jan 2020 14:48:30 +0100 Message-Id: <1579787342-27146-28-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 QEMU object model is scarse in documentation. Some calls are recursive, and it might be hard to figure out even trivial issues. We can avoid developers to waste time in a debugging session by displaying a simple error message. This commit is also similar to e02bdf1cecd2 ("Display more helpful message when an object type is missing"). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Cornelia Huck Message-Id: <20200121110349.25842-7-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- qom/object.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qom/object.c b/qom/object.c index 36123fb..90155fa 100644 --- a/qom/object.c +++ b/qom/object.c @@ -173,7 +173,11 @@ static TypeImpl *type_get_parent(TypeImpl *type) { if (!type->parent_type && type->parent) { type->parent_type =3D type_get_by_name(type->parent); - g_assert(type->parent_type !=3D NULL); + if (!type->parent_type) { + fprintf(stderr, "Type '%s' is missing its parent '%s'\n", + type->name, type->parent); + abort(); + } } =20 return type->parent_type; --=20 1.8.3.1