From nobody Wed Feb 11 02:08:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=quarantine dis=none) header.from=laplante.io ARC-Seal: i=1; a=rsa-sha256; t=1689377358; cv=none; d=zohomail.com; s=zohoarc; b=F2BES1y2PNymrim//KTEM1pKxeBPIbtQxFeou3xogRdCvz2+6PIwFouAqQ83LGaU8/5/O0rYltEng+jPkeT6vrFA9MbJlSpsic3lfHC93VVW6QibnpFG8zJUV0tq8HaxqVL/aN9YxreyInasrEUV2IrGlFI3rQOQFeUK6TKJw8M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689377358; 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=kCTGZscRn0Vly+yIoAdKyZJzfkd9NkpoIHdFxIsVLuc=; b=HKF65DsbfkTieFfPZuikICNWwFJt0Zd2t5sbxohwZ/wnRJe38J1pJScPByn5zHhjhalAPpyazQ2BfL7A82MjooRwJrU7HVDDU3beGdVDCjXjpqA6zuIV4GexPbZ5njo/hT+fDx16rPKvSFcdDAfmDBzbjdUyHyJEvc7wQtSOieM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16893773585031010.8801175749439; Fri, 14 Jul 2023 16:29:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qKSCk-0000st-3F; Fri, 14 Jul 2023 19:28:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKSCi-0000rx-6T for qemu-devel@nongnu.org; Fri, 14 Jul 2023 19:28:04 -0400 Received: from mail-40136.proton.ch ([185.70.40.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKSCf-00043P-PA for qemu-devel@nongnu.org; Fri, 14 Jul 2023 19:28:03 -0400 Date: Fri, 14 Jul 2023 23:27:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=laplante.io; s=protonmail3; t=1689377278; x=1689636478; bh=kCTGZscRn0Vly+yIoAdKyZJzfkd9NkpoIHdFxIsVLuc=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=AmwSJ46uycYMhdBtcgo0j9qVcan+g04NVoOuGO4gg3cSr72OHlyh0XCDtN/14W5gy DaQJtEDTF/dj3pBE3NzgK8Zge79eH9qif7zHxGZgihUZ2eBJrmi3LY2qKtO9RNIJ7W Lo7VYuVTpc1rQySgcwjopNX47kZRb3iyGDjNHt31alpqX6BAQ8bFwFRKtx82j+bi+v L5dMysoI32uUwttTSYtStXUaUZt2cD7qNqJ3Ii8tVlsBfpqNCRi1vRqaSG6ICjSwEi upmrzPhY8YqwQFxQd4FqK93geZi2l6GSDV9mgoALhy99v1zpbo7RIV5CtXeJaOi/Gx PK24d0fvgO7ig== To: qemu-devel@nongnu.org From: Chris Laplante Cc: Joel Stanley , Peter Maydell , qemu-arm@nongnu.org, Chris Laplante Subject: [PATCH 5/6] qtest: irq_intercept_[out/in]: return FAIL if no intercepts are installed Message-ID: <20230714232659.76434-6-chris@laplante.io> In-Reply-To: <20230714232659.76434-1-chris@laplante.io> References: <20230714232659.76434-1-chris@laplante.io> Feedback-ID: 43500449:user:proton MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=185.70.40.136; envelope-from=chris@laplante.io; helo=mail-40136.proton.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @laplante.io) X-ZM-MESSAGEID: 1689377360104100006 Content-Type: text/plain; charset="utf-8" This is much better than just silently failing with OK. Signed-off-by: Chris Laplante Reviewed-by: Peter Maydell --- softmmu/qtest.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/softmmu/qtest.c b/softmmu/qtest.c index 051bbf4177..e888acb319 100644 --- a/softmmu/qtest.c +++ b/softmmu/qtest.c @@ -399,6 +399,7 @@ static void qtest_process_command(CharBackend *chr, gch= ar **words) NamedGPIOList *ngl; bool is_named; bool is_outbound; + bool interception_succeeded =3D false; =20 g_assert(words[1]); is_named =3D words[2] !=3D NULL; @@ -431,6 +432,7 @@ static void qtest_process_command(CharBackend *chr, gch= ar **words) if (is_named) { if (ngl->name && strcmp(ngl->name, words[2]) =3D=3D 0)= { qtest_install_gpio_out_intercepts(dev, ngl->name, = 0); + interception_succeeded =3D true; break; } } else if (!ngl->name) { @@ -438,15 +440,22 @@ static void qtest_process_command(CharBackend *chr, g= char **words) for (i =3D 0; i < ngl->num_out; ++i) { qtest_install_gpio_out_intercepts(dev, ngl->name, = i); } + interception_succeeded =3D true; } } else { qemu_irq_intercept_in(ngl->in, qtest_irq_handler, ngl->num_in); + interception_succeeded =3D true; } } - irq_intercept_dev =3D dev; + qtest_send_prefix(chr); - qtest_send(chr, "OK\n"); + if (interception_succeeded) { + irq_intercept_dev =3D dev; + qtest_send(chr, "OK\n"); + } else { + qtest_send(chr, "FAIL No intercepts installed\n"); + } } else if (strcmp(words[0], "set_irq_in") =3D=3D 0) { DeviceState *dev; qemu_irq irq; --=20 2.39.2