Received: from eggs.gnu.org ([208.118.235.92]:46324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1NWQ-00055B-FG for qemu-devel@nongnu.org; Sat, 25 Feb 2012 14:43:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S1NWG-0007MK-Fx for qemu-devel@nongnu.org; Sat, 25 Feb 2012 14:43:10 -0500 Received: from e36.co.us.ibm.com ([32.97.110.154]:48128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1NWG-0007Lp-9U for qemu-devel@nongnu.org; Sat, 25 Feb 2012 14:43:00 -0500 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 25 Feb 2012 12:42:57 -0700 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 7E5B53E40049 for ; Sat, 25 Feb 2012 12:42:56 -0700 (MST) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q1PJguld153652 for ; Sat, 25 Feb 2012 12:42:56 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q1PJguiu010422 for ; Sat, 25 Feb 2012 12:42:56 -0700 From: Anthony Liguori Date: Sat, 25 Feb 2012 13:42:47 -0600 Message-Id: <1330198969-27364-9-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1330198969-27364-1-git-send-email-aliguori@us.ibm.com> References: <1330198969-27364-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 08/10] libqtest: add IRQ intercept commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Anthony Liguori 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)) -- 1.7.4.1