get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/812525/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 812525,
    "url": "http://patchwork.ozlabs.org/api/patches/812525/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170911172022.4738-33-eblake@redhat.com/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170911172022.4738-33-eblake@redhat.com>",
    "list_archive_url": null,
    "date": "2017-09-11T17:20:16",
    "name": "[v7,32/38] libqtest: Merge qtest_irq*() with irq*()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "16d96766df6d9416e48aea913d09c7989aa6ed96",
    "submitter": {
        "id": 6591,
        "url": "http://patchwork.ozlabs.org/api/people/6591/?format=api",
        "name": "Eric Blake",
        "email": "eblake@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170911172022.4738-33-eblake@redhat.com/mbox/",
    "series": [
        {
            "id": 2534,
            "url": "http://patchwork.ozlabs.org/api/series/2534/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=2534",
            "date": "2017-09-11T17:19:47",
            "name": "Preliminary libqtest cleanups",
            "version": 7,
            "mbox": "http://patchwork.ozlabs.org/series/2534/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/812525/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/812525/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)",
            "ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com",
            "ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=eblake@redhat.com"
        ],
        "Received": [
            "from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xrbMB6ZJFz9s83\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 04:00:53 +1000 (AEST)",
            "from localhost ([::1]:59556 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drT0t-0002Ah-Di\n\tfor incoming@patchwork.ozlabs.org; Mon, 11 Sep 2017 14:00:51 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:39127)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1drSPL-0008E9-Cj\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:22:06 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1drSPI-0001dT-RM\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:22:03 -0400",
            "from mx1.redhat.com ([209.132.183.28]:51570)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <eblake@redhat.com>)\n\tid 1drSPC-0001ZX-EG; Mon, 11 Sep 2017 13:21:54 -0400",
            "from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 84F882FB8C3;\n\tMon, 11 Sep 2017 17:21:53 +0000 (UTC)",
            "from red.redhat.com (ovpn-120-44.rdu2.redhat.com [10.10.120.44])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 673775DC1E;\n\tMon, 11 Sep 2017 17:21:52 +0000 (UTC)"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 84F882FB8C3",
        "From": "Eric Blake <eblake@redhat.com>",
        "To": "qemu-devel@nongnu.org",
        "Date": "Mon, 11 Sep 2017 12:20:16 -0500",
        "Message-Id": "<20170911172022.4738-33-eblake@redhat.com>",
        "In-Reply-To": "<20170911172022.4738-1-eblake@redhat.com>",
        "References": "<20170911172022.4738-1-eblake@redhat.com>",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.14",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tMon, 11 Sep 2017 17:21:53 +0000 (UTC)",
        "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]",
        "X-Received-From": "209.132.183.28",
        "Subject": "[Qemu-devel] [PATCH v7 32/38] libqtest: Merge qtest_irq*() with\n\tirq*()",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Id": "<qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Cc": "pbonzini@redhat.com, thuth@redhat.com, John Snow <jsnow@redhat.com>,\n\tarmbru@redhat.com, \"open list:Floppy\" <qemu-block@nongnu.org>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"
    },
    "content": "Maintaining two layers of libqtest APIs, one that takes an explicit\nQTestState object, and the other that uses the implicit global_qtest,\nis annoying.  In the interest of getting rid of global implicit\nstate and having less code to maintain, merge:\n qtest_get_irq()\n qtest_irq_intercept_in()\n qtest_irq_intercept_out()\nwith their short counterparts.  All callers that previously\nused the short form now make it explicit that they are relying on\nglobal_qtest, and later patches can then clean things up to remove\nthe global variable.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\n---\n tests/libqtest.h         | 47 ++++++-----------------------------------------\n tests/libqtest.c         |  6 +++---\n tests/fdc-test.c         | 48 ++++++++++++++++++++++++------------------------\n tests/ide-test.c         | 17 +++++++++--------\n tests/ipmi-bt-test.c     |  6 +++---\n tests/ipmi-kcs-test.c    |  8 ++++----\n tests/libqos/libqos-pc.c |  2 +-\n tests/rtc-test.c         | 10 +++++-----\n tests/tco-test.c         |  2 +-\n tests/wdt_ib700-test.c   |  8 ++++----\n 10 files changed, 60 insertions(+), 94 deletions(-)",
    "diff": "diff --git a/tests/libqtest.h b/tests/libqtest.h\nindex 26d5f37bc9..8398c0fd07 100644\n--- a/tests/libqtest.h\n+++ b/tests/libqtest.h\n@@ -176,33 +176,33 @@ char *qtest_hmp(QTestState *s, const char *fmt, ...) GCC_FMT_ATTR(2, 3);\n char *qtest_hmpv(QTestState *s, const char *fmt, va_list ap);\n\n /**\n- * qtest_get_irq:\n+ * get_irq:\n  * @s: #QTestState instance to operate on.\n  * @num: Interrupt to observe.\n  *\n  * Returns: The level of the @num interrupt.\n  */\n-bool qtest_get_irq(QTestState *s, int num);\n+bool get_irq(QTestState *s, int num);\n\n /**\n- * qtest_irq_intercept_in:\n+ * irq_intercept_in:\n  * @s: #QTestState instance to operate on.\n  * @string: QOM path of a device.\n  *\n  * Associate qtest irqs with the GPIO-in pins of the device\n  * whose path is specified by @string.\n  */\n-void qtest_irq_intercept_in(QTestState *s, const char *string);\n+void irq_intercept_in(QTestState *s, const char *string);\n\n /**\n- * qtest_irq_intercept_out:\n+ * irq_intercept_out:\n  * @s: #QTestState instance to operate on.\n  * @string: QOM path of a device.\n  *\n  * Associate qtest irqs with the GPIO-out pins of the device\n  * whose path is specified by @string.\n  */\n-void qtest_irq_intercept_out(QTestState *s, const char *string);\n+void irq_intercept_out(QTestState *s, const char *string);\n\n /**\n  * qtest_outb:\n@@ -594,41 +594,6 @@ static inline QDict *qmp_eventwait_ref(const char *event)\n char *hmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2);\n\n /**\n- * get_irq:\n- * @num: Interrupt to observe.\n- *\n- * Returns: The level of the @num interrupt.\n- */\n-static inline bool get_irq(int num)\n-{\n-    return qtest_get_irq(global_qtest, num);\n-}\n-\n-/**\n- * irq_intercept_in:\n- * @string: QOM path of a device.\n- *\n- * Associate qtest irqs with the GPIO-in pins of the device\n- * whose path is specified by @string.\n- */\n-static inline void irq_intercept_in(const char *string)\n-{\n-    qtest_irq_intercept_in(global_qtest, string);\n-}\n-\n-/**\n- * qtest_irq_intercept_out:\n- * @string: QOM path of a device.\n- *\n- * Associate qtest irqs with the GPIO-out pins of the device\n- * whose path is specified by @string.\n- */\n-static inline void irq_intercept_out(const char *string)\n-{\n-    qtest_irq_intercept_out(global_qtest, string);\n-}\n-\n-/**\n  * outb:\n  * @addr: I/O port to write to.\n  * @value: Value being written.\ndiff --git a/tests/libqtest.c b/tests/libqtest.c\nindex 9f5f2cb933..962432a27a 100644\n--- a/tests/libqtest.c\n+++ b/tests/libqtest.c\n@@ -648,7 +648,7 @@ const char *qtest_get_arch(void)\n     return end + strlen(\"/qemu-system-\");\n }\n\n-bool qtest_get_irq(QTestState *s, int num)\n+bool get_irq(QTestState *s, int num)\n {\n     /* dummy operation in order to make sure irq is up to date */\n     qtest_inb(s, 0);\n@@ -684,13 +684,13 @@ int64_t clock_set(QTestState *s, int64_t val)\n     return qtest_clock_rsp(s);\n }\n\n-void qtest_irq_intercept_out(QTestState *s, const char *qom_path)\n+void irq_intercept_out(QTestState *s, const char *qom_path)\n {\n     qtest_sendf(s, \"irq_intercept_out %s\\n\", qom_path);\n     qtest_rsp(s, 0);\n }\n\n-void qtest_irq_intercept_in(QTestState *s, const char *qom_path)\n+void irq_intercept_in(QTestState *s, const char *qom_path)\n {\n     qtest_sendf(s, \"irq_intercept_in %s\\n\", qom_path);\n     qtest_rsp(s, 0);\ndiff --git a/tests/fdc-test.c b/tests/fdc-test.c\nindex e79cd0f3b5..584ad746ed 100644\n--- a/tests/fdc-test.c\n+++ b/tests/fdc-test.c\n@@ -99,7 +99,7 @@ static void ack_irq(uint8_t *pcn)\n {\n     uint8_t ret;\n\n-    g_assert(get_irq(FLOPPY_IRQ));\n+    g_assert(get_irq(global_qtest, FLOPPY_IRQ));\n     floppy_send(CMD_SENSE_INT);\n     floppy_recv();\n\n@@ -108,7 +108,7 @@ static void ack_irq(uint8_t *pcn)\n         *pcn = ret;\n     }\n\n-    g_assert(!get_irq(FLOPPY_IRQ));\n+    g_assert(!get_irq(global_qtest, FLOPPY_IRQ));\n }\n\n static uint8_t send_read_command(uint8_t cmd)\n@@ -129,7 +129,7 @@ static uint8_t send_read_command(uint8_t cmd)\n\n     floppy_send(cmd);\n     floppy_send(head << 2 | drive);\n-    g_assert(!get_irq(FLOPPY_IRQ));\n+    g_assert(!get_irq(global_qtest, FLOPPY_IRQ));\n     floppy_send(cyl);\n     floppy_send(head);\n     floppy_send(sect_addr);\n@@ -185,7 +185,7 @@ static uint8_t send_read_no_dma_command(int nb_sect, uint8_t expected_st0)\n\n     floppy_send(CMD_READ);\n     floppy_send(head << 2 | drive);\n-    g_assert(!get_irq(FLOPPY_IRQ));\n+    g_assert(!get_irq(global_qtest, FLOPPY_IRQ));\n     floppy_send(cyl);\n     floppy_send(head);\n     floppy_send(sect_addr);\n@@ -217,7 +217,7 @@ static uint8_t send_read_no_dma_command(int nb_sect, uint8_t expected_st0)\n\n     msr = inb(FLOPPY_BASE + reg_msr);\n     assert_bit_set(msr, BUSY | RQM | DIO);\n-    g_assert(get_irq(FLOPPY_IRQ));\n+    g_assert(get_irq(global_qtest, FLOPPY_IRQ));\n\n     st0 = floppy_recv();\n     if (st0 != expected_st0) {\n@@ -229,14 +229,14 @@ static uint8_t send_read_no_dma_command(int nb_sect, uint8_t expected_st0)\n     floppy_recv();\n     floppy_recv();\n     floppy_recv();\n-    g_assert(get_irq(FLOPPY_IRQ));\n+    g_assert(get_irq(global_qtest, FLOPPY_IRQ));\n     floppy_recv();\n\n     /* Check that we're back in command phase */\n     msr = inb(FLOPPY_BASE + reg_msr);\n     assert_bit_clear(msr, BUSY | DIO);\n     assert_bit_set(msr, RQM);\n-    g_assert(!get_irq(FLOPPY_IRQ));\n+    g_assert(!get_irq(global_qtest, FLOPPY_IRQ));\n\n     return ret;\n }\n@@ -248,7 +248,7 @@ static void send_seek(int cyl)\n\n     floppy_send(CMD_SEEK);\n     floppy_send(head << 2 | drive);\n-    g_assert(!get_irq(FLOPPY_IRQ));\n+    g_assert(!get_irq(global_qtest, FLOPPY_IRQ));\n     floppy_send(cyl);\n     ack_irq(NULL);\n }\n@@ -363,7 +363,7 @@ static void test_sense_interrupt(void)\n\n     floppy_send(CMD_SEEK);\n     floppy_send(head << 2 | drive);\n-    g_assert(!get_irq(FLOPPY_IRQ));\n+    g_assert(!get_irq(global_qtest, FLOPPY_IRQ));\n     floppy_send(cyl);\n\n     floppy_send(CMD_SENSE_INT);\n@@ -385,7 +385,7 @@ static void test_relative_seek(void)\n     /* Send relative seek to increase track by 1 */\n     floppy_send(CMD_RELATIVE_SEEK_IN);\n     floppy_send(head << 2 | drive);\n-    g_assert(!get_irq(FLOPPY_IRQ));\n+    g_assert(!get_irq(global_qtest, FLOPPY_IRQ));\n     floppy_send(cyl);\n\n     ack_irq(&pcn);\n@@ -394,7 +394,7 @@ static void test_relative_seek(void)\n     /* Send relative seek to decrease track by 1 */\n     floppy_send(CMD_RELATIVE_SEEK_OUT);\n     floppy_send(head << 2 | drive);\n-    g_assert(!get_irq(FLOPPY_IRQ));\n+    g_assert(!get_irq(global_qtest, FLOPPY_IRQ));\n     floppy_send(cyl);\n\n     ack_irq(&pcn);\n@@ -413,16 +413,16 @@ static void test_read_id(void)\n     send_seek(0);\n\n     floppy_send(CMD_READ_ID);\n-    g_assert(!get_irq(FLOPPY_IRQ));\n+    g_assert(!get_irq(global_qtest, FLOPPY_IRQ));\n     floppy_send(head << 2 | drive);\n\n     msr = inb(FLOPPY_BASE + reg_msr);\n-    if (!get_irq(FLOPPY_IRQ)) {\n+    if (!get_irq(global_qtest, FLOPPY_IRQ)) {\n         assert_bit_set(msr, BUSY);\n         assert_bit_clear(msr, RQM);\n     }\n\n-    while (!get_irq(FLOPPY_IRQ)) {\n+    while (!get_irq(global_qtest, FLOPPY_IRQ)) {\n         /* qemu involves a timer with READ ID... */\n         clock_step(global_qtest, 1000000000LL / 50);\n     }\n@@ -436,9 +436,9 @@ static void test_read_id(void)\n     cyl = floppy_recv();\n     head = floppy_recv();\n     floppy_recv();\n-    g_assert(get_irq(FLOPPY_IRQ));\n+    g_assert(get_irq(global_qtest, FLOPPY_IRQ));\n     floppy_recv();\n-    g_assert(!get_irq(FLOPPY_IRQ));\n+    g_assert(!get_irq(global_qtest, FLOPPY_IRQ));\n\n     g_assert_cmpint(cyl, ==, 0);\n     g_assert_cmpint(head, ==, 0);\n@@ -450,22 +450,22 @@ static void test_read_id(void)\n\n     floppy_send(CMD_SEEK);\n     floppy_send(head << 2 | drive);\n-    g_assert(!get_irq(FLOPPY_IRQ));\n+    g_assert(!get_irq(global_qtest, FLOPPY_IRQ));\n     floppy_send(cyl);\n-    g_assert(get_irq(FLOPPY_IRQ));\n+    g_assert(get_irq(global_qtest, FLOPPY_IRQ));\n     ack_irq(NULL);\n\n     floppy_send(CMD_READ_ID);\n-    g_assert(!get_irq(FLOPPY_IRQ));\n+    g_assert(!get_irq(global_qtest, FLOPPY_IRQ));\n     floppy_send(head << 2 | drive);\n\n     msr = inb(FLOPPY_BASE + reg_msr);\n-    if (!get_irq(FLOPPY_IRQ)) {\n+    if (!get_irq(global_qtest, FLOPPY_IRQ)) {\n         assert_bit_set(msr, BUSY);\n         assert_bit_clear(msr, RQM);\n     }\n\n-    while (!get_irq(FLOPPY_IRQ)) {\n+    while (!get_irq(global_qtest, FLOPPY_IRQ)) {\n         /* qemu involves a timer with READ ID... */\n         clock_step(global_qtest, 1000000000LL / 50);\n     }\n@@ -479,9 +479,9 @@ static void test_read_id(void)\n     cyl = floppy_recv();\n     head = floppy_recv();\n     floppy_recv();\n-    g_assert(get_irq(FLOPPY_IRQ));\n+    g_assert(get_irq(global_qtest, FLOPPY_IRQ));\n     floppy_recv();\n-    g_assert(!get_irq(FLOPPY_IRQ));\n+    g_assert(!get_irq(global_qtest, FLOPPY_IRQ));\n\n     g_assert_cmpint(cyl, ==, 8);\n     g_assert_cmpint(head, ==, 1);\n@@ -565,7 +565,7 @@ int main(int argc, char **argv)\n     g_test_init(&argc, &argv, NULL);\n\n     global_qtest = qtest_start(\"-device floppy,id=floppy0\");\n-    qtest_irq_intercept_in(global_qtest, \"ioapic\");\n+    irq_intercept_in(global_qtest, \"ioapic\");\n     qtest_add_func(\"/fdc/cmos\", test_cmos);\n     qtest_add_func(\"/fdc/no_media_on_start\", test_no_media_on_start);\n     qtest_add_func(\"/fdc/read_without_media\", test_read_without_media);\ndiff --git a/tests/ide-test.c b/tests/ide-test.c\nindex 32c8c40294..c22dde55c1 100644\n--- a/tests/ide-test.c\n+++ b/tests/ide-test.c\n@@ -255,14 +255,15 @@ static int send_dma_request(int cmd, uint64_t sector, int nb_sectors,\n         status = qpci_io_readb(dev, bmdma_bar, bmreg_status);\n     } while ((status & (BM_STS_ACTIVE | BM_STS_INTR)) == BM_STS_ACTIVE);\n\n-    g_assert_cmpint(get_irq(IDE_PRIMARY_IRQ), ==, !!(status & BM_STS_INTR));\n+    g_assert_cmpint(get_irq(global_qtest, IDE_PRIMARY_IRQ), ==,\n+                    !!(status & BM_STS_INTR));\n\n     /* Check IDE status code */\n     assert_bit_set(qpci_io_readb(dev, ide_bar, reg_status), DRDY);\n     assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), BSY | DRQ);\n\n     /* Reading the status register clears the IRQ */\n-    g_assert(!get_irq(IDE_PRIMARY_IRQ));\n+    g_assert(!get_irq(global_qtest, IDE_PRIMARY_IRQ));\n\n     /* Stop DMA transfer if still active */\n     if (status & BM_STS_ACTIVE) {\n@@ -458,7 +459,7 @@ static void test_bmdma_setup(void)\n         \"-drive file=%s,if=ide,serial=%s,cache=writeback,format=raw \"\n         \"-global ide-hd.ver=%s\",\n         tmp_path, \"testdisk\", \"version\");\n-    qtest_irq_intercept_in(global_qtest, \"ioapic\");\n+    irq_intercept_in(global_qtest, \"ioapic\");\n }\n\n static void test_bmdma_teardown(void)\n@@ -580,7 +581,7 @@ static void test_flush(void)\n\n     dev = get_pci_device(&bmdma_bar, &ide_bar);\n\n-    qtest_irq_intercept_in(global_qtest, \"ioapic\");\n+    irq_intercept_in(global_qtest, \"ioapic\");\n\n     /* Dirty media so that CMD_FLUSH_CACHE will actually go to disk */\n     make_dirty(0);\n@@ -631,7 +632,7 @@ static void test_retry_flush(const char *machine)\n\n     dev = get_pci_device(&bmdma_bar, &ide_bar);\n\n-    qtest_irq_intercept_in(global_qtest, \"ioapic\");\n+    irq_intercept_in(global_qtest, \"ioapic\");\n\n     /* Dirty media so that CMD_FLUSH_CACHE will actually go to disk */\n     make_dirty(0);\n@@ -784,7 +785,7 @@ static void ide_wait_intr(int irq)\n\n     time(&st);\n     while (true) {\n-        intr = get_irq(irq);\n+        intr = get_irq(global_qtest, irq);\n         if (intr) {\n             return;\n         }\n@@ -822,7 +823,7 @@ static void cdrom_pio_impl(int nblocks)\n     ide_test_start(\"-drive if=none,file=%s,media=cdrom,format=raw,id=sr0,index=0 \"\n                    \"-device ide-cd,drive=sr0,bus=ide.0\", tmp_path);\n     dev = get_pci_device(&bmdma_bar, &ide_bar);\n-    qtest_irq_intercept_in(global_qtest, \"ioapic\");\n+    irq_intercept_in(global_qtest, \"ioapic\");\n\n     /* PACKET command on device 0 */\n     qpci_io_writeb(dev, ide_bar, reg_device, 0);\n@@ -905,7 +906,7 @@ static void test_cdrom_dma(void)\n\n     ide_test_start(\"-drive if=none,file=%s,media=cdrom,format=raw,id=sr0,index=0 \"\n                    \"-device ide-cd,drive=sr0,bus=ide.0\", tmp_path);\n-    qtest_irq_intercept_in(global_qtest, \"ioapic\");\n+    irq_intercept_in(global_qtest, \"ioapic\");\n\n     guest_buf = guest_alloc(guest_malloc, len);\n     prdt[0].addr = cpu_to_le32(guest_buf);\ndiff --git a/tests/ipmi-bt-test.c b/tests/ipmi-bt-test.c\nindex 8be18e3f42..f80a9a83c9 100644\n--- a/tests/ipmi-bt-test.c\n+++ b/tests/ipmi-bt-test.c\n@@ -276,10 +276,10 @@ static void bt_cmd(uint8_t *cmd, unsigned int cmd_len,\n     bt_wait_b2h_atn();\n     if (bt_ints_enabled) {\n         g_assert((bt_get_irqreg() & 0x02) == 0x02);\n-        g_assert(get_irq(IPMI_IRQ));\n+        g_assert(get_irq(global_qtest, IPMI_IRQ));\n         bt_write_irqreg(0x03);\n     } else {\n-        g_assert(!get_irq(IPMI_IRQ));\n+        g_assert(!get_irq(global_qtest, IPMI_IRQ));\n     }\n     IPMI_BT_CTLREG_SET_H_BUSY();\n     IPMI_BT_CTLREG_SET_B2H_ATN();\n@@ -418,7 +418,7 @@ int main(int argc, char **argv)\n         \" -chardev socket,id=ipmi0,host=localhost,port=%d,reconnect=10\"\n         \" -device ipmi-bmc-extern,chardev=ipmi0,id=bmc0\"\n         \" -device isa-ipmi-bt,bmc=bmc0\", emu_port);\n-    qtest_irq_intercept_in(global_qtest, \"ioapic\");\n+    irq_intercept_in(global_qtest, \"ioapic\");\n     qtest_add_func(\"/ipmi/extern/connect\", test_connect);\n     qtest_add_func(\"/ipmi/extern/bt_base\", test_bt_base);\n     qtest_add_func(\"/ipmi/extern/bt_enable_irq\", test_enable_irq);\ndiff --git a/tests/ipmi-kcs-test.c b/tests/ipmi-kcs-test.c\nindex 5acc0d9e35..ddad8dd22f 100644\n--- a/tests/ipmi-kcs-test.c\n+++ b/tests/ipmi-kcs-test.c\n@@ -89,14 +89,14 @@ static void kcs_wait_obf(void)\n static void kcs_clear_obf(void)\n {\n     if (kcs_ints_enabled) {\n-        g_assert(get_irq(IPMI_IRQ));\n+        g_assert(get_irq(global_qtest, IPMI_IRQ));\n     } else {\n-        g_assert(!get_irq(IPMI_IRQ));\n+        g_assert(!get_irq(global_qtest, IPMI_IRQ));\n     }\n     g_assert(IPMI_KCS_CMDREG_GET_OBF() == 1);\n     kcs_get_datareg();\n     g_assert(IPMI_KCS_CMDREG_GET_OBF() == 0);\n-    g_assert(!get_irq(IPMI_IRQ));\n+    g_assert(!get_irq(global_qtest, IPMI_IRQ));\n }\n\n static void kcs_check_state(uint8_t state)\n@@ -277,7 +277,7 @@ int main(int argc, char **argv)\n\n     global_qtest = qtest_start(\"-device ipmi-bmc-sim,id=bmc0\"\n                                \" -device isa-ipmi-kcs,bmc=bmc0\");\n-    qtest_irq_intercept_in(global_qtest, \"ioapic\");\n+    irq_intercept_in(global_qtest, \"ioapic\");\n     qtest_add_func(\"/ipmi/local/kcs_base\", test_kcs_base);\n     qtest_add_func(\"/ipmi/local/kcs_abort\", test_kcs_abort);\n     qtest_add_func(\"/ipmi/local/kcs_enable_irq\", test_enable_irq);\ndiff --git a/tests/libqos/libqos-pc.c b/tests/libqos/libqos-pc.c\nindex a9c1aceaa7..df97f0cd03 100644\n--- a/tests/libqos/libqos-pc.c\n+++ b/tests/libqos/libqos-pc.c\n@@ -25,7 +25,7 @@ QOSState *qtest_pc_boot(const char *cmdline_fmt, ...)\n     qs = qtest_vboot(&qos_ops, cmdline_fmt, ap);\n     va_end(ap);\n\n-    qtest_irq_intercept_in(qs->qts, \"ioapic\");\n+    irq_intercept_in(qs->qts, \"ioapic\");\n\n     return qs;\n }\ndiff --git a/tests/rtc-test.c b/tests/rtc-test.c\nindex 9b98e2d494..8ff201993e 100644\n--- a/tests/rtc-test.c\n+++ b/tests/rtc-test.c\n@@ -277,7 +277,7 @@ static void alarm_time(void)\n     /* set DEC mode */\n     cmos_write(RTC_REG_B, REG_B_24H | REG_B_DM);\n\n-    g_assert(!get_irq(RTC_ISA_IRQ));\n+    g_assert(!get_irq(global_qtest, RTC_ISA_IRQ));\n     cmos_read(RTC_REG_C);\n\n     now.tm_sec = (now.tm_sec + 2) % 60;\n@@ -287,14 +287,14 @@ static void alarm_time(void)\n     cmos_write(RTC_REG_B, cmos_read(RTC_REG_B) | REG_B_AIE);\n\n     for (i = 0; i < 2 + wiggle; i++) {\n-        if (get_irq(RTC_ISA_IRQ)) {\n+        if (get_irq(global_qtest, RTC_ISA_IRQ)) {\n             break;\n         }\n\n         clock_step(global_qtest, 1000000000);\n     }\n\n-    g_assert(get_irq(RTC_ISA_IRQ));\n+    g_assert(get_irq(global_qtest, RTC_ISA_IRQ));\n     g_assert((cmos_read(RTC_REG_C) & REG_C_AF) != 0);\n     g_assert(cmos_read(RTC_REG_C) == 0);\n }\n@@ -644,7 +644,7 @@ static void uip_stuck(void)\n\n static uint64_t wait_periodic_interrupt(uint64_t real_time)\n {\n-    while (!get_irq(RTC_ISA_IRQ)) {\n+    while (!get_irq(global_qtest, RTC_ISA_IRQ)) {\n         real_time = clock_step_next(global_qtest);\n     }\n\n@@ -691,7 +691,7 @@ int main(int argc, char **argv)\n     g_test_init(&argc, &argv, NULL);\n\n     s = global_qtest = qtest_start(\"-rtc clock=vm\");\n-    qtest_irq_intercept_in(s, \"ioapic\");\n+    irq_intercept_in(s, \"ioapic\");\n\n     qtest_add_func(\"/rtc/check-time/bcd\", bcd_check_time);\n     qtest_add_func(\"/rtc/check-time/dec\", dec_check_time);\ndiff --git a/tests/tco-test.c b/tests/tco-test.c\nindex 27e982d8ac..c2abbeeaac 100644\n--- a/tests/tco-test.c\n+++ b/tests/tco-test.c\n@@ -60,7 +60,7 @@ static void test_init(TestData *d)\n                       d->noreboot ? \"\" : \"-global ICH9-LPC.noreboot=false\",\n                       !d->args ? \"\" : d->args);\n     global_qtest = qs;\n-    qtest_irq_intercept_in(qs, \"ioapic\");\n+    irq_intercept_in(qs, \"ioapic\");\n\n     d->bus = qpci_init_pc(qs, NULL);\n     d->dev = qpci_device_find(d->bus, QPCI_DEVFN(0x1f, 0x00));\ndiff --git a/tests/wdt_ib700-test.c b/tests/wdt_ib700-test.c\nindex 05690e5159..5ce8f4a08a 100644\n--- a/tests/wdt_ib700-test.c\n+++ b/tests/wdt_ib700-test.c\n@@ -58,7 +58,7 @@ static void ib700_pause(void)\n     QDict *d;\n     QTestState *s = qtest_start(\"-watchdog-action pause -device ib700\");\n\n-    qtest_irq_intercept_in(s, \"ioapic\");\n+    irq_intercept_in(s, \"ioapic\");\n     d = ib700_program_and_wait(s);\n     g_assert(!strcmp(qdict_get_str(d, \"action\"), \"pause\"));\n     QDECREF(d);\n@@ -71,7 +71,7 @@ static void ib700_reset(void)\n     QDict *d;\n     QTestState *s = qtest_start(\"-watchdog-action reset -device ib700\");\n\n-    qtest_irq_intercept_in(s, \"ioapic\");\n+    irq_intercept_in(s, \"ioapic\");\n     d = ib700_program_and_wait(s);\n     g_assert(!strcmp(qdict_get_str(d, \"action\"), \"reset\"));\n     QDECREF(d);\n@@ -85,7 +85,7 @@ static void ib700_shutdown(void)\n     QTestState *s;\n\n     s = qtest_start(\"-watchdog-action reset -no-reboot -device ib700\");\n-    qtest_irq_intercept_in(s, \"ioapic\");\n+    irq_intercept_in(s, \"ioapic\");\n     d = ib700_program_and_wait(s);\n     g_assert(!strcmp(qdict_get_str(d, \"action\"), \"reset\"));\n     QDECREF(d);\n@@ -98,7 +98,7 @@ static void ib700_none(void)\n     QDict *d;\n     QTestState *s = qtest_start(\"-watchdog-action none -device ib700\");\n\n-    qtest_irq_intercept_in(s, \"ioapic\");\n+    irq_intercept_in(s, \"ioapic\");\n     d = ib700_program_and_wait(s);\n     g_assert(!strcmp(qdict_get_str(d, \"action\"), \"none\"));\n     QDECREF(d);\n",
    "prefixes": [
        "v7",
        "32/38"
    ]
}