From ba25670c1d3e122bfa5a43cd785f5eb4988861d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Mon, 12 Oct 2020 11:58:03 +0200 Subject: [PATCH] hw/mips/cps: Do not allow use without input clock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now than all QOM users provides the input clock, do not allow using a CPS without input clock connected. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20201012095804.3335117-21-f4bug@amsat.org> --- hw/mips/cps.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/mips/cps.c b/hw/mips/cps.c index af7b58c4bd..c624821315 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -74,6 +74,11 @@ static void mips_cps_realize(DeviceState *dev, Error **errp) bool itu_present = false; bool saar_present = false; + if (!clock_get(s->clock)) { + error_setg(errp, "CPS input clock is not connected to an output clock"); + return; + } + for (i = 0; i < s->num_vp; i++) { cpu = MIPS_CPU(object_new(s->cpu_type));