From patchwork Thu Mar 15 13:37:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 146959 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BED85B6FA3 for ; Fri, 16 Mar 2012 00:38:42 +1100 (EST) Received: from localhost ([::1]:57391 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8At6-0007I3-Iw for incoming@patchwork.ozlabs.org; Thu, 15 Mar 2012 09:38:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8Asv-0007Fp-OQ for qemu-devel@nongnu.org; Thu, 15 Mar 2012 09:38:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8Asp-0005VC-FJ for qemu-devel@nongnu.org; Thu, 15 Mar 2012 09:38:29 -0400 Received: from e34.co.us.ibm.com ([32.97.110.152]:54114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8Asp-0005UQ-8p for qemu-devel@nongnu.org; Thu, 15 Mar 2012 09:38:23 -0400 Received: from /spool/local by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Mar 2012 07:38:19 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 Mar 2012 07:38:16 -0600 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 4D26EC40001 for ; Thu, 15 Mar 2012 07:38:13 -0600 (MDT) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q2FDcAnJ138238 for ; Thu, 15 Mar 2012 07:38:11 -0600 Received: from d03av05.boulder.ibm.com (loopback [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q2FDc0UH028843 for ; Thu, 15 Mar 2012 07:38:01 -0600 Received: from titi.austin.rr.com (sig-9-65-116-158.mts.ibm.com [9.65.116.158]) by d03av05.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q2FDbpEO028311; Thu, 15 Mar 2012 07:37:59 -0600 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Thu, 15 Mar 2012 08:37:43 -0500 Message-Id: <1331818666-31718-7-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1331818666-31718-1-git-send-email-aliguori@us.ibm.com> References: <1331818666-31718-1-git-send-email-aliguori@us.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12031513-1780-0000-0000-000003FC4ECD X-IBM-ISS-SpamDetectors: X-IBM-ISS-DetailInfo: BY=3.00000256; HX=3.00000185; KW=3.00000007; PH=3.00000001; SC=3.00000001; SDB=6.00122236; UDB=6.00029410; UTC=2012-03-15 13:38:18 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 32.97.110.152 Cc: Paolo Bonzini , Anthony Liguori Subject: [Qemu-devel] [PATCH 6/9] libqtest: add IRQ intercept commands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Anthony Liguori --- tests/libqtest.c | 12 ++++++++++++ tests/libqtest.h | 6 ++++++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/tests/libqtest.c b/tests/libqtest.c index dd07b07..1d1b06e 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -235,6 +235,18 @@ bool qtest_get_irq(QTestState *s, int num) return s->irq_level[num]; } +void qtest_irq_intercept_out(QTestState *s, const char *qom_path) +{ + qtest_sendf(s, "irq_intercept_out %s\n", qom_path); + qtest_rsp(s, 0); +} + +void qtest_irq_intercept_in(QTestState *s, const char *qom_path) +{ + qtest_sendf(s, "irq_intercept_in %s\n", qom_path); + qtest_rsp(s, 0); +} + static void qtest_out(QTestState *s, const char *cmd, uint16_t addr, uint32_t value) { qtest_sendf(s, "%s 0x%x 0x%x\n", cmd, addr, value); diff --git a/tests/libqtest.h b/tests/libqtest.h index dd82926..b5ca04e 100644 --- a/tests/libqtest.h +++ b/tests/libqtest.h @@ -26,6 +26,10 @@ void qtest_quit(QTestState *s); bool qtest_get_irq(QTestState *s, int num); +void qtest_irq_intercept_in(QTestState *s, const char *string); + +void qtest_irq_intercept_out(QTestState *s, const char *string); + void qtest_outb(QTestState *s, uint16_t addr, uint8_t value); void qtest_outw(QTestState *s, uint16_t addr, uint16_t value); @@ -51,6 +55,8 @@ void qtest_add_func(const char *str, void (*fn)); ) #define get_irq(num) qtest_get_irq(global_qtest, (num)) +#define irq_intercept_in(num) qtest_irq_intercept_in(global_qtest, (num)) +#define irq_intercept_out(num) qtest_irq_intercept_out(global_qtest, (num)) #define outb(addr, val) qtest_outb(global_qtest, (addr), (val)) #define outw(addr, val) qtest_outw(global_qtest, (addr), (val)) #define outl(addr, val) qtest_outl(global_qtest, (addr), (val))