From nobody Sun Nov 16 18:48:43 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) client-ip=209.85.128.65; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f65.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1601197708; cv=none; d=zohomail.com; s=zohoarc; b=hYUQBQp6M+QU2+IwVexAVm5W7W2+tkI2ynMG1VRdQSJ7jqWh4upMaLiK3G406NO8qwIlEjgGonkEAwm3SGQNjmihzZE3nHXVvtRUm/QVI8gLLAePn30rY5KTMYeyACpUtbSs+++1w0EPjjEZDrfLK7+WrD+Ek51JQdVuzGQBuZw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601197708; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=t3BREwZtlazYO80VUKfXukPFJ19pqUVUnt1RMwbxcUM=; b=Tu6KKYiDyOrj+J+KqjlYrN1AqwzYVLGNP4aHAWEHQAQkNnAWtb4L26vPhSIo8LDFl8UtKy8QICbaZFdkxi9ckjHOewnWHGNyLTEJ6tRGQZDnffPqs5m/AvQiLdXVND015awUIQ6V+IAnytH2mG+VjSXB/p++ETZxMmyV+QK5pfo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.zohomail.com with SMTPS id 1601197708290674.0426409596976; Sun, 27 Sep 2020 02:08:28 -0700 (PDT) Received: by mail-wm1-f65.google.com with SMTP id y15so3585702wmi.0 for ; Sun, 27 Sep 2020 02:08:27 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (74.red-83-53-161.dynamicip.rima-tde.net. [83.53.161.74]) by smtp.gmail.com with ESMTPSA id y6sm9007187wrn.41.2020.09.27.02.08.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Sep 2020 02:08:25 -0700 (PDT) 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=t3BREwZtlazYO80VUKfXukPFJ19pqUVUnt1RMwbxcUM=; b=SL+rwC+XFiGvq5yE0OJaxyFRRXicxzbYUhe7t0JtPPMFhc8PbWEK0m/3o4tIbMXKhV XZjvaf9wb656+H7EfHcKit4Cz1phJNU6vQJF8CKWbhFUgzVk1C9vDuhJrSirEU/CToqY re7uJfr6PBfRIpRK4exMIucLuffOSI4ARlj+0mr03LA4yhGkDyGbUb5TqCvlhnJP0cRJ eQ0hHqumqj4mhgBCuff+b7esWZQCPybpGu1AUMGcvcH3UsHSBovsYj6CeaaBiuzwkttc AsgXny808rjLmgKkBfaXphTw2QAELHKmdbFan7mvTIpayr6kAOj1iYVsptG4cr/Cy7VO LXkg== 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=t3BREwZtlazYO80VUKfXukPFJ19pqUVUnt1RMwbxcUM=; b=L6geGaMB2w5jpPyjHAnptcHL195xpdN0t/Tj0uA5/BciWHzX6dBn9p9Z7QrdhnV0ZF 7JTntq45yPjXkNbXyEpxQ0mdBd++/VVHvxUmx2MNUN3Q+g9RieGWQbR6eFWIJ1VnlmUl fsufcRt1/9Tpc0Np4EVMg/skYKxstPxqnH+ByQd9RIiwEBno1eTmKd5OYBIo9F/mHCXy ALUbfF+GX1FX7wtLwOPq+2LbV108/fkThc+G1jiphhs786/t6q7+dk3Su8cPzjdOiXNx vLNmYtTVchbVbeAudymk7xdKdAYGiZf2fvEQsDX9OELiplIsRG6nrv1Lz71dmapy7nmf DQRw== X-Gm-Message-State: AOAM533fmFSpq2zNILaRYwQ/BmYd+rLUEucWq7avdanRUKzDCRoNE6vT TxVaU3JX1jwDxk4YhCCMIdg= X-Google-Smtp-Source: ABdhPJyAO6B3/PsaFvI5o0iZWWAVH+pvG4PCweOMTLUpLnb5WiEy44yJ7nYxjGnFMHxWYX0tDMWIRA== X-Received: by 2002:a1c:9d42:: with SMTP id g63mr6267355wme.20.1601197706424; Sun, 27 Sep 2020 02:08:26 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Tyrone Ting , Alistair Francis , Eduardo Habkost , Luc Michel , Damien Hedde , "Edgar E . Iglesias" , Havard Skinnemoen , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 3/3] hw/qdev-clock: Display error hint when clock is missing from device Date: Sun, 27 Sep 2020 11:08:20 +0200 Message-Id: <20200927090820.61859-4-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200927090820.61859-1-f4bug@amsat.org> References: <20200927090820.61859-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Instead of directly aborting, display a hint to help the developer figure out the problem (likely trying to connect a clock to a device pre-dating the Clock API, thus not expecting clocks). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Damien Hedde Reviewed-by: Edgar E. Iglesias Reviewed-by: Luc Michel --- hw/core/qdev-clock.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/core/qdev-clock.c b/hw/core/qdev-clock.c index 47ecb5b4fae..33bd4a9d520 100644 --- a/hw/core/qdev-clock.c +++ b/hw/core/qdev-clock.c @@ -12,6 +12,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/qdev-clock.h" #include "hw/qdev-core.h" #include "qapi/error.h" @@ -153,6 +154,11 @@ Clock *qdev_get_clock_in(DeviceState *dev, const char = *name) assert(name); =20 ncl =3D qdev_get_clocklist(dev, name); + if (!ncl) { + error_report("can not find clock-in '%s' for device type '%s'", + name, object_get_typename(OBJECT(dev))); + abort(); + } assert(!ncl->output); =20 return ncl->clock; @@ -165,6 +171,11 @@ Clock *qdev_get_clock_out(DeviceState *dev, const char= *name) assert(name); =20 ncl =3D qdev_get_clocklist(dev, name); + if (!ncl) { + error_report("can not find clock-out '%s' for device type '%s'", + name, object_get_typename(OBJECT(dev))); + abort(); + } assert(ncl->output); =20 return ncl->clock; --=20 2.26.2