get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 812517,
    "url": "http://patchwork.ozlabs.org/api/patches/812517/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170911172022.4738-36-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-36-eblake@redhat.com>",
    "list_archive_url": null,
    "date": "2017-09-11T17:20:19",
    "name": "[v7,35/38] libqtest: Merge qtest_{mem, buf}{read, write}() with {mem, buf}{read, write}()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "71013786fdaae9d8eebeae824be9d54bbecf92e9",
    "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-36-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/812517/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/812517/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-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com",
            "ext-mx06.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 3xrbJ02mWwz9s7F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 03:58:08 +1000 (AEST)",
            "from localhost ([::1]:59537 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 1drSyE-000873-Af\n\tfor incoming@patchwork.ozlabs.org; Mon, 11 Sep 2017 13:58:06 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:39319)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1drSPg-00007c-Nv\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:22:28 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1drSPd-0001oO-4s\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:22:24 -0400",
            "from mx1.redhat.com ([209.132.183.28]:46920)\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 1drSPV-0001iv-Kf; Mon, 11 Sep 2017 13:22:13 -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 A1B72254A5;\n\tMon, 11 Sep 2017 17:22:12 +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 7F9885D9CA;\n\tMon, 11 Sep 2017 17:22:06 +0000 (UTC)"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com A1B72254A5",
        "From": "Eric Blake <eblake@redhat.com>",
        "To": "qemu-devel@nongnu.org",
        "Date": "Mon, 11 Sep 2017 12:20:19 -0500",
        "Message-Id": "<20170911172022.4738-36-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.30]);\n\tMon, 11 Sep 2017 17:22:12 +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 35/38] libqtest: Merge qtest_{mem, buf}{read,\n\twrite}() with {mem, buf}{read, write}()",
        "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": "thuth@redhat.com, \"open list:IDE\" <qemu-block@nongnu.org>,\n\tJason Wang <jasowang@redhat.com>, armbru@redhat.com,\n\tAlexander Graf <agraf@suse.de>, Greg Kurz <groug@kaod.org>,\n\t\"open list:sPAPR\" <qemu-ppc@nongnu.org>,\n\t\"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com>,\n\tStefan Hajnoczi <stefanha@redhat.com>, pbonzini@redhat.com,\n\tJohn Snow <jsnow@redhat.com>, David Gibson <david@gibson.dropbear.id.au>",
        "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_memread()\n qtest_bufread()\n qtest_memwrite()\n qtest_bufwrite()\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         | 69 ++++++------------------------------------------\n tests/libqtest.c         |  8 +++---\n tests/ahci-test.c        | 16 +++++------\n tests/e1000e-test.c      | 16 ++++++-----\n tests/i440fx-test.c      |  8 +++---\n tests/ide-test.c         | 14 +++++-----\n tests/libqos/ahci.c      | 22 +++++++--------\n tests/libqos/pci-pc.c    |  4 +--\n tests/libqos/pci-spapr.c |  4 +--\n tests/megasas-test.c     |  2 +-\n tests/postcopy-test.c    | 12 ++++-----\n tests/virtio-9p-test.c   |  4 +--\n tests/virtio-blk-test.c  | 16 +++++------\n tests/virtio-net-test.c  |  6 ++---\n tests/virtio-scsi-test.c |  4 +--\n 15 files changed, 78 insertions(+), 127 deletions(-)",
    "diff": "diff --git a/tests/libqtest.h b/tests/libqtest.h\nindex d0c487cf79..adf04327b7 100644\n--- a/tests/libqtest.h\n+++ b/tests/libqtest.h\n@@ -346,7 +346,7 @@ uint32_t readl(QTestState *s, uint64_t addr);\n uint64_t readq(QTestState *s, uint64_t addr);\n\n /**\n- * qtest_memread:\n+ * memread:\n  * @s: #QTestState instance to operate on.\n  * @addr: Guest address to read from.\n  * @data: Pointer to where memory contents will be stored.\n@@ -354,7 +354,7 @@ uint64_t readq(QTestState *s, uint64_t addr);\n  *\n  * Read guest memory into a buffer.\n  */\n-void qtest_memread(QTestState *s, uint64_t addr, void *data, size_t size);\n+void memread(QTestState *s, uint64_t addr, void *data, size_t size);\n\n /**\n  * qtest_rtas_call:\n@@ -372,7 +372,7 @@ uint64_t qtest_rtas_call(QTestState *s, const char *name,\n                          uint32_t nret, uint64_t ret);\n\n /**\n- * qtest_bufread:\n+ * bufread:\n  * @s: #QTestState instance to operate on.\n  * @addr: Guest address to read from.\n  * @data: Pointer to where memory contents will be stored.\n@@ -380,10 +380,10 @@ uint64_t qtest_rtas_call(QTestState *s, const char *name,\n  *\n  * Read guest memory into a buffer and receive using a base64 encoding.\n  */\n-void qtest_bufread(QTestState *s, uint64_t addr, void *data, size_t size);\n+void bufread(QTestState *s, uint64_t addr, void *data, size_t size);\n\n /**\n- * qtest_memwrite:\n+ * memwrite:\n  * @s: #QTestState instance to operate on.\n  * @addr: Guest address to write to.\n  * @data: Pointer to the bytes that will be written to guest memory.\n@@ -391,10 +391,10 @@ void qtest_bufread(QTestState *s, uint64_t addr, void *data, size_t size);\n  *\n  * Write a buffer to guest memory.\n  */\n-void qtest_memwrite(QTestState *s, uint64_t addr, const void *data, size_t size);\n+void memwrite(QTestState *s, uint64_t addr, const void *data, size_t size);\n\n /**\n- * qtest_bufwrite:\n+ * bufwrite:\n  * @s: #QTestState instance to operate on.\n  * @addr: Guest address to write to.\n  * @data: Pointer to the bytes that will be written to guest memory.\n@@ -402,8 +402,7 @@ void qtest_memwrite(QTestState *s, uint64_t addr, const void *data, size_t size)\n  *\n  * Write a buffer to guest memory and transmit using a base64 encoding.\n  */\n-void qtest_bufwrite(QTestState *s, uint64_t addr,\n-                    const void *data, size_t size);\n+void bufwrite(QTestState *s, uint64_t addr, const void *data, size_t size);\n\n /**\n  * qtest_memset:\n@@ -594,58 +593,6 @@ static inline QDict *qmp_eventwait_ref(const char *event)\n char *hmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2);\n\n /**\n- * memread:\n- * @addr: Guest address to read from.\n- * @data: Pointer to where memory contents will be stored.\n- * @size: Number of bytes to read.\n- *\n- * Read guest memory into a buffer.\n- */\n-static inline void memread(uint64_t addr, void *data, size_t size)\n-{\n-    qtest_memread(global_qtest, addr, data, size);\n-}\n-\n-/**\n- * bufread:\n- * @addr: Guest address to read from.\n- * @data: Pointer to where memory contents will be stored.\n- * @size: Number of bytes to read.\n- *\n- * Read guest memory into a buffer, receive using a base64 encoding.\n- */\n-static inline void bufread(uint64_t addr, void *data, size_t size)\n-{\n-    qtest_bufread(global_qtest, addr, data, size);\n-}\n-\n-/**\n- * memwrite:\n- * @addr: Guest address to write to.\n- * @data: Pointer to the bytes that will be written to guest memory.\n- * @size: Number of bytes to write.\n- *\n- * Write a buffer to guest memory.\n- */\n-static inline void memwrite(uint64_t addr, const void *data, size_t size)\n-{\n-    qtest_memwrite(global_qtest, addr, data, size);\n-}\n-\n-/**\n- * bufwrite:\n- * @addr: Guest address to write to.\n- * @data: Pointer to the bytes that will be written to guest memory.\n- * @size: Number of bytes to write.\n- *\n- * Write a buffer to guest memory, transmit using a base64 encoding.\n- */\n-static inline void bufwrite(uint64_t addr, const void *data, size_t size)\n-{\n-    qtest_bufwrite(global_qtest, addr, data, size);\n-}\n-\n-/**\n  * qmemset:\n  * @addr: Guest address to write to.\n  * @patt: Byte pattern to fill the guest memory region with.\ndiff --git a/tests/libqtest.c b/tests/libqtest.c\nindex d9d0402287..a52dc635f4 100644\n--- a/tests/libqtest.c\n+++ b/tests/libqtest.c\n@@ -822,7 +822,7 @@ static int hex2nib(char ch)\n     }\n }\n\n-void qtest_memread(QTestState *s, uint64_t addr, void *data, size_t size)\n+void memread(QTestState *s, uint64_t addr, void *data, size_t size)\n {\n     uint8_t *ptr = data;\n     gchar **args;\n@@ -877,7 +877,7 @@ void qtest_add_data_func(const char *str, const void *data,\n     g_free(path);\n }\n\n-void qtest_bufwrite(QTestState *s, uint64_t addr, const void *data, size_t size)\n+void bufwrite(QTestState *s, uint64_t addr, const void *data, size_t size)\n {\n     gchar *bdata;\n\n@@ -889,7 +889,7 @@ void qtest_bufwrite(QTestState *s, uint64_t addr, const void *data, size_t size)\n     g_free(bdata);\n }\n\n-void qtest_bufread(QTestState *s, uint64_t addr, void *data, size_t size)\n+void bufread(QTestState *s, uint64_t addr, void *data, size_t size)\n {\n     gchar **args;\n     size_t len;\n@@ -908,7 +908,7 @@ void qtest_bufread(QTestState *s, uint64_t addr, void *data, size_t size)\n     g_strfreev(args);\n }\n\n-void qtest_memwrite(QTestState *s, uint64_t addr, const void *data, size_t size)\n+void memwrite(QTestState *s, uint64_t addr, const void *data, size_t size)\n {\n     const uint8_t *ptr = data;\n     size_t i;\ndiff --git a/tests/ahci-test.c b/tests/ahci-test.c\nindex 7c94c4920b..4b5f0b23fb 100644\n--- a/tests/ahci-test.c\n+++ b/tests/ahci-test.c\n@@ -869,7 +869,7 @@ static void ahci_test_io_rw_simple(AHCIQState *ahci, unsigned bufsize,\n\n     /* Write some indicative pattern to our buffer. */\n     generate_pattern(tx, bufsize, AHCI_SECTOR_SIZE);\n-    qtest_bufwrite(ahci->parent->qts, ptr, tx, bufsize);\n+    bufwrite(ahci->parent->qts, ptr, tx, bufsize);\n\n     /* Write this buffer to disk, then read it back to the DMA buffer. */\n     ahci_guest_io(ahci, port, write_cmd, ptr, bufsize, sector);\n@@ -877,7 +877,7 @@ static void ahci_test_io_rw_simple(AHCIQState *ahci, unsigned bufsize,\n     ahci_guest_io(ahci, port, read_cmd, ptr, bufsize, sector);\n\n     /*** Read back the Data ***/\n-    qtest_bufread(ahci->parent->qts, ptr, rx, bufsize);\n+    bufread(ahci->parent->qts, ptr, rx, bufsize);\n     g_assert_cmphex(memcmp(tx, rx, bufsize), ==, 0);\n\n     ahci_free(ahci, ptr);\n@@ -918,7 +918,7 @@ static void ahci_test_max(AHCIQState *ahci)\n     }\n\n     port = ahci_test_nondata(ahci, cmd);\n-    qtest_memread(ahci->parent->qts, ahci->port[port].fb + 0x40, d2h, 0x20);\n+    memread(ahci->parent->qts, ahci->port[port].fb + 0x40, d2h, 0x20);\n     nsect = (uint64_t)d2h->lba_hi[2] << 40 |\n         (uint64_t)d2h->lba_hi[1] << 32 |\n         (uint64_t)d2h->lba_hi[0] << 24 |\n@@ -1036,7 +1036,7 @@ static void test_dma_fragmented(void)\n     /* Create a DMA buffer in guest memory, and write our pattern to it. */\n     ptr = guest_alloc(ahci->parent->alloc, bufsize);\n     g_assert(ptr);\n-    qtest_bufwrite(ahci->parent->qts, ptr, tx, bufsize);\n+    bufwrite(ahci->parent->qts, ptr, tx, bufsize);\n\n     cmd = ahci_command_create(CMD_WRITE_DMA);\n     ahci_command_adjust(cmd, 0, ptr, bufsize, 32);\n@@ -1053,7 +1053,7 @@ static void test_dma_fragmented(void)\n     ahci_command_free(cmd);\n\n     /* Read back the guest's receive buffer into local memory */\n-    qtest_bufread(ahci->parent->qts, ptr, rx, bufsize);\n+    bufread(ahci->parent->qts, ptr, rx, bufsize);\n     guest_free(ahci->parent->alloc, ptr);\n\n     g_assert_cmphex(memcmp(tx, rx, bufsize), ==, 0);\n@@ -1231,7 +1231,7 @@ static void ahci_halted_io_test(uint8_t cmd_read, uint8_t cmd_write)\n     generate_pattern(tx, bufsize, AHCI_SECTOR_SIZE);\n     ptr = ahci_alloc(ahci, bufsize);\n     g_assert(ptr);\n-    qtest_memwrite(ahci->parent->qts, ptr, tx, bufsize);\n+    memwrite(ahci->parent->qts, ptr, tx, bufsize);\n\n     /* Attempt to write (and fail) */\n     cmd = ahci_guest_io_halt(ahci, port, cmd_write,\n@@ -1305,7 +1305,7 @@ static void ahci_migrate_halted_io(uint8_t cmd_read, uint8_t cmd_write)\n     /* create DMA source buffer and write pattern */\n     ptr = ahci_alloc(src, bufsize);\n     g_assert(ptr);\n-    qtest_memwrite(src->parent->qts, ptr, tx, bufsize);\n+    memwrite(src->parent->qts, ptr, tx, bufsize);\n\n     /* Write, trigger the VM to stop, migrate, then resume. */\n     cmd = ahci_guest_io_halt(src, port, cmd_write,\n@@ -1472,7 +1472,7 @@ static int ahci_cb_cmp_buff(AHCIQState *ahci, AHCICommand *cmd,\n     }\n\n     rx = g_malloc0(opts->size);\n-    qtest_bufread(ahci->parent->qts, opts->buffer, rx, opts->size);\n+    bufread(ahci->parent->qts, opts->buffer, rx, opts->size);\n     g_assert_cmphex(memcmp(tx, rx, opts->size), ==, 0);\n     g_free(rx);\n\ndiff --git a/tests/e1000e-test.c b/tests/e1000e-test.c\nindex f4ead74f96..1e39d98e4a 100644\n--- a/tests/e1000e-test.c\n+++ b/tests/e1000e-test.c\n@@ -202,11 +202,13 @@ static void e1000e_tx_ring_push(e1000e_device *d, void *descr)\n     uint32_t tail = e1000e_macreg_read(d, E1000E_TDT);\n     uint32_t len = e1000e_macreg_read(d, E1000E_TDLEN) / E1000E_TXD_LEN;\n\n-    memwrite(d->tx_ring + tail * E1000E_TXD_LEN, descr, E1000E_TXD_LEN);\n+    memwrite(global_qtest, d->tx_ring + tail * E1000E_TXD_LEN, descr,\n+             E1000E_TXD_LEN);\n     e1000e_macreg_write(d, E1000E_TDT, (tail + 1) % len);\n\n     /* Read WB data for the packet transmitted */\n-    memread(d->tx_ring + tail * E1000E_TXD_LEN, descr, E1000E_TXD_LEN);\n+    memread(global_qtest, d->tx_ring + tail * E1000E_TXD_LEN, descr,\n+            E1000E_TXD_LEN);\n }\n\n static void e1000e_rx_ring_push(e1000e_device *d, void *descr)\n@@ -214,11 +216,13 @@ static void e1000e_rx_ring_push(e1000e_device *d, void *descr)\n     uint32_t tail = e1000e_macreg_read(d, E1000E_RDT);\n     uint32_t len = e1000e_macreg_read(d, E1000E_RDLEN) / E1000E_RXD_LEN;\n\n-    memwrite(d->rx_ring + tail * E1000E_RXD_LEN, descr, E1000E_RXD_LEN);\n+    memwrite(global_qtest, d->rx_ring + tail * E1000E_RXD_LEN, descr,\n+             E1000E_RXD_LEN);\n     e1000e_macreg_write(d, E1000E_RDT, (tail + 1) % len);\n\n     /* Read WB data for the packet received */\n-    memread(d->rx_ring + tail * E1000E_RXD_LEN, descr, E1000E_RXD_LEN);\n+    memread(global_qtest, d->rx_ring + tail * E1000E_RXD_LEN, descr,\n+            E1000E_RXD_LEN);\n }\n\n static void e1000e_wait_isr(e1000e_device *d, uint16_t msg_id)\n@@ -269,7 +273,7 @@ static void e1000e_send_verify(e1000e_device *d)\n\n     /* Prepare test data buffer */\n     uint64_t data = guest_alloc(test_alloc, data_len);\n-    memwrite(data, \"TEST\", 5);\n+    memwrite(global_qtest, data, \"TEST\", 5);\n\n     /* Prepare TX descriptor */\n     memset(&descr, 0, sizeof(descr));\n@@ -365,7 +369,7 @@ static void e1000e_receive_verify(e1000e_device *d)\n         esta_dd, ==, esta_dd);\n\n     /* Check data sent to the backend */\n-    memread(data, buffer, sizeof(buffer));\n+    memread(global_qtest, data, buffer, sizeof(buffer));\n     g_assert_cmpstr(buffer, == , \"TEST\");\n\n     /* Free test data buffer */\ndiff --git a/tests/i440fx-test.c b/tests/i440fx-test.c\nindex 1d78089f8e..804c8ca9a8 100644\n--- a/tests/i440fx-test.c\n+++ b/tests/i440fx-test.c\n@@ -160,7 +160,7 @@ static gboolean verify_area(uint32_t start, uint32_t end, uint8_t value)\n     int i;\n\n     data = g_malloc0(size);\n-    memread(start, data, size);\n+    memread(global_qtest, start, data, size);\n\n     g_test_message(\"verify_area: data[0] = 0x%x\", data[0]);\n\n@@ -183,7 +183,7 @@ static void write_area(uint32_t start, uint32_t end, uint8_t value)\n\n     data = g_malloc(size);\n     memset(data, value, size);\n-    memwrite(start, data, size);\n+    memwrite(global_qtest, start, data, size);\n\n     g_free(data);\n }\n@@ -354,7 +354,7 @@ static void test_i440fx_firmware(FirmwareTestFixture *fixture,\n\n     /* check below 4G */\n     buf = g_malloc0(BLOB_SIZE);\n-    memread(0x100000000ULL - BLOB_SIZE, buf, BLOB_SIZE);\n+    memread(global_qtest, 0x100000000ULL - BLOB_SIZE, buf, BLOB_SIZE);\n     for (i = 0; i < BLOB_SIZE; ++i) {\n         g_assert_cmphex(buf[i], ==, (uint8_t)i);\n     }\n@@ -362,7 +362,7 @@ static void test_i440fx_firmware(FirmwareTestFixture *fixture,\n     /* check in ISA space too */\n     memset(buf, 0, BLOB_SIZE);\n     isa_bios_size = ISA_BIOS_MAXSZ < BLOB_SIZE ? ISA_BIOS_MAXSZ : BLOB_SIZE;\n-    memread(0x100000 - isa_bios_size, buf, isa_bios_size);\n+    memread(global_qtest, 0x100000 - isa_bios_size, buf, isa_bios_size);\n     for (i = 0; i < isa_bios_size; ++i) {\n         g_assert_cmphex(buf[i], ==,\n                         (uint8_t)((BLOB_SIZE - isa_bios_size) + i));\ndiff --git a/tests/ide-test.c b/tests/ide-test.c\nindex c22dde55c1..c47cbb1949 100644\n--- a/tests/ide-test.c\n+++ b/tests/ide-test.c\n@@ -222,7 +222,7 @@ static int send_dma_request(int cmd, uint64_t sector, int nb_sectors,\n     /* Setup PRDT */\n     len = sizeof(*prdt) * prdt_entries;\n     guest_prdt = guest_alloc(guest_malloc, len);\n-    memwrite(guest_prdt, prdt, len);\n+    memwrite(global_qtest, guest_prdt, prdt, len);\n     qpci_io_writel(dev, bmdma_bar, bmreg_prdt, guest_prdt);\n\n     /* ATA DMA command */\n@@ -299,7 +299,7 @@ static void test_bmdma_simple_rw(void)\n\n     /* Write 0x55 pattern to sector 0 */\n     memset(buf, 0x55, len);\n-    memwrite(guest_buf, buf, len);\n+    memwrite(global_qtest, guest_buf, buf, len);\n\n     status = send_dma_request(CMD_WRITE_DMA, 0, 1, prdt,\n                               ARRAY_SIZE(prdt), NULL);\n@@ -308,7 +308,7 @@ static void test_bmdma_simple_rw(void)\n\n     /* Write 0xaa pattern to sector 1 */\n     memset(buf, 0xaa, len);\n-    memwrite(guest_buf, buf, len);\n+    memwrite(global_qtest, guest_buf, buf, len);\n\n     status = send_dma_request(CMD_WRITE_DMA, 1, 1, prdt,\n                               ARRAY_SIZE(prdt), NULL);\n@@ -322,7 +322,7 @@ static void test_bmdma_simple_rw(void)\n     g_assert_cmphex(status, ==, BM_STS_INTR);\n     assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), DF | ERR);\n\n-    memread(guest_buf, buf, len);\n+    memread(global_qtest, guest_buf, buf, len);\n     g_assert(memcmp(buf, cmpbuf, len) == 0);\n\n     /* Read and verify 0xaa pattern in sector 1 */\n@@ -332,7 +332,7 @@ static void test_bmdma_simple_rw(void)\n     g_assert_cmphex(status, ==, BM_STS_INTR);\n     assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), DF | ERR);\n\n-    memread(guest_buf, buf, len);\n+    memread(global_qtest, guest_buf, buf, len);\n     g_assert(memcmp(buf, cmpbuf, len) == 0);\n\n\n@@ -551,7 +551,7 @@ static void make_dirty(uint8_t device)\n     g_assert(guest_buf);\n     g_assert(buf);\n\n-    memwrite(guest_buf, buf, len);\n+    memwrite(global_qtest, guest_buf, buf, len);\n\n     PrdtEntry prdt[] = {\n         {\n@@ -921,7 +921,7 @@ static void test_cdrom_dma(void)\n     send_dma_request(CMD_PACKET, 0, 1, prdt, 1, send_scsi_cdb_read10);\n\n     /* Read back data from guest memory into local qtest memory */\n-    memread(guest_buf, rx, len);\n+    memread(global_qtest, guest_buf, rx, len);\n     g_assert_cmpint(memcmp(pattern, rx, len), ==, 0);\n\n     g_free(pattern);\ndiff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c\nindex ba79cd77a0..433952c11a 100644\n--- a/tests/libqos/ahci.c\n+++ b/tests/libqos/ahci.c\n@@ -467,7 +467,7 @@ void ahci_port_check_d2h_sanity(AHCIQState *ahci, uint8_t port, uint8_t slot)\n     RegD2HFIS *d2h = g_malloc0(0x20);\n     uint32_t reg;\n\n-    qtest_memread(ahci->parent->qts, ahci->port[port].fb + 0x40, d2h, 0x20);\n+    memread(ahci->parent->qts, ahci->port[port].fb + 0x40, d2h, 0x20);\n     g_assert_cmphex(d2h->fis_type, ==, 0x34);\n\n     reg = ahci_px_rreg(ahci, port, AHCI_PX_TFD);\n@@ -485,7 +485,7 @@ void ahci_port_check_pio_sanity(AHCIQState *ahci, uint8_t port,\n     /* We cannot check the Status or E_Status registers, because\n      * the status may have again changed between the PIO Setup FIS\n      * and the conclusion of the command with the D2H Register FIS. */\n-    qtest_memread(ahci->parent->qts, ahci->port[port].fb + 0x20, pio, 0x20);\n+    memread(ahci->parent->qts, ahci->port[port].fb + 0x20, pio, 0x20);\n     g_assert_cmphex(pio->fis_type, ==, 0x5f);\n\n     /* BUG: PIO Setup FIS as utilized by QEMU tries to fit the entire\n@@ -517,7 +517,7 @@ void ahci_get_command_header(AHCIQState *ahci, uint8_t port,\n {\n     uint64_t ba = ahci->port[port].clb;\n     ba += slot * sizeof(AHCICommandHeader);\n-    qtest_memread(ahci->parent->qts, ba, cmd, sizeof(AHCICommandHeader));\n+    memread(ahci->parent->qts, ba, cmd, sizeof(AHCICommandHeader));\n\n     cmd->flags = le16_to_cpu(cmd->flags);\n     cmd->prdtl = le16_to_cpu(cmd->prdtl);\n@@ -538,7 +538,7 @@ void ahci_set_command_header(AHCIQState *ahci, uint8_t port,\n     tmp.prdbc = cpu_to_le32(cmd->prdbc);\n     tmp.ctba = cpu_to_le64(cmd->ctba);\n\n-    qtest_memwrite(ahci->parent->qts, ba, &tmp, sizeof(AHCICommandHeader));\n+    memwrite(ahci->parent->qts, ba, &tmp, sizeof(AHCICommandHeader));\n }\n\n void ahci_destroy_command(AHCIQState *ahci, uint8_t port, uint8_t slot)\n@@ -576,7 +576,7 @@ void ahci_write_fis(AHCIQState *ahci, AHCICommand *cmd)\n         tmp.count = cpu_to_le16(tmp.count);\n     }\n\n-    qtest_memwrite(ahci->parent->qts, addr, &tmp, sizeof(tmp));\n+    memwrite(ahci->parent->qts, addr, &tmp, sizeof(tmp));\n }\n\n unsigned ahci_pick_cmd(AHCIQState *ahci, uint8_t port)\n@@ -758,13 +758,13 @@ void ahci_io(AHCIQState *ahci, uint8_t port, uint8_t ide_cmd,\n     qtest_memset(ahci->parent->qts, ptr, 0x00, bufsize);\n\n     if (bufsize && props->write) {\n-        qtest_bufwrite(ahci->parent->qts, ptr, buffer, bufsize);\n+        bufwrite(ahci->parent->qts, ptr, buffer, bufsize);\n     }\n\n     ahci_guest_io(ahci, port, ide_cmd, ptr, bufsize, sector);\n\n     if (bufsize && props->read) {\n-        qtest_bufread(ahci->parent->qts, ptr, buffer, bufsize);\n+        bufread(ahci->parent->qts, ptr, buffer, bufsize);\n     }\n\n     ahci_free(ahci, ptr);\n@@ -902,7 +902,7 @@ static int copy_buffer(AHCIQState *ahci, AHCICommand *cmd,\n                         const AHCIOpts *opts)\n {\n     unsigned char *rx = opts->opaque;\n-    qtest_bufread(ahci->parent->qts, opts->buffer, rx, opts->size);\n+    bufread(ahci->parent->qts, opts->buffer, rx, opts->size);\n     return 0;\n }\n\n@@ -1142,7 +1142,7 @@ void ahci_command_commit(AHCIQState *ahci, AHCICommand *cmd, uint8_t port)\n     ahci_write_fis(ahci, cmd);\n     /* Then ATAPI CMD, if needed */\n     if (cmd->props->atapi) {\n-        qtest_memwrite(ahci->parent->qts, table_ptr + 0x40, cmd->atapi_cmd, 16);\n+        memwrite(ahci->parent->qts, table_ptr + 0x40, cmd->atapi_cmd, 16);\n     }\n\n     /* Construct and write the PRDs to the command table */\n@@ -1163,8 +1163,8 @@ void ahci_command_commit(AHCIQState *ahci, AHCICommand *cmd, uint8_t port)\n         prd.dbc |= cpu_to_le32(0x80000000); /* Request DPS Interrupt */\n\n         /* Commit the PRD entry to the Command Table */\n-        qtest_memwrite(ahci->parent->qts, table_ptr + 0x80 + (i * sizeof(PRD)),\n-                       &prd, sizeof(PRD));\n+        memwrite(ahci->parent->qts, table_ptr + 0x80 + (i * sizeof(PRD)),\n+                 &prd, sizeof(PRD));\n     }\n\n     /* Bookmark the PRDTL and CTBA values */\ndiff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c\nindex 4d8329bef0..aa4d5b3c43 100644\n--- a/tests/libqos/pci-pc.c\n+++ b/tests/libqos/pci-pc.c\n@@ -68,13 +68,13 @@ static void qpci_pc_pio_writeq(QPCIBus *bus, uint32_t addr, uint64_t val)\n\n static void qpci_pc_memread(QPCIBus *bus, uint32_t addr, void *buf, size_t len)\n {\n-    qtest_memread(bus->qts, addr, buf, len);\n+    memread(bus->qts, addr, buf, len);\n }\n\n static void qpci_pc_memwrite(QPCIBus *bus, uint32_t addr,\n                              const void *buf, size_t len)\n {\n-    qtest_memwrite(bus->qts, addr, buf, len);\n+    memwrite(bus->qts, addr, buf, len);\n }\n\n static uint8_t qpci_pc_config_readb(QPCIBus *bus, int devfn, uint8_t offset)\ndiff --git a/tests/libqos/pci-spapr.c b/tests/libqos/pci-spapr.c\nindex 7bae94e9bd..5d9f7c3494 100644\n--- a/tests/libqos/pci-spapr.c\n+++ b/tests/libqos/pci-spapr.c\n@@ -94,14 +94,14 @@ static void qpci_spapr_memread(QPCIBus *bus, uint32_t addr,\n                                void *buf, size_t len)\n {\n     QPCIBusSPAPR *s = container_of(bus, QPCIBusSPAPR, bus);\n-    qtest_memread(bus->qts, s->mmio32_cpu_base + addr, buf, len);\n+    memread(bus->qts, s->mmio32_cpu_base + addr, buf, len);\n }\n\n static void qpci_spapr_memwrite(QPCIBus *bus, uint32_t addr,\n                                 const void *buf, size_t len)\n {\n     QPCIBusSPAPR *s = container_of(bus, QPCIBusSPAPR, bus);\n-    qtest_memwrite(bus->qts, s->mmio32_cpu_base + addr, buf, len);\n+    memwrite(bus->qts, s->mmio32_cpu_base + addr, buf, len);\n }\n\n static uint8_t qpci_spapr_config_readb(QPCIBus *bus, int devfn, uint8_t offset)\ndiff --git a/tests/megasas-test.c b/tests/megasas-test.c\nindex 81837e14af..7f16630e52 100644\n--- a/tests/megasas-test.c\n+++ b/tests/megasas-test.c\n@@ -72,7 +72,7 @@ static void megasas_pd_get_info_fuzz(void)\n     context[7] = cpu_to_le32(0);\n\n     context_pa = qmalloc(qs, sizeof(context));\n-    memwrite(context_pa, context, sizeof(context));\n+    memwrite(global_qtest, context_pa, context, sizeof(context));\n     qpci_io_writel(dev, bar, 0x40, context_pa);\n\n     g_free(dev);\ndiff --git a/tests/postcopy-test.c b/tests/postcopy-test.c\nindex efee20a099..04889b8078 100644\n--- a/tests/postcopy-test.c\n+++ b/tests/postcopy-test.c\n@@ -320,13 +320,13 @@ static void check_guests_ram(QTestState *qts)\n     bool hit_edge = false;\n     bool bad = false;\n\n-    qtest_memread(qts, start_address, &first_byte, 1);\n+    memread(qts, start_address, &first_byte, 1);\n     last_byte = first_byte;\n\n     for (address = start_address + 4096; address < end_address; address += 4096)\n     {\n         uint8_t b;\n-        qtest_memread(qts, address, &b, 1);\n+        memread(qts, address, &b, 1);\n         if (b != last_byte) {\n             if (((b + 1) % 256) == last_byte && !hit_edge) {\n                 /* This is OK, the guest stopped at the point of\n@@ -470,19 +470,19 @@ static void test_migrate(void)\n\n     qtest_quit(from);\n\n-    qtest_memread(to, start_address, &dest_byte_a, 1);\n+    memread(to, start_address, &dest_byte_a, 1);\n\n     /* Destination still running, wait for a byte to change */\n     do {\n-        qtest_memread(to, start_address, &dest_byte_b, 1);\n+        memread(to, start_address, &dest_byte_b, 1);\n         usleep(10 * 1000);\n     } while (dest_byte_a == dest_byte_b);\n\n     qtest_qmp_discard_response(to, \"{ 'execute' : 'stop'}\");\n     /* With it stopped, check nothing changes */\n-    qtest_memread(to, start_address, &dest_byte_c, 1);\n+    memread(to, start_address, &dest_byte_c, 1);\n     sleep(1);\n-    qtest_memread(to, start_address, &dest_byte_d, 1);\n+    memread(to, start_address, &dest_byte_d, 1);\n     g_assert_cmpint(dest_byte_c, ==, dest_byte_d);\n\n     check_guests_ram(to);\ndiff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c\nindex 07cbb7f37c..e2a14bc2ff 100644\n--- a/tests/virtio-9p-test.c\n+++ b/tests/virtio-9p-test.c\n@@ -116,7 +116,7 @@ typedef struct {\n\n static void v9fs_memwrite(P9Req *req, const void *addr, size_t len)\n {\n-    memwrite(req->t_msg + req->t_off, addr, len);\n+    memwrite(global_qtest, req->t_msg + req->t_off, addr, len);\n     req->t_off += len;\n }\n\n@@ -132,7 +132,7 @@ static void v9fs_memrewind(P9Req *req, size_t len)\n\n static void v9fs_memread(P9Req *req, void *addr, size_t len)\n {\n-    memread(req->r_msg + req->r_off, addr, len);\n+    memread(global_qtest, req->r_msg + req->r_off, addr, len);\n     req->r_off += len;\n }\n\ndiff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c\nindex 5f8606ea80..ec582c8e1c 100644\n--- a/tests/virtio-blk-test.c\n+++ b/tests/virtio-blk-test.c\n@@ -145,9 +145,9 @@ static uint64_t virtio_blk_request(QGuestAllocator *alloc, QVirtioDevice *d,\n\n     virtio_blk_fix_request(d, req);\n\n-    memwrite(addr, req, 16);\n-    memwrite(addr + 16, req->data, data_size);\n-    memwrite(addr + 16 + data_size, &status, sizeof(status));\n+    memwrite(global_qtest, addr, req, 16);\n+    memwrite(global_qtest, addr + 16, req->data, data_size);\n+    memwrite(global_qtest, addr + 16 + data_size, &status, sizeof(status));\n\n     return addr;\n }\n@@ -221,7 +221,7 @@ static void test_basic(QVirtioDevice *dev, QGuestAllocator *alloc,\n     g_assert_cmpint(status, ==, 0);\n\n     data = g_malloc0(512);\n-    memread(req_addr + 16, data, 512);\n+    memread(global_qtest, req_addr + 16, data, 512);\n     g_assert_cmpstr(data, ==, \"TEST\");\n     g_free(data);\n\n@@ -270,7 +270,7 @@ static void test_basic(QVirtioDevice *dev, QGuestAllocator *alloc,\n         g_assert_cmpint(status, ==, 0);\n\n         data = g_malloc0(512);\n-        memread(req_addr + 16, data, 512);\n+        memread(global_qtest, req_addr + 16, data, 512);\n         g_assert_cmpstr(data, ==, \"TEST\");\n         g_free(data);\n\n@@ -380,7 +380,7 @@ static void pci_indirect(void)\n     g_assert_cmpint(status, ==, 0);\n\n     data = g_malloc0(512);\n-    memread(req_addr + 16, data, 512);\n+    memread(global_qtest, req_addr + 16, data, 512);\n     g_assert_cmpstr(data, ==, \"TEST\");\n     g_free(data);\n\n@@ -517,7 +517,7 @@ static void pci_msix(void)\n     g_assert_cmpint(status, ==, 0);\n\n     data = g_malloc0(512);\n-    memread(req_addr + 16, data, 512);\n+    memread(global_qtest, req_addr + 16, data, 512);\n     g_assert_cmpstr(data, ==, \"TEST\");\n     g_free(data);\n\n@@ -640,7 +640,7 @@ static void pci_idx(void)\n     g_assert_cmpint(status, ==, 0);\n\n     data = g_malloc0(512);\n-    memread(req_addr + 16, data, 512);\n+    memread(global_qtest, req_addr + 16, data, 512);\n     g_assert_cmpstr(data, ==, \"TEST\");\n     g_free(data);\n\ndiff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c\nindex 9250c417a9..7ae3b57d37 100644\n--- a/tests/virtio-net-test.c\n+++ b/tests/virtio-net-test.c\n@@ -112,7 +112,7 @@ static void rx_test(QVirtioDevice *dev,\n     g_assert_cmpint(ret, ==, sizeof(test) + sizeof(len));\n\n     qvirtio_wait_used_elem(dev, vq, free_head, QVIRTIO_NET_TIMEOUT_US);\n-    memread(req_addr + VNET_HDR_SIZE, buffer, sizeof(test));\n+    memread(global_qtest, req_addr + VNET_HDR_SIZE, buffer, sizeof(test));\n     g_assert_cmpstr(buffer, ==, \"TEST\");\n\n     guest_free(alloc, req_addr);\n@@ -129,7 +129,7 @@ static void tx_test(QVirtioDevice *dev,\n     int ret;\n\n     req_addr = guest_alloc(alloc, 64);\n-    memwrite(req_addr + VNET_HDR_SIZE, \"TEST\", 4);\n+    memwrite(global_qtest, req_addr + VNET_HDR_SIZE, \"TEST\", 4);\n\n     free_head = qvirtqueue_add(vq, req_addr, 64, false, false);\n     qvirtqueue_kick(dev, vq, free_head);\n@@ -186,7 +186,7 @@ static void rx_stop_cont_test(QVirtioDevice *dev,\n     QDECREF(rsp);\n\n     qvirtio_wait_used_elem(dev, vq, free_head, QVIRTIO_NET_TIMEOUT_US);\n-    memread(req_addr + VNET_HDR_SIZE, buffer, sizeof(test));\n+    memread(global_qtest, req_addr + VNET_HDR_SIZE, buffer, sizeof(test));\n     g_assert_cmpstr(buffer, ==, \"TEST\");\n\n     guest_free(alloc, req_addr);\ndiff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c\nindex 30a341df2f..2cd8db9a9a 100644\n--- a/tests/virtio-scsi-test.c\n+++ b/tests/virtio-scsi-test.c\n@@ -77,7 +77,7 @@ static uint64_t qvirtio_scsi_alloc(QVirtIOSCSI *vs, size_t alloc_size,\n\n     addr = guest_alloc(vs->qs->alloc, alloc_size);\n     if (data) {\n-        memwrite(addr, data, alloc_size);\n+        memwrite(global_qtest, addr, data, alloc_size);\n     }\n\n     return addr;\n@@ -129,7 +129,7 @@ static uint8_t virtio_scsi_do_command(QVirtIOSCSI *vs, const uint8_t *cdb,\n                      offsetof(struct virtio_scsi_cmd_resp, response));\n\n     if (resp_out) {\n-        memread(resp_addr, resp_out, sizeof(*resp_out));\n+        memread(global_qtest, resp_addr, resp_out, sizeof(*resp_out));\n     }\n\n     guest_free(vs->qs->alloc, req_addr);\n",
    "prefixes": [
        "v7",
        "35/38"
    ]
}