get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 812519,
    "url": "http://patchwork.ozlabs.org/api/patches/812519/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170911172022.4738-32-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-32-eblake@redhat.com>",
    "list_archive_url": null,
    "date": "2017-09-11T17:20:15",
    "name": "[v7,31/38] libqtest: Merge qtest_clock_*() with clock_*()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "9eb6283d6245bb401122314c605a30556b148f1a",
    "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-32-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/812519/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/812519/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-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com",
            "ext-mx02.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 3xrbJT3CXhz9s7F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 03:58:32 +1000 (AEST)",
            "from localhost ([::1]:59540 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 1drSyb-0008S6-Qw\n\tfor incoming@patchwork.ozlabs.org; Mon, 11 Sep 2017 13:58:29 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:39135)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1drSPM-0008FD-AK\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:22:07 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1drSPH-0001d4-Pm\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:22:04 -0400",
            "from mx1.redhat.com ([209.132.183.28]:41531)\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 1drSPB-0001Yg-0s; Mon, 11 Sep 2017 13:21:53 -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 1C98516AF2C;\n\tMon, 11 Sep 2017 17:21:52 +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 879B65D751;\n\tMon, 11 Sep 2017 17:21:43 +0000 (UTC)"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 1C98516AF2C",
        "From": "Eric Blake <eblake@redhat.com>",
        "To": "qemu-devel@nongnu.org",
        "Date": "Mon, 11 Sep 2017 12:20:15 -0500",
        "Message-Id": "<20170911172022.4738-32-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.26]);\n\tMon, 11 Sep 2017 17:21:52 +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 31/38] libqtest: Merge qtest_clock_*() with\n\tclock_*()",
        "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_clock_set()\n qtest_clock_step()\n qtest_clock_step_next()\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         | 50 ++++----------------------------\n tests/libqtest.c         |  6 ++--\n tests/e1000e-test.c      |  2 +-\n tests/fdc-test.c         |  4 +--\n tests/ide-test.c         |  2 +-\n tests/libqos/virtio.c    |  8 +++---\n tests/rtc-test.c         | 74 ++++++++++++++++++++++++------------------------\n tests/rtl8139-test.c     | 10 +++----\n tests/tco-test.c         | 22 +++++++-------\n tests/test-arm-mptimer.c | 25 +++++++++-------\n tests/wdt_ib700-test.c   | 12 ++++----\n 11 files changed, 90 insertions(+), 125 deletions(-)",
    "diff": "diff --git a/tests/libqtest.h b/tests/libqtest.h\nindex 5651b77d2f..26d5f37bc9 100644\n--- a/tests/libqtest.h\n+++ b/tests/libqtest.h\n@@ -417,17 +417,17 @@ void qtest_bufwrite(QTestState *s, uint64_t addr,\n void qtest_memset(QTestState *s, uint64_t addr, uint8_t patt, size_t size);\n\n /**\n- * qtest_clock_step_next:\n+ * clock_step_next:\n  * @s: #QTestState instance to operate on.\n  *\n  * Advance the QEMU_CLOCK_VIRTUAL to the next deadline.\n  *\n  * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.\n  */\n-int64_t qtest_clock_step_next(QTestState *s);\n+int64_t clock_step_next(QTestState *s);\n\n /**\n- * qtest_clock_step:\n+ * clock_step:\n  * @s: QTestState instance to operate on.\n  * @step: Number of nanoseconds to advance the clock by.\n  *\n@@ -435,10 +435,10 @@ int64_t qtest_clock_step_next(QTestState *s);\n  *\n  * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.\n  */\n-int64_t qtest_clock_step(QTestState *s, int64_t step);\n+int64_t clock_step(QTestState *s, int64_t step);\n\n /**\n- * qtest_clock_set:\n+ * clock_set:\n  * @s: QTestState instance to operate on.\n  * @val: Nanoseconds value to advance the clock to.\n  *\n@@ -446,7 +446,7 @@ int64_t qtest_clock_step(QTestState *s, int64_t step);\n  *\n  * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.\n  */\n-int64_t qtest_clock_set(QTestState *s, int64_t val);\n+int64_t clock_set(QTestState *s, int64_t val);\n\n /**\n  * qtest_big_endian:\n@@ -868,44 +868,6 @@ static inline void qmemset(uint64_t addr, uint8_t patt, size_t size)\n     qtest_memset(global_qtest, addr, patt, size);\n }\n\n-/**\n- * clock_step_next:\n- *\n- * Advance the QEMU_CLOCK_VIRTUAL to the next deadline.\n- *\n- * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.\n- */\n-static inline int64_t clock_step_next(void)\n-{\n-    return qtest_clock_step_next(global_qtest);\n-}\n-\n-/**\n- * clock_step:\n- * @step: Number of nanoseconds to advance the clock by.\n- *\n- * Advance the QEMU_CLOCK_VIRTUAL by @step nanoseconds.\n- *\n- * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.\n- */\n-static inline int64_t clock_step(int64_t step)\n-{\n-    return qtest_clock_step(global_qtest, step);\n-}\n-\n-/**\n- * clock_set:\n- * @val: Nanoseconds value to advance the clock to.\n- *\n- * Advance the QEMU_CLOCK_VIRTUAL to @val nanoseconds since the VM was launched.\n- *\n- * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.\n- */\n-static inline int64_t clock_set(int64_t val)\n-{\n-    return qtest_clock_set(global_qtest, val);\n-}\n-\n QDict *qmp_fd_receive(int fd);\n void qmp_fd_sendv(int fd, const char *fmt, va_list ap);\n void qmp_fd_send(int fd, const char *fmt, ...);\ndiff --git a/tests/libqtest.c b/tests/libqtest.c\nindex 44c89813ff..9f5f2cb933 100644\n--- a/tests/libqtest.c\n+++ b/tests/libqtest.c\n@@ -666,19 +666,19 @@ static int64_t qtest_clock_rsp(QTestState *s)\n     return clock;\n }\n\n-int64_t qtest_clock_step_next(QTestState *s)\n+int64_t clock_step_next(QTestState *s)\n {\n     qtest_sendf(s, \"clock_step\\n\");\n     return qtest_clock_rsp(s);\n }\n\n-int64_t qtest_clock_step(QTestState *s, int64_t step)\n+int64_t clock_step(QTestState *s, int64_t step)\n {\n     qtest_sendf(s, \"clock_step %\"PRIi64\"\\n\", step);\n     return qtest_clock_rsp(s);\n }\n\n-int64_t qtest_clock_set(QTestState *s, int64_t val)\n+int64_t clock_set(QTestState *s, int64_t val)\n {\n     qtest_sendf(s, \"clock_set %\"PRIi64\"\\n\", val);\n     return qtest_clock_rsp(s);\ndiff --git a/tests/e1000e-test.c b/tests/e1000e-test.c\nindex 323aabb454..f4ead74f96 100644\n--- a/tests/e1000e-test.c\n+++ b/tests/e1000e-test.c\n@@ -229,7 +229,7 @@ static void e1000e_wait_isr(e1000e_device *d, uint16_t msg_id)\n         if (qpci_msix_pending(d->pci_dev, msg_id)) {\n             return;\n         }\n-        clock_step(10000);\n+        clock_step(global_qtest, 10000);\n     } while (g_get_monotonic_time() < end_time);\n\n     g_error(\"Timeout expired\");\ndiff --git a/tests/fdc-test.c b/tests/fdc-test.c\nindex ec83625db2..e79cd0f3b5 100644\n--- a/tests/fdc-test.c\n+++ b/tests/fdc-test.c\n@@ -424,7 +424,7 @@ static void test_read_id(void)\n\n     while (!get_irq(FLOPPY_IRQ)) {\n         /* qemu involves a timer with READ ID... */\n-        clock_step(1000000000LL / 50);\n+        clock_step(global_qtest, 1000000000LL / 50);\n     }\n\n     msr = inb(FLOPPY_BASE + reg_msr);\n@@ -467,7 +467,7 @@ static void test_read_id(void)\n\n     while (!get_irq(FLOPPY_IRQ)) {\n         /* qemu involves a timer with READ ID... */\n-        clock_step(1000000000LL / 50);\n+        clock_step(global_qtest, 1000000000LL / 50);\n     }\n\n     msr = inb(FLOPPY_BASE + reg_msr);\ndiff --git a/tests/ide-test.c b/tests/ide-test.c\nindex e1650c0132..32c8c40294 100644\n--- a/tests/ide-test.c\n+++ b/tests/ide-test.c\n@@ -749,7 +749,7 @@ static void nsleep(int64_t nsecs)\n {\n     const struct timespec val = { .tv_nsec = nsecs };\n     nanosleep(&val, NULL);\n-    clock_set(nsecs);\n+    clock_set(global_qtest, nsecs);\n }\n\n static uint8_t ide_wait_clear(uint8_t flag)\ndiff --git a/tests/libqos/virtio.c b/tests/libqos/virtio.c\nindex 2212830742..92e47e78f2 100644\n--- a/tests/libqos/virtio.c\n+++ b/tests/libqos/virtio.c\n@@ -97,7 +97,7 @@ void qvirtio_wait_queue_isr(QVirtioDevice *d,\n     gint64 start_time = g_get_monotonic_time();\n\n     for (;;) {\n-        qtest_clock_step(d->bus->qts, 100);\n+        clock_step(d->bus->qts, 100);\n         if (d->bus->get_queue_isr_status(d, vq)) {\n             return;\n         }\n@@ -119,7 +119,7 @@ uint8_t qvirtio_wait_status_byte_no_isr(QVirtioDevice *d,\n     uint8_t val;\n\n     while ((val = qtest_readb(d->bus->qts, addr)) == 0xff) {\n-        qtest_clock_step(d->bus->qts, 100);\n+        clock_step(d->bus->qts, 100);\n         g_assert(!d->bus->get_queue_isr_status(d, vq));\n         g_assert(g_get_monotonic_time() - start_time <= timeout_us);\n     }\n@@ -143,7 +143,7 @@ void qvirtio_wait_used_elem(QVirtioDevice *d,\n     for (;;) {\n         uint32_t got_desc_idx;\n\n-        qtest_clock_step(d->bus->qts, 100);\n+        clock_step(d->bus->qts, 100);\n\n         if (d->bus->get_queue_isr_status(d, vq) &&\n             qvirtqueue_get_buf(vq, &got_desc_idx)) {\n@@ -160,7 +160,7 @@ void qvirtio_wait_config_isr(QVirtioDevice *d, gint64 timeout_us)\n     gint64 start_time = g_get_monotonic_time();\n\n     for (;;) {\n-        qtest_clock_step(d->bus->qts, 100);\n+        clock_step(d->bus->qts, 100);\n         if (d->bus->get_config_isr_status(d)) {\n             return;\n         }\ndiff --git a/tests/rtc-test.c b/tests/rtc-test.c\nindex dd5430dd2d..9b98e2d494 100644\n--- a/tests/rtc-test.c\n+++ b/tests/rtc-test.c\n@@ -291,7 +291,7 @@ static void alarm_time(void)\n             break;\n         }\n\n-        clock_step(1000000000);\n+        clock_step(global_qtest, 1000000000);\n     }\n\n     g_assert(get_irq(RTC_ISA_IRQ));\n@@ -371,35 +371,35 @@ static void basic_12h_bcd(void)\n {\n     /* set BCD 12 hour mode */\n     set_time(0, 0x81, 0x59, 0x00);\n-    clock_step(1000000000LL);\n+    clock_step(global_qtest, 1000000000LL);\n     assert_time(0x81, 0x59, 0x01);\n-    clock_step(59000000000LL);\n+    clock_step(global_qtest, 59000000000LL);\n     assert_time(0x82, 0x00, 0x00);\n\n     /* test BCD wraparound */\n     set_time(0, 0x09, 0x59, 0x59);\n-    clock_step(60000000000LL);\n+    clock_step(global_qtest, 60000000000LL);\n     assert_time(0x10, 0x00, 0x59);\n\n     /* 12 AM -> 1 AM */\n     set_time(0, 0x12, 0x59, 0x59);\n-    clock_step(1000000000LL);\n+    clock_step(global_qtest, 1000000000LL);\n     assert_time(0x01, 0x00, 0x00);\n\n     /* 12 PM -> 1 PM */\n     set_time(0, 0x92, 0x59, 0x59);\n-    clock_step(1000000000LL);\n+    clock_step(global_qtest, 1000000000LL);\n     assert_time(0x81, 0x00, 0x00);\n\n     /* 11 AM -> 12 PM */\n     set_time(0, 0x11, 0x59, 0x59);\n-    clock_step(1000000000LL);\n+    clock_step(global_qtest, 1000000000LL);\n     assert_time(0x92, 0x00, 0x00);\n     /* TODO: test day wraparound */\n\n     /* 11 PM -> 12 AM */\n     set_time(0, 0x91, 0x59, 0x59);\n-    clock_step(1000000000LL);\n+    clock_step(global_qtest, 1000000000LL);\n     assert_time(0x12, 0x00, 0x00);\n     /* TODO: test day wraparound */\n }\n@@ -408,29 +408,29 @@ static void basic_12h_dec(void)\n {\n     /* set decimal 12 hour mode */\n     set_time(REG_B_DM, 0x81, 59, 0);\n-    clock_step(1000000000LL);\n+    clock_step(global_qtest, 1000000000LL);\n     assert_time(0x81, 59, 1);\n-    clock_step(59000000000LL);\n+    clock_step(global_qtest, 59000000000LL);\n     assert_time(0x82, 0, 0);\n\n     /* 12 PM -> 1 PM */\n     set_time(REG_B_DM, 0x8c, 59, 59);\n-    clock_step(1000000000LL);\n+    clock_step(global_qtest, 1000000000LL);\n     assert_time(0x81, 0, 0);\n\n     /* 12 AM -> 1 AM */\n     set_time(REG_B_DM, 0x0c, 59, 59);\n-    clock_step(1000000000LL);\n+    clock_step(global_qtest, 1000000000LL);\n     assert_time(0x01, 0, 0);\n\n     /* 11 AM -> 12 PM */\n     set_time(REG_B_DM, 0x0b, 59, 59);\n-    clock_step(1000000000LL);\n+    clock_step(global_qtest, 1000000000LL);\n     assert_time(0x8c, 0, 0);\n\n     /* 11 PM -> 12 AM */\n     set_time(REG_B_DM, 0x8b, 59, 59);\n-    clock_step(1000000000LL);\n+    clock_step(global_qtest, 1000000000LL);\n     assert_time(0x0c, 0, 0);\n     /* TODO: test day wraparound */\n }\n@@ -439,19 +439,19 @@ static void basic_24h_bcd(void)\n {\n     /* set BCD 24 hour mode */\n     set_time(REG_B_24H, 0x09, 0x59, 0x00);\n-    clock_step(1000000000LL);\n+    clock_step(global_qtest, 1000000000LL);\n     assert_time(0x09, 0x59, 0x01);\n-    clock_step(59000000000LL);\n+    clock_step(global_qtest, 59000000000LL);\n     assert_time(0x10, 0x00, 0x00);\n\n     /* test BCD wraparound */\n     set_time(REG_B_24H, 0x09, 0x59, 0x00);\n-    clock_step(60000000000LL);\n+    clock_step(global_qtest, 60000000000LL);\n     assert_time(0x10, 0x00, 0x00);\n\n     /* TODO: test day wraparound */\n     set_time(REG_B_24H, 0x23, 0x59, 0x00);\n-    clock_step(60000000000LL);\n+    clock_step(global_qtest, 60000000000LL);\n     assert_time(0x00, 0x00, 0x00);\n }\n\n@@ -459,19 +459,19 @@ static void basic_24h_dec(void)\n {\n     /* set decimal 24 hour mode */\n     set_time(REG_B_24H | REG_B_DM, 9, 59, 0);\n-    clock_step(1000000000LL);\n+    clock_step(global_qtest, 1000000000LL);\n     assert_time(9, 59, 1);\n-    clock_step(59000000000LL);\n+    clock_step(global_qtest, 59000000000LL);\n     assert_time(10, 0, 0);\n\n     /* test BCD wraparound */\n     set_time(REG_B_24H | REG_B_DM, 9, 59, 0);\n-    clock_step(60000000000LL);\n+    clock_step(global_qtest, 60000000000LL);\n     assert_time(10, 0, 0);\n\n     /* TODO: test day wraparound */\n     set_time(REG_B_24H | REG_B_DM, 23, 59, 0);\n-    clock_step(60000000000LL);\n+    clock_step(global_qtest, 60000000000LL);\n     assert_time(0, 0, 0);\n }\n\n@@ -493,7 +493,7 @@ static void am_pm_alarm(void)\n     cmos_write(RTC_REG_A, 0x26);\n\n     /* Check that alarm triggers when AM/PM is set.  */\n-    clock_step(60000000000LL);\n+    clock_step(global_qtest, 60000000000LL);\n     g_assert(cmos_read(RTC_HOURS) == 0x82);\n     g_assert((cmos_read(RTC_REG_C) & REG_C_AF) != 0);\n\n@@ -520,7 +520,7 @@ static void am_pm_alarm(void)\n     cmos_write(RTC_REG_A, 0x26);\n\n     /* Check that alarm triggers.  */\n-    clock_step(3600 * 11 * 1000000000LL);\n+    clock_step(global_qtest, 3600 * 11 * 1000000000LL);\n     g_assert(cmos_read(RTC_HOURS) == 0x82);\n     g_assert((cmos_read(RTC_REG_C) & REG_C_AF) != 0);\n\n@@ -534,7 +534,7 @@ static void am_pm_alarm(void)\n     cmos_write(RTC_REG_A, 0x26);\n\n     /* Check that alarm does not trigger if hours differ only by AM/PM.  */\n-    clock_step(3600 * 11 * 1000000000LL);\n+    clock_step(global_qtest, 3600 * 11 * 1000000000LL);\n     g_assert(cmos_read(RTC_HOURS) == 0x82);\n     g_assert((cmos_read(RTC_REG_C) & REG_C_AF) == 0);\n }\n@@ -558,7 +558,7 @@ static void fuzz_registers(void)\n static void register_b_set_flag(void)\n {\n     if (cmos_read(RTC_REG_A) & REG_A_UIP) {\n-        clock_step(UIP_HOLD_LENGTH + NANOSECONDS_PER_SECOND / 5);\n+        clock_step(global_qtest, UIP_HOLD_LENGTH + NANOSECONDS_PER_SECOND / 5);\n     }\n     g_assert_cmpint(cmos_read(RTC_REG_A) & REG_A_UIP, ==, 0);\n\n@@ -570,7 +570,7 @@ static void register_b_set_flag(void)\n     assert_datetime_bcd(0x02, 0x04, 0x58, 0x02, 0x02, 0x2011);\n\n     /* Since SET flag is still enabled, time does not advance. */\n-    clock_step(1000000000LL);\n+    clock_step(global_qtest, 1000000000LL);\n     assert_datetime_bcd(0x02, 0x04, 0x58, 0x02, 0x02, 0x2011);\n\n     /* Disable SET flag in Register B */\n@@ -579,7 +579,7 @@ static void register_b_set_flag(void)\n     assert_datetime_bcd(0x02, 0x04, 0x58, 0x02, 0x02, 0x2011);\n\n     /* Since SET flag is disabled, the clock now advances.  */\n-    clock_step(1000000000LL);\n+    clock_step(global_qtest, 1000000000LL);\n     assert_datetime_bcd(0x02, 0x04, 0x59, 0x02, 0x02, 0x2011);\n }\n\n@@ -595,18 +595,18 @@ static void divider_reset(void)\n     assert_datetime_bcd(0x02, 0x04, 0x58, 0x02, 0x02, 0x2011);\n\n     /* Since divider reset flag is still enabled, these are equality checks. */\n-    clock_step(1000000000LL);\n+    clock_step(global_qtest, 1000000000LL);\n     assert_datetime_bcd(0x02, 0x04, 0x58, 0x02, 0x02, 0x2011);\n\n     /* The first update ends 500 ms after divider reset */\n     cmos_write(RTC_REG_A, 0x26);\n-    clock_step(500000000LL - UIP_HOLD_LENGTH - 1);\n+    clock_step(global_qtest, 500000000LL - UIP_HOLD_LENGTH - 1);\n     g_assert_cmpint(cmos_read(RTC_REG_A) & REG_A_UIP, ==, 0);\n     assert_datetime_bcd(0x02, 0x04, 0x58, 0x02, 0x02, 0x2011);\n\n-    clock_step(1);\n+    clock_step(global_qtest, 1);\n     g_assert_cmpint(cmos_read(RTC_REG_A) & REG_A_UIP, !=, 0);\n-    clock_step(UIP_HOLD_LENGTH);\n+    clock_step(global_qtest, UIP_HOLD_LENGTH);\n     g_assert_cmpint(cmos_read(RTC_REG_A) & REG_A_UIP, ==, 0);\n\n     assert_datetime_bcd(0x02, 0x04, 0x59, 0x02, 0x02, 0x2011);\n@@ -618,7 +618,7 @@ static void uip_stuck(void)\n\n     /* The first update ends 500 ms after divider reset */\n     (void)cmos_read(RTC_REG_C);\n-    clock_step(500000000LL);\n+    clock_step(global_qtest, 500000000LL);\n     g_assert_cmpint(cmos_read(RTC_REG_A) & REG_A_UIP, ==, 0);\n     assert_datetime_bcd(0x02, 0x04, 0x59, 0x02, 0x02, 0x2011);\n\n@@ -628,12 +628,12 @@ static void uip_stuck(void)\n     cmos_write(RTC_SECONDS_ALARM, 0xC0);\n\n     /* Because the alarm will fire soon, reading register A will latch UIP.  */\n-    clock_step(1000000000LL - UIP_HOLD_LENGTH / 2);\n+    clock_step(global_qtest, 1000000000LL - UIP_HOLD_LENGTH / 2);\n     g_assert_cmpint(cmos_read(RTC_REG_A) & REG_A_UIP, !=, 0);\n\n     /* Move the alarm far away.  This must not cause UIP to remain stuck!  */\n     cmos_write(RTC_HOURS_ALARM, 0x03);\n-    clock_step(UIP_HOLD_LENGTH);\n+    clock_step(global_qtest, UIP_HOLD_LENGTH);\n     g_assert_cmpint(cmos_read(RTC_REG_A) & REG_A_UIP, ==, 0);\n }\n\n@@ -645,7 +645,7 @@ static void uip_stuck(void)\n static uint64_t wait_periodic_interrupt(uint64_t real_time)\n {\n     while (!get_irq(RTC_ISA_IRQ)) {\n-        real_time = clock_step_next();\n+        real_time = clock_step_next(global_qtest);\n     }\n\n     g_assert((cmos_read(RTC_REG_C) & REG_C_PF) != 0);\n@@ -664,7 +664,7 @@ static void periodic_timer(void)\n     /* enable periodic interrupt after properly configure the period. */\n     cmos_write(RTC_REG_B, cmos_read(RTC_REG_B) | REG_B_PIE);\n\n-    start_time = real_time = clock_step_next();\n+    start_time = real_time = clock_step_next(global_qtest);\n\n     for (i = 0; i < RTC_PERIOD_TEST_NR; i++) {\n         cmos_write(RTC_REG_A, RTC_PERIOD_CODE1);\ndiff --git a/tests/rtl8139-test.c b/tests/rtl8139-test.c\nindex 1741f0ec47..d123245108 100644\n--- a/tests/rtl8139-test.c\n+++ b/tests/rtl8139-test.c\n@@ -84,7 +84,7 @@ static void test_timer(void)\n         fatal(\"time too big %u\\n\", curr);\n     }\n     for (cnt = 0; ; ) {\n-        clock_step(1 * NANOSECONDS_PER_SECOND);\n+        clock_step(global_qtest, 1 * NANOSECONDS_PER_SECOND);\n         prev = curr;\n         curr = in_Timer();\n\n@@ -106,7 +106,7 @@ static void test_timer(void)\n     /* Test 3. Setting TimerInt to 1 and Timer to 0 get interrupt */\n     out_TimerInt(1);\n     out_Timer(0);\n-    clock_step(40);\n+    clock_step(global_qtest, 40);\n     if ((in_IntrStatus() & 0x4000) == 0) {\n         fatal(\"we should have an interrupt here!\\n\");\n     }\n@@ -123,7 +123,7 @@ static void test_timer(void)\n     out_IntrStatus(0x4000);\n     curr = in_Timer();\n     out_TimerInt(curr + 0.5 * CLK);\n-    clock_step(1 * NANOSECONDS_PER_SECOND);\n+    clock_step(global_qtest, 1 * NANOSECONDS_PER_SECOND);\n     out_Timer(0);\n     if ((in_IntrStatus() & 0x4000) == 0) {\n         fatal(\"we should have an interrupt here!\\n\");\n@@ -135,7 +135,7 @@ static void test_timer(void)\n     out_IntrStatus(0x4000);\n     curr = in_Timer();\n     out_TimerInt(curr + 0.5 * CLK);\n-    clock_step(1 * NANOSECONDS_PER_SECOND);\n+    clock_step(global_qtest, 1 * NANOSECONDS_PER_SECOND);\n     out_TimerInt(0);\n     if ((in_IntrStatus() & 0x4000) == 0) {\n         fatal(\"we should have an interrupt here!\\n\");\n@@ -146,7 +146,7 @@ static void test_timer(void)\n     next = curr + 5.0 * CLK;\n     out_TimerInt(next);\n     for (cnt = 0; ; ) {\n-        clock_step(1 * NANOSECONDS_PER_SECOND);\n+        clock_step(global_qtest, 1 * NANOSECONDS_PER_SECOND);\n         prev = curr;\n         curr = in_Timer();\n         diff = (curr-prev) & 0xffffffffu;\ndiff --git a/tests/tco-test.c b/tests/tco-test.c\nindex b84a50927a..27e982d8ac 100644\n--- a/tests/tco-test.c\n+++ b/tests/tco-test.c\n@@ -173,7 +173,7 @@ static void test_tco_timeout(void)\n     set_tco_timeout(&d, ticks);\n     load_tco(&d);\n     start_tco(&d);\n-    clock_step(ticks * TCO_TICK_NSEC);\n+    clock_step(global_qtest, ticks * TCO_TICK_NSEC);\n\n     /* test first timeout */\n     val = qpci_io_readw(d.dev, d.tco_io_bar, TCO1_STS);\n@@ -188,7 +188,7 @@ static void test_tco_timeout(void)\n     g_assert(ret == 0);\n\n     /* test second timeout */\n-    clock_step(ticks * TCO_TICK_NSEC);\n+    clock_step(global_qtest, ticks * TCO_TICK_NSEC);\n     val = qpci_io_readw(d.dev, d.tco_io_bar, TCO1_STS);\n     ret = val & TCO_TIMEOUT ? 1 : 0;\n     g_assert(ret == 1);\n@@ -217,14 +217,14 @@ static void test_tco_max_timeout(void)\n     set_tco_timeout(&d, ticks);\n     load_tco(&d);\n     start_tco(&d);\n-    clock_step(((ticks & TCO_TMR_MASK) - 1) * TCO_TICK_NSEC);\n+    clock_step(global_qtest, ((ticks & TCO_TMR_MASK) - 1) * TCO_TICK_NSEC);\n\n     val = qpci_io_readw(d.dev, d.tco_io_bar, TCO_RLD);\n     g_assert_cmpint(val & TCO_RLD_MASK, ==, 1);\n     val = qpci_io_readw(d.dev, d.tco_io_bar, TCO1_STS);\n     ret = val & TCO_TIMEOUT ? 1 : 0;\n     g_assert(ret == 0);\n-    clock_step(TCO_TICK_NSEC);\n+    clock_step(global_qtest, TCO_TICK_NSEC);\n     val = qpci_io_readw(d.dev, d.tco_io_bar, TCO1_STS);\n     ret = val & TCO_TIMEOUT ? 1 : 0;\n     g_assert(ret == 1);\n@@ -260,7 +260,7 @@ static void test_tco_second_timeout_pause(void)\n     set_tco_timeout(&td, TCO_SECS_TO_TICKS(16));\n     load_tco(&td);\n     start_tco(&td);\n-    clock_step(ticks * TCO_TICK_NSEC * 2);\n+    clock_step(global_qtest, ticks * TCO_TICK_NSEC * 2);\n     ad = get_watchdog_action();\n     g_assert(!strcmp(qdict_get_str(ad, \"action\"), \"pause\"));\n     QDECREF(ad);\n@@ -285,7 +285,7 @@ static void test_tco_second_timeout_reset(void)\n     set_tco_timeout(&td, TCO_SECS_TO_TICKS(16));\n     load_tco(&td);\n     start_tco(&td);\n-    clock_step(ticks * TCO_TICK_NSEC * 2);\n+    clock_step(global_qtest, ticks * TCO_TICK_NSEC * 2);\n     ad = get_watchdog_action();\n     g_assert(!strcmp(qdict_get_str(ad, \"action\"), \"reset\"));\n     QDECREF(ad);\n@@ -310,7 +310,7 @@ static void test_tco_second_timeout_shutdown(void)\n     set_tco_timeout(&td, ticks);\n     load_tco(&td);\n     start_tco(&td);\n-    clock_step(ticks * TCO_TICK_NSEC * 2);\n+    clock_step(global_qtest, ticks * TCO_TICK_NSEC * 2);\n     ad = get_watchdog_action();\n     g_assert(!strcmp(qdict_get_str(ad, \"action\"), \"shutdown\"));\n     QDECREF(ad);\n@@ -335,7 +335,7 @@ static void test_tco_second_timeout_none(void)\n     set_tco_timeout(&td, ticks);\n     load_tco(&td);\n     start_tco(&td);\n-    clock_step(ticks * TCO_TICK_NSEC * 2);\n+    clock_step(global_qtest, ticks * TCO_TICK_NSEC * 2);\n     ad = get_watchdog_action();\n     g_assert(!strcmp(qdict_get_str(ad, \"action\"), \"none\"));\n     QDECREF(ad);\n@@ -364,7 +364,7 @@ static void test_tco_ticks_counter(void)\n     do {\n         rld = qpci_io_readw(d.dev, d.tco_io_bar, TCO_RLD) & TCO_RLD_MASK;\n         g_assert_cmpint(rld, ==, ticks);\n-        clock_step(TCO_TICK_NSEC);\n+        clock_step(global_qtest, TCO_TICK_NSEC);\n         ticks--;\n     } while (!(qpci_io_readw(d.dev, d.tco_io_bar, TCO1_STS) & TCO_TIMEOUT));\n\n@@ -407,7 +407,7 @@ static void test_tco1_status_bits(void)\n     set_tco_timeout(&d, ticks);\n     load_tco(&d);\n     start_tco(&d);\n-    clock_step(ticks * TCO_TICK_NSEC);\n+    clock_step(global_qtest, ticks * TCO_TICK_NSEC);\n\n     qpci_io_writeb(d.dev, d.tco_io_bar, TCO_DAT_IN, 0);\n     qpci_io_writeb(d.dev, d.tco_io_bar, TCO_DAT_OUT, 0);\n@@ -436,7 +436,7 @@ static void test_tco2_status_bits(void)\n     set_tco_timeout(&d, ticks);\n     load_tco(&d);\n     start_tco(&d);\n-    clock_step(ticks * TCO_TICK_NSEC * 2);\n+    clock_step(global_qtest, ticks * TCO_TICK_NSEC * 2);\n\n     val = qpci_io_readw(d.dev, d.tco_io_bar, TCO2_STS);\n     ret = val & (TCO_SECOND_TO_STS | TCO_BOOT_STS) ? 1 : 0;\ndiff --git a/tests/test-arm-mptimer.c b/tests/test-arm-mptimer.c\nindex 9631c55fe3..0e6484a4a8 100644\n--- a/tests/test-arm-mptimer.c\n+++ b/tests/test-arm-mptimer.c\n@@ -14,7 +14,8 @@\n #define TIMER_BLOCK_SCALE(s)    ((((s) & 0xff) + 1) * 10)\n\n #define TIMER_BLOCK_STEP(scaler, steps_nb) \\\n-    clock_step(TIMER_BLOCK_SCALE(scaler) * (int64_t)(steps_nb) + 1)\n+    clock_step(global_qtest, \\\n+               TIMER_BLOCK_SCALE(scaler) * (int64_t)(steps_nb) + 1)\n\n #define TIMER_BASE_PHYS 0x1e000600\n\n@@ -185,12 +186,14 @@ static void test_timer_periodic(gconstpointer arg)\n     timer_start(PERIODIC, scaler);\n\n     while (repeat--) {\n-        clock_step(TIMER_BLOCK_SCALE(scaler) * (101 + repeat) + 1);\n+        clock_step(global_qtest,\n+                   TIMER_BLOCK_SCALE(scaler) * (101 + repeat) + 1);\n\n         g_assert_cmpuint(timer_counter(), ==, 100 - repeat);\n         g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, 1);\n\n-        clock_step(TIMER_BLOCK_SCALE(scaler) * (101 - repeat) - 1);\n+        clock_step(global_qtest,\n+                   TIMER_BLOCK_SCALE(scaler) * (101 - repeat) - 1);\n     }\n }\n\n@@ -686,10 +689,10 @@ static void test_periodic_counter(gconstpointer arg)\n     timer_load(test_load);\n     timer_start(PERIODIC, scaler);\n\n-    clock_step(1);\n+    clock_step(global_qtest, 1);\n\n     for (test_val = 0; test_val <= test_load; test_val++) {\n-        clock_step(TIMER_BLOCK_SCALE(scaler) * test_load);\n+        clock_step(global_qtest, TIMER_BLOCK_SCALE(scaler) * test_load);\n         g_assert_cmpint(timer_counter(), ==, test_val);\n     }\n }\n@@ -783,7 +786,7 @@ again:\n     timer_reset();\n     timer_start(mode, 255);\n\n-    clock_step(100);\n+    clock_step(global_qtest, 100);\n\n     g_assert_cmpuint(timer_counter(), ==, 0);\n\n@@ -795,7 +798,7 @@ again:\n     timer_load(2);\n     timer_start(mode, 255);\n\n-    clock_step(100);\n+    clock_step(global_qtest, 100);\n\n     g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, 0);\n\n@@ -811,13 +814,13 @@ again:\n     timer_load(UINT32_MAX);\n     timer_start(mode, 255);\n\n-    clock_step(100);\n+    clock_step(global_qtest, 100);\n\n     g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, 0);\n\n     timer_set_counter(0);\n\n-    clock_step(100);\n+    clock_step(global_qtest, 100);\n\n     g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, 0);\n\n@@ -829,13 +832,13 @@ again:\n     timer_load(UINT32_MAX);\n     timer_start(mode, 255);\n\n-    clock_step(100);\n+    clock_step(global_qtest, 100);\n\n     g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, 0);\n\n     timer_load(0);\n\n-    clock_step(100);\n+    clock_step(global_qtest, 100);\n\n     g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, 0);\n\ndiff --git a/tests/wdt_ib700-test.c b/tests/wdt_ib700-test.c\nindex a169265e16..05690e5159 100644\n--- a/tests/wdt_ib700-test.c\n+++ b/tests/wdt_ib700-test.c\n@@ -22,29 +22,29 @@ static QDict *ib700_program_and_wait(QTestState *s)\n {\n     QDict *event, *data;\n\n-    qtest_clock_step(s, NANOSECONDS_PER_SECOND * 40);\n+    clock_step(s, NANOSECONDS_PER_SECOND * 40);\n     qmp_check_no_event(s);\n\n     /* 2 second limit */\n     qtest_outb(s, 0x443, 14);\n\n     /* Ping */\n-    qtest_clock_step(s, NANOSECONDS_PER_SECOND);\n+    clock_step(s, NANOSECONDS_PER_SECOND);\n     qmp_check_no_event(s);\n     qtest_outb(s, 0x443, 14);\n\n     /* Disable */\n-    qtest_clock_step(s, NANOSECONDS_PER_SECOND);\n+    clock_step(s, NANOSECONDS_PER_SECOND);\n     qmp_check_no_event(s);\n     qtest_outb(s, 0x441, 1);\n-    qtest_clock_step(s, 3 * NANOSECONDS_PER_SECOND);\n+    clock_step(s, 3 * NANOSECONDS_PER_SECOND);\n     qmp_check_no_event(s);\n\n     /* Enable and let it fire */\n     qtest_outb(s, 0x443, 13);\n-    qtest_clock_step(s, 3 * NANOSECONDS_PER_SECOND);\n+    clock_step(s, 3 * NANOSECONDS_PER_SECOND);\n     qmp_check_no_event(s);\n-    qtest_clock_step(s, 2 * NANOSECONDS_PER_SECOND);\n+    clock_step(s, 2 * NANOSECONDS_PER_SECOND);\n     event = qtest_qmp_eventwait_ref(s, \"WATCHDOG\");\n     data = qdict_get_qdict(event, \"data\");\n     QINCREF(data);\n",
    "prefixes": [
        "v7",
        "31/38"
    ]
}