get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 812510,
    "url": "http://patchwork.ozlabs.org/api/patches/812510/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170911172022.4738-30-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-30-eblake@redhat.com>",
    "list_archive_url": null,
    "date": "2017-09-11T17:20:13",
    "name": "[v7,29/38] libqtest: Merge qtest_init() into qtest_start()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "a90ced6f8dbcf6310f0569f434e0d713a5c7cf22",
    "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-30-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/812510/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/812510/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-mx01.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com",
            "ext-mx01.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 3xrbDC281Pz9s7F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 03:54:51 +1000 (AEST)",
            "from localhost ([::1]:59507 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 1drSv0-0004s8-GK\n\tfor incoming@patchwork.ozlabs.org; Mon, 11 Sep 2017 13:54:46 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:39037)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1drSPD-000880-DT\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:21:59 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1drSP9-0001YQ-UJ\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:21:55 -0400",
            "from mx1.redhat.com ([209.132.183.28]:48524)\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 1drSP0-0001SE-QI; Mon, 11 Sep 2017 13:21:43 -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 B48D2EF642;\n\tMon, 11 Sep 2017 17:21:41 +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 078755D968;\n\tMon, 11 Sep 2017 17:21:38 +0000 (UTC)"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com B48D2EF642",
        "From": "Eric Blake <eblake@redhat.com>",
        "To": "qemu-devel@nongnu.org",
        "Date": "Mon, 11 Sep 2017 12:20:13 -0500",
        "Message-Id": "<20170911172022.4738-30-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.25]);\n\tMon, 11 Sep 2017 17:21:41 +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 29/38] libqtest: Merge qtest_init() into\n\tqtest_start()",
        "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:Floppy\" <qemu-block@nongnu.org>,\n\t\"Michael S. Tsirkin\" <mst@redhat.com>,\n\tJason Wang <jasowang@redhat.com>, Amit Shah <amit@kernel.org>,\n\tarmbru@redhat.com, Alexander Graf <agraf@suse.de>,\n\tKeith Busch <keith.busch@intel.com>,\n\t\"open list:sPAPR\" <qemu-ppc@nongnu.org>,\n\tGerd Hoffmann <kraxel@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": "Remove the trivial wrapper qtest_init(), and change qtest_start()\nto no longer implicitly set global_qtest, to make it obvious in the\nrest of the testsuite where we are still relying on global_qtest.\nEverything now uses qtest_start() (and friends) and qtest_quit(),\nand explicitly tracks the QTestState between the two (although in\nmany cases, this tracking is still done through global_qtest).\nDoing this makes it easier to see what remaining cleanups will be\nneeded if we don't want an implicit dependency on global state.\n\nA few more places that were needlessly strdup'ing a temporary\nvariable are cleaned up in the process.\n\nAs mentioned in an earlier commit, the choice to get rid of\nqtest_init() also reduces confusion with the device initializer\nof the non-testsuite qtest.c device.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\n---\n tests/libqtest.h               | 33 ++++-----------------------------\n tests/libqtest.c               |  4 ++--\n tests/ac97-test.c              |  2 +-\n tests/device-introspect-test.c | 12 ++++++------\n tests/display-vga-test.c       | 18 ++++++------------\n tests/drive_del-test.c         | 11 ++++++-----\n tests/es1370-test.c            |  2 +-\n tests/fdc-test.c               |  2 +-\n tests/fw_cfg-test.c            |  2 +-\n tests/hd-geo-test.c            |  8 ++++----\n tests/i440fx-test.c            |  2 +-\n tests/i82801b11-test.c         |  3 ++-\n tests/intel-hda-test.c         |  9 ++++-----\n tests/ioh3420-test.c           |  5 +++--\n tests/ipmi-kcs-test.c          |  7 ++-----\n tests/ipoctal232-test.c        |  3 ++-\n tests/ivshmem-test.c           |  2 +-\n tests/m48t59-test.c            |  2 +-\n tests/ne2000-test.c            |  2 +-\n tests/nvme-test.c              |  5 +++--\n tests/pcnet-test.c             |  2 +-\n tests/postcopy-test.c          |  4 ++--\n tests/pvpanic-test.c           |  2 +-\n tests/q35-test.c               |  4 ++--\n tests/qmp-test.c               |  4 ++--\n tests/rtc-test.c               |  2 +-\n tests/rtl8139-test.c           |  2 +-\n tests/spapr-phb-test.c         |  5 +++--\n tests/test-arm-mptimer.c       |  2 +-\n tests/test-x86-cpuid-compat.c  |  7 ++++---\n tests/tmp105-test.c            |  1 +\n tests/tpci200-test.c           |  2 +-\n tests/usb-hcd-ehci-test.c      | 23 ++++++++++++-----------\n tests/usb-hcd-ohci-test.c      |  2 +-\n tests/usb-hcd-xhci-test.c      |  5 +++--\n tests/virtio-balloon-test.c    |  2 +-\n tests/virtio-console-test.c    | 10 ++++------\n tests/virtio-net-test.c        |  2 +-\n tests/virtio-rng-test.c        |  2 +-\n tests/virtio-serial-test.c     |  2 +-\n tests/vmxnet3-test.c           |  2 +-\n tests/wdt_ib700-test.c         |  8 ++++----\n 42 files changed, 101 insertions(+), 128 deletions(-)",
    "diff": "diff --git a/tests/libqtest.h b/tests/libqtest.h\nindex 817e3a5580..2a21bf4605 100644\n--- a/tests/libqtest.h\n+++ b/tests/libqtest.h\n@@ -27,7 +27,7 @@ extern QTestState *global_qtest;\n  * qtest_start_without_qmp_handshake:\n  * @extra_args: other arguments to pass to QEMU.\n  *\n- * Returns: #QTestState instance.  Does not affect #global_qtest.\n+ * Returns: #QTestState instance, handshaking not yet completed.\n  */\n QTestState *qtest_start_without_qmp_handshake(const char *extra_args);\n\n@@ -35,10 +35,7 @@ QTestState *qtest_start_without_qmp_handshake(const char *extra_args);\n  * qtest_start:\n  * @args: other arguments to pass to QEMU\n  *\n- * Start QEMU and assign the resulting #QTestState to #global_qtest.\n- * The global variable is used by \"shortcut\" functions documented below.\n- *\n- * Returns: #QTestState instance.\n+ * Returns: #QTestState instance, handshaking completed.\n  */\n QTestState *qtest_start(const char *args);\n\n@@ -47,10 +44,7 @@ QTestState *qtest_start(const char *args);\n  * @fmt...: Format for creating other arguments to pass to QEMU, formatted\n  * like sprintf().\n  *\n- * Start QEMU and return the resulting #QTestState (but unlike qtest_start(),\n- * #global_qtest is left at NULL).\n- *\n- * Returns: #QTestState instance.\n+ * Returns: #QTestState instance, handshaking completed.\n  */\n QTestState *qtest_startf(const char *fmt, ...) GCC_FMT_ATTR(1, 2);\n\n@@ -60,30 +54,11 @@ QTestState *qtest_startf(const char *fmt, ...) GCC_FMT_ATTR(1, 2);\n  * like vsprintf().\n  * @ap: Format arguments.\n  *\n- * Start QEMU and return the resulting #QTestState (but unlike qtest_start(),\n- * #global_qtest is left at NULL).\n- *\n- * Returns: #QTestState instance.\n+ * Returns: #QTestState instance, handshaking completed.\n  */\n QTestState *qtest_vstartf(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0);\n\n /**\n- * qtest_init:\n- * @extra_args: other arguments to pass to QEMU.\n- *\n- * Returns: #QTestState instance.  Does not affect #global_qtest.\n- */\n-static inline QTestState *qtest_init(const char *extra_args)\n-{\n-    QTestState *s;\n-\n-    assert(!global_qtest);\n-    s = qtest_start(extra_args);\n-    global_qtest = NULL;\n-    return s;\n-}\n-\n-/**\n  * qtest_quit:\n  * @s: #QTestState instance to operate on.\n  *\ndiff --git a/tests/libqtest.c b/tests/libqtest.c\nindex b535d7768f..44c89813ff 100644\n--- a/tests/libqtest.c\n+++ b/tests/libqtest.c\n@@ -242,7 +242,7 @@ QTestState *qtest_start(const char *extra_args)\n     qtest_qmp_discard_response(s, \"{ 'execute': 'qmp_capabilities' }\");\n\n     assert(!global_qtest);\n-    return global_qtest = s;\n+    return s;\n }\n\n QTestState *qtest_vstartf(const char *fmt, va_list ap)\n@@ -988,7 +988,7 @@ void qtest_cb_for_every_machine(void (*cb)(const char *machine))\n     QString *qstr;\n     const char *mname;\n\n-    qtest_start(\"-machine none\");\n+    global_qtest = qtest_start(\"-machine none\");\n     response = qmp(\"{ 'execute': 'query-machines' }\");\n     g_assert(response);\n     list = qdict_get_qlist(response, \"return\");\ndiff --git a/tests/ac97-test.c b/tests/ac97-test.c\nindex ca9b3dce88..2f5fb10632 100644\n--- a/tests/ac97-test.c\n+++ b/tests/ac97-test.c\n@@ -22,7 +22,7 @@ int main(int argc, char **argv)\n     g_test_init(&argc, &argv, NULL);\n     qtest_add_func(\"/ac97/nop\", nop);\n\n-    qtest_start(\"-device AC97\");\n+    global_qtest = qtest_start(\"-device AC97\");\n     ret = g_test_run();\n\n     qtest_quit(global_qtest);\ndiff --git a/tests/device-introspect-test.c b/tests/device-introspect-test.c\nindex b3227bd950..ed4f5f2eed 100644\n--- a/tests/device-introspect-test.c\n+++ b/tests/device-introspect-test.c\n@@ -126,7 +126,7 @@ static void test_device_intro_list(void)\n     QList *types;\n     char *help;\n\n-    qtest_start(common_args);\n+    global_qtest = qtest_start(common_args);\n\n     types = device_type_list(true);\n     QDECREF(types);\n@@ -167,7 +167,7 @@ static void test_qom_list_fields(void)\n     QList *non_abstract;\n     QListEntry *e;\n\n-    qtest_start(common_args);\n+    global_qtest = qtest_start(common_args);\n\n     all_types = qom_list_types(NULL, true);\n     non_abstract = qom_list_types(NULL, false);\n@@ -194,14 +194,14 @@ static void test_qom_list_fields(void)\n\n static void test_device_intro_none(void)\n {\n-    qtest_start(common_args);\n+    global_qtest = qtest_start(common_args);\n     test_one_device(\"nonexistent\");\n     qtest_quit(global_qtest);\n }\n\n static void test_device_intro_abstract(void)\n {\n-    qtest_start(common_args);\n+    global_qtest = qtest_start(common_args);\n     test_one_device(\"device\");\n     qtest_quit(global_qtest);\n }\n@@ -212,7 +212,7 @@ static void test_device_intro_concrete(void)\n     QListEntry *entry;\n     const char *type;\n\n-    qtest_start(common_args);\n+    global_qtest = qtest_start(common_args);\n     types = device_type_list(false);\n\n     QLIST_FOREACH_ENTRY(types, entry) {\n@@ -232,7 +232,7 @@ static void test_abstract_interfaces(void)\n     QListEntry *e;\n     QDict *index;\n\n-    qtest_start(common_args);\n+    global_qtest = qtest_start(common_args);\n\n     all_types = qom_list_types(\"interface\", true);\n     index = qom_type_index(all_types);\ndiff --git a/tests/display-vga-test.c b/tests/display-vga-test.c\nindex 8667330e3c..d638f15ec3 100644\n--- a/tests/display-vga-test.c\n+++ b/tests/display-vga-test.c\n@@ -12,39 +12,33 @@\n\n static void pci_cirrus(void)\n {\n-    qtest_start(\"-vga none -device cirrus-vga\");\n-    qtest_quit(global_qtest);\n+    qtest_quit(qtest_start(\"-vga none -device cirrus-vga\"));\n }\n\n static void pci_stdvga(void)\n {\n-    qtest_start(\"-vga none -device VGA\");\n-    qtest_quit(global_qtest);\n+    qtest_quit(qtest_start(\"-vga none -device VGA\"));\n }\n\n static void pci_secondary(void)\n {\n-    qtest_start(\"-vga none -device secondary-vga\");\n-    qtest_quit(global_qtest);\n+    qtest_quit(qtest_start(\"-vga none -device secondary-vga\"));\n }\n\n static void pci_multihead(void)\n {\n-    qtest_start(\"-vga none -device VGA -device secondary-vga\");\n-    qtest_quit(global_qtest);\n+    qtest_quit(qtest_start(\"-vga none -device VGA -device secondary-vga\"));\n }\n\n static void pci_virtio_gpu(void)\n {\n-    qtest_start(\"-vga none -device virtio-gpu-pci\");\n-    qtest_quit(global_qtest);\n+    qtest_quit(qtest_start(\"-vga none -device virtio-gpu-pci\"));\n }\n\n #ifdef CONFIG_VIRTIO_VGA\n static void pci_virtio_vga(void)\n {\n-    qtest_start(\"-vga none -device virtio-vga\");\n-    qtest_quit(global_qtest);\n+    qtest_quit(qtest_start(\"-vga none -device virtio-vga\"));\n }\n #endif\n\ndiff --git a/tests/drive_del-test.c b/tests/drive_del-test.c\nindex 16d256fe64..f68c4bc176 100644\n--- a/tests/drive_del-test.c\n+++ b/tests/drive_del-test.c\n@@ -45,7 +45,7 @@ static void device_del(void)\n static void test_drive_without_dev(void)\n {\n     /* Start with an empty drive */\n-    qtest_start(\"-drive if=none,id=drive0\");\n+    global_qtest = qtest_start(\"-drive if=none,id=drive0\");\n\n     /* Delete the drive */\n     drive_del();\n@@ -63,7 +63,7 @@ static void test_after_failed_device_add(void)\n     QDict *response;\n     QDict *error;\n\n-    qtest_start(\"-drive if=none,id=drive0\");\n+    global_qtest = qtest_start(\"-drive if=none,id=drive0\");\n\n     /* Make device_add fail.  If this leaks the virtio-blk-pci device then a\n      * reference to drive0 will also be held (via qdev properties).\n@@ -92,9 +92,10 @@ static void test_after_failed_device_add(void)\n static void test_drive_del_device_del(void)\n {\n     /* Start with a drive used by a device that unplugs instantaneously */\n-    qtest_start(\"-drive if=none,id=drive0,file=null-co://,format=raw\"\n-                \" -device virtio-scsi-pci\"\n-                \" -device scsi-hd,drive=drive0,id=dev0\");\n+    global_qtest = qtest_start(\n+        \"-drive if=none,id=drive0,file=null-co://,format=raw\"\n+        \" -device virtio-scsi-pci\"\n+        \" -device scsi-hd,drive=drive0,id=dev0\");\n\n     /*\n      * Delete the drive, and then the device\ndiff --git a/tests/es1370-test.c b/tests/es1370-test.c\nindex 5578ff94fa..ff6fdbfe57 100644\n--- a/tests/es1370-test.c\n+++ b/tests/es1370-test.c\n@@ -22,7 +22,7 @@ int main(int argc, char **argv)\n     g_test_init(&argc, &argv, NULL);\n     qtest_add_func(\"/es1370/nop\", nop);\n\n-    qtest_start(\"-device ES1370\");\n+    global_qtest = qtest_start(\"-device ES1370\");\n     ret = g_test_run();\n\n     qtest_quit(global_qtest);\ndiff --git a/tests/fdc-test.c b/tests/fdc-test.c\nindex e63e93179a..ec83625db2 100644\n--- a/tests/fdc-test.c\n+++ b/tests/fdc-test.c\n@@ -564,7 +564,7 @@ int main(int argc, char **argv)\n     /* Run the tests */\n     g_test_init(&argc, &argv, NULL);\n\n-    qtest_start(\"-device floppy,id=floppy0\");\n+    global_qtest = qtest_start(\"-device floppy,id=floppy0\");\n     qtest_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);\ndiff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c\nindex 3a8dc7a2cd..37214fdf10 100644\n--- a/tests/fw_cfg-test.c\n+++ b/tests/fw_cfg-test.c\n@@ -106,7 +106,7 @@ int main(int argc, char **argv)\n\n     g_test_init(&argc, &argv, NULL);\n\n-    s = qtest_init(\"-uuid 4600cb32-38ec-4b2f-8acb-81c6ea54f2d8\");\n+    s = qtest_start(\"-uuid 4600cb32-38ec-4b2f-8acb-81c6ea54f2d8\");\n\n     fw_cfg = pc_fw_cfg_init(s);\n\ndiff --git a/tests/hd-geo-test.c b/tests/hd-geo-test.c\nindex 67d571ef13..406eea3c56 100644\n--- a/tests/hd-geo-test.c\n+++ b/tests/hd-geo-test.c\n@@ -241,7 +241,7 @@ static void test_ide_none(void)\n\n     setup_common(argv, ARGV_SIZE);\n     args = g_strjoinv(\" \", argv);\n-    qtest_start(args);\n+    global_qtest = qtest_start(args);\n     g_strfreev(argv);\n     g_free(args);\n     test_cmos();\n@@ -263,7 +263,7 @@ static void test_ide_mbr(bool use_device, MBRcontents mbr)\n         argc = setup_ide(argc, argv, ARGV_SIZE, i, dev, i, mbr, \"\");\n     }\n     args = g_strjoinv(\" \", argv);\n-    qtest_start(args);\n+    global_qtest = qtest_start(args);\n     g_strfreev(argv);\n     g_free(args);\n     test_cmos();\n@@ -339,7 +339,7 @@ static void test_ide_drive_user(const char *dev, bool trans)\n                      dev ? \"\" : opts);\n     g_free(opts);\n     args = g_strjoinv(\" \", argv);\n-    qtest_start(args);\n+    global_qtest = qtest_start(args);\n     g_strfreev(argv);\n     g_free(args);\n     test_cmos();\n@@ -396,7 +396,7 @@ static void test_ide_drive_cd_0(void)\n                          ide_idx, NULL, i, mbr_blank, \"\");\n     }\n     args = g_strjoinv(\" \", argv);\n-    qtest_start(args);\n+    global_qtest = qtest_start(args);\n     g_strfreev(argv);\n     g_free(args);\n     test_cmos();\ndiff --git a/tests/i440fx-test.c b/tests/i440fx-test.c\nindex c282ded4ca..1d78089f8e 100644\n--- a/tests/i440fx-test.c\n+++ b/tests/i440fx-test.c\n@@ -340,7 +340,7 @@ static void test_i440fx_firmware(FirmwareTestFixture *fixture,\n                                          : \"-drive if=pflash,format=raw,file=\",\n                               fw_pathname);\n     g_test_message(\"qemu cmdline: %s\", cmdline);\n-    qtest_start(cmdline);\n+    global_qtest = qtest_start(cmdline);\n     g_free(cmdline);\n\n     /* QEMU has loaded the firmware (because qtest_start() only returns after\ndiff --git a/tests/i82801b11-test.c b/tests/i82801b11-test.c\nindex 0c94876626..b76714ae16 100644\n--- a/tests/i82801b11-test.c\n+++ b/tests/i82801b11-test.c\n@@ -22,7 +22,8 @@ int main(int argc, char **argv)\n     g_test_init(&argc, &argv, NULL);\n     qtest_add_func(\"/i82801b11/nop\", nop);\n\n-    qtest_start(\"-machine q35 -device i82801b11-bridge,bus=pcie.0,addr=1e.0\");\n+    global_qtest = qtest_start(\"-machine q35 \"\n+                               \"-device i82801b11-bridge,bus=pcie.0,addr=1e.0\");\n     ret = g_test_run();\n\n     qtest_quit(global_qtest);\ndiff --git a/tests/intel-hda-test.c b/tests/intel-hda-test.c\nindex ce24fbac1f..c97a7635ed 100644\n--- a/tests/intel-hda-test.c\n+++ b/tests/intel-hda-test.c\n@@ -18,15 +18,14 @@\n /* Tests only initialization so far. TODO: Replace with functional tests */\n static void ich6_test(void)\n {\n-    qtest_start(\"-device intel-hda,id=\" HDA_ID CODEC_DEVICES);\n-    qtest_quit(global_qtest);\n+    qtest_quit(qtest_start(\"-device intel-hda,id=\" HDA_ID CODEC_DEVICES));\n }\n\n static void ich9_test(void)\n {\n-    qtest_start(\"-machine q35 -device ich9-intel-hda,bus=pcie.0,addr=1b.0,id=\"\n-                HDA_ID CODEC_DEVICES);\n-    qtest_quit(global_qtest);\n+    qtest_quit(qtest_start(\n+        \"-machine q35 -device ich9-intel-hda,bus=pcie.0,addr=1b.0,id=\"\n+        HDA_ID CODEC_DEVICES));\n }\n\n int main(int argc, char **argv)\ndiff --git a/tests/ioh3420-test.c b/tests/ioh3420-test.c\nindex f2ca373e87..aff569b99e 100644\n--- a/tests/ioh3420-test.c\n+++ b/tests/ioh3420-test.c\n@@ -22,8 +22,9 @@ int main(int argc, char **argv)\n     g_test_init(&argc, &argv, NULL);\n     qtest_add_func(\"/ioh3420/nop\", nop);\n\n-    qtest_start(\"-machine q35 -device ioh3420,bus=pcie.0,addr=1c.0,port=1,\"\n-                \"chassis=1,multifunction=on\");\n+    global_qtest = qtest_start(\n+        \"-machine q35 -device ioh3420,bus=pcie.0,addr=1c.0,port=1,\"\n+        \"chassis=1,multifunction=on\");\n     ret = g_test_run();\n\n     qtest_quit(global_qtest);\ndiff --git a/tests/ipmi-kcs-test.c b/tests/ipmi-kcs-test.c\nindex 178ffc1797..5acc0d9e35 100644\n--- a/tests/ipmi-kcs-test.c\n+++ b/tests/ipmi-kcs-test.c\n@@ -264,7 +264,6 @@ static void test_enable_irq(void)\n int main(int argc, char **argv)\n {\n     const char *arch = qtest_get_arch();\n-    char *cmdline;\n     int ret;\n\n     /* Check architecture */\n@@ -276,10 +275,8 @@ int main(int argc, char **argv)\n     /* Run the tests */\n     g_test_init(&argc, &argv, NULL);\n\n-    cmdline = g_strdup_printf(\"-device ipmi-bmc-sim,id=bmc0\"\n-                              \" -device isa-ipmi-kcs,bmc=bmc0\");\n-    qtest_start(cmdline);\n-    g_free(cmdline);\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     qtest_add_func(\"/ipmi/local/kcs_base\", test_kcs_base);\n     qtest_add_func(\"/ipmi/local/kcs_abort\", test_kcs_abort);\ndiff --git a/tests/ipoctal232-test.c b/tests/ipoctal232-test.c\nindex d17a93449f..90b683284a 100644\n--- a/tests/ipoctal232-test.c\n+++ b/tests/ipoctal232-test.c\n@@ -22,7 +22,8 @@ int main(int argc, char **argv)\n     g_test_init(&argc, &argv, NULL);\n     qtest_add_func(\"/ipoctal232/tpci200/nop\", nop);\n\n-    qtest_start(\"-device tpci200,id=ipack0 -device ipoctal232,bus=ipack0.0\");\n+    global_qtest = qtest_start(\"-device tpci200,id=ipack0 \"\n+                               \"-device ipoctal232,bus=ipack0.0\");\n     ret = g_test_run();\n\n     qtest_quit(global_qtest);\ndiff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c\nindex 58eaf0cafb..aa5619c62c 100644\n--- a/tests/ivshmem-test.c\n+++ b/tests/ivshmem-test.c\n@@ -407,7 +407,7 @@ static void test_ivshmem_hotplug(void)\n     gchar *opts;\n     QTestState *qts;\n\n-    qts = qtest_init(\"\");\n+    qts = qtest_start(\"\");\n\n     opts = g_strdup_printf(\"'shm': '%s', 'size': '1M'\", tmpshm);\n\ndiff --git a/tests/m48t59-test.c b/tests/m48t59-test.c\nindex 0f921ef38a..aadd770f4f 100644\n--- a/tests/m48t59-test.c\n+++ b/tests/m48t59-test.c\n@@ -246,7 +246,7 @@ int main(int argc, char **argv)\n\n     g_test_init(&argc, &argv, NULL);\n\n-    s = qtest_start(\"-rtc clock=vm\");\n+    s = global_qtest = qtest_start(\"-rtc clock=vm\");\n\n     qtest_add_func(\"/rtc/bcd/check-time\", bcd_check_time);\n     qtest_add_func(\"/rtc/fuzz-registers\", fuzz_registers);\ndiff --git a/tests/ne2000-test.c b/tests/ne2000-test.c\nindex cae83c5c4c..8e6f7b07c6 100644\n--- a/tests/ne2000-test.c\n+++ b/tests/ne2000-test.c\n@@ -22,7 +22,7 @@ int main(int argc, char **argv)\n     g_test_init(&argc, &argv, NULL);\n     qtest_add_func(\"/ne2000/pci/nop\", pci_nop);\n\n-    qtest_start(\"-device ne2k_pci\");\n+    global_qtest = qtest_start(\"-device ne2k_pci\");\n     ret = g_test_run();\n\n     qtest_quit(global_qtest);\ndiff --git a/tests/nvme-test.c b/tests/nvme-test.c\nindex 3d6c0f39cf..b054ad6fcd 100644\n--- a/tests/nvme-test.c\n+++ b/tests/nvme-test.c\n@@ -22,8 +22,9 @@ int main(int argc, char **argv)\n     g_test_init(&argc, &argv, NULL);\n     qtest_add_func(\"/nvme/nop\", nop);\n\n-    qtest_start(\"-drive id=drv0,if=none,file=null-co://,format=raw \"\n-                \"-device nvme,drive=drv0,serial=foo\");\n+    global_qtest = qtest_start(\n+        \"-drive id=drv0,if=none,file=null-co://,format=raw \"\n+        \"-device nvme,drive=drv0,serial=foo\");\n     ret = g_test_run();\n\n     qtest_quit(global_qtest);\ndiff --git a/tests/pcnet-test.c b/tests/pcnet-test.c\nindex 98246d3504..a58a5fd7bf 100644\n--- a/tests/pcnet-test.c\n+++ b/tests/pcnet-test.c\n@@ -22,7 +22,7 @@ int main(int argc, char **argv)\n     g_test_init(&argc, &argv, NULL);\n     qtest_add_func(\"/pcnet/pci/nop\", pci_nop);\n\n-    qtest_start(\"-device pcnet\");\n+    global_qtest = qtest_start(\"-device pcnet\");\n     ret = g_test_run();\n\n     qtest_quit(global_qtest);\ndiff --git a/tests/postcopy-test.c b/tests/postcopy-test.c\nindex 0e5fe20a83..efee20a099 100644\n--- a/tests/postcopy-test.c\n+++ b/tests/postcopy-test.c\n@@ -403,10 +403,10 @@ static void test_migrate(void)\n\n     g_free(bootpath);\n\n-    from = qtest_init(cmd_src);\n+    from = qtest_start(cmd_src);\n     g_free(cmd_src);\n\n-    to = qtest_init(cmd_dst);\n+    to = qtest_start(cmd_dst);\n     g_free(cmd_dst);\n\n     assert(!global_qtest);\ndiff --git a/tests/pvpanic-test.c b/tests/pvpanic-test.c\nindex 5d99b3d9e2..c09b3ddac6 100644\n--- a/tests/pvpanic-test.c\n+++ b/tests/pvpanic-test.c\n@@ -37,7 +37,7 @@ int main(int argc, char **argv)\n     g_test_init(&argc, &argv, NULL);\n     qtest_add_func(\"/pvpanic/panic\", test_panic);\n\n-    qtest_start(\"-device pvpanic\");\n+    global_qtest = qtest_start(\"-device pvpanic\");\n     ret = g_test_run();\n\n     qtest_quit(global_qtest);\ndiff --git a/tests/q35-test.c b/tests/q35-test.c\nindex a8e24e5b71..4d90b9174e 100644\n--- a/tests/q35-test.c\n+++ b/tests/q35-test.c\n@@ -84,7 +84,7 @@ static void test_smram_lock(void)\n     QPCIDevice *pcidev;\n     QDict *response;\n\n-    qtest_start(\"-M q35\");\n+    global_qtest = qtest_start(\"-M q35\");\n\n     pcibus = qpci_init_pc(global_qtest, NULL);\n     g_assert(pcibus != NULL);\n@@ -141,7 +141,7 @@ static void test_tseg_size(const void *data)\n         cmdline = g_strdup_printf(\"-M q35 -m %uM\",\n                                   TSEG_SIZE_TEST_GUEST_RAM_MBYTES);\n     }\n-    qtest_start(cmdline);\n+    global_qtest = qtest_start(cmdline);\n     g_free(cmdline);\n\n     /* locate the DRAM controller */\ndiff --git a/tests/qmp-test.c b/tests/qmp-test.c\nindex 8985e7f9ec..6ea66211d4 100644\n--- a/tests/qmp-test.c\n+++ b/tests/qmp-test.c\n@@ -172,7 +172,7 @@ static void test_query(const void *data)\n     QDict *resp, *error;\n     const char *error_class;\n\n-    qtest_start(common_args);\n+    global_qtest = qtest_start(common_args);\n\n     resp = qmp(\"{ 'execute': %s }\", cmd);\n     error = qdict_get_qdict(resp, \"error\");\n@@ -224,7 +224,7 @@ static void qmp_schema_init(QmpSchema *schema)\n     Visitor *qiv;\n     SchemaInfoList *tail;\n\n-    qtest_start(common_args);\n+    global_qtest = qtest_start(common_args);\n     resp = qmp(\"{ 'execute': 'query-qmp-schema' }\");\n\n     qiv = qobject_input_visitor_new(qdict_get(resp, \"return\"));\ndiff --git a/tests/rtc-test.c b/tests/rtc-test.c\nindex d7a96cbd79..dd5430dd2d 100644\n--- a/tests/rtc-test.c\n+++ b/tests/rtc-test.c\n@@ -690,7 +690,7 @@ int main(int argc, char **argv)\n\n     g_test_init(&argc, &argv, NULL);\n\n-    s = qtest_start(\"-rtc clock=vm\");\n+    s = global_qtest = qtest_start(\"-rtc clock=vm\");\n     qtest_irq_intercept_in(s, \"ioapic\");\n\n     qtest_add_func(\"/rtc/check-time/bcd\", bcd_check_time);\ndiff --git a/tests/rtl8139-test.c b/tests/rtl8139-test.c\nindex 317eb586b5..1741f0ec47 100644\n--- a/tests/rtl8139-test.c\n+++ b/tests/rtl8139-test.c\n@@ -197,7 +197,7 @@ int main(int argc, char **argv)\n {\n     int ret;\n\n-    qtest_start(\"-device rtl8139\");\n+    global_qtest = qtest_start(\"-device rtl8139\");\n\n     g_test_init(&argc, &argv, NULL);\n     qtest_add_func(\"/rtl8139/nop\", nop);\ndiff --git a/tests/spapr-phb-test.c b/tests/spapr-phb-test.c\nindex e76987ace9..5ab22f3ba6 100644\n--- a/tests/spapr-phb-test.c\n+++ b/tests/spapr-phb-test.c\n@@ -21,15 +21,16 @@ static void test_phb_device(void)\n int main(int argc, char **argv)\n {\n     int ret;\n+    QTestState *qts;\n\n     g_test_init(&argc, &argv, NULL);\n     qtest_add_func(\"/spapr-phb/device\", test_phb_device);\n\n-    qtest_start(\"-device \" TYPE_SPAPR_PCI_HOST_BRIDGE \",index=30\");\n+    qts = qtest_start(\"-device \" TYPE_SPAPR_PCI_HOST_BRIDGE \",index=30\");\n\n     ret = g_test_run();\n\n-    qtest_quit(global_qtest);\n+    qtest_quit(qts);\n\n     return ret;\n }\ndiff --git a/tests/test-arm-mptimer.c b/tests/test-arm-mptimer.c\nindex 823db9ebc9..9631c55fe3 100644\n--- a/tests/test-arm-mptimer.c\n+++ b/tests/test-arm-mptimer.c\n@@ -1097,7 +1097,7 @@ tests_with_prescaler_arg:\n         goto tests_with_prescaler_arg;\n     }\n\n-    qtest_start(\"-machine vexpress-a9\");\n+    global_qtest = qtest_start(\"-machine vexpress-a9\");\n     ret = g_test_run();\n     qtest_quit(global_qtest);\n\ndiff --git a/tests/test-x86-cpuid-compat.c b/tests/test-x86-cpuid-compat.c\nindex 4e88f9e4e2..84410c63b9 100644\n--- a/tests/test-x86-cpuid-compat.c\n+++ b/tests/test-x86-cpuid-compat.c\n@@ -59,7 +59,7 @@ static void test_cpuid_prop(const void *data)\n     QNum *value;\n     int64_t val;\n\n-    qtest_start(args->cmdline);\n+    global_qtest = qtest_start(args->cmdline);\n     path = get_cpu0_qom_path();\n     value = qobject_to_qnum(qom_get(path, args->property));\n     g_assert(qnum_get_try_int(value, &val));\n@@ -131,7 +131,7 @@ static void test_feature_flag(const void *data)\n     QList *present, *filtered;\n     uint32_t value;\n\n-    qtest_start(args->cmdline);\n+    global_qtest = qtest_start(args->cmdline);\n     path = get_cpu0_qom_path();\n     present = qobject_to_qlist(qom_get(path, \"feature-words\"));\n     filtered = qobject_to_qlist(qom_get(path, \"filtered-features\"));\n@@ -181,7 +181,8 @@ static void test_plus_minus_subprocess(void)\n      * Note: rules 1 and 2 are planned to be removed soon, and\n      * should generate a warning.\n      */\n-    qtest_start(\"-cpu pentium,-fpu,+fpu,-mce,mce=on,+cx8,cx8=off,+sse4_1,sse4_2=on\");\n+    global_qtest = qtest_start(\"-cpu pentium,-fpu,+fpu,-mce,mce=on,+cx8,\"\n+                               \"cx8=off,+sse4_1,sse4_2=on\");\n     path = get_cpu0_qom_path();\n\n     g_assert_false(qom_get_bool(path, \"fpu\"));\ndiff --git a/tests/tmp105-test.c b/tests/tmp105-test.c\nindex 382f88ba23..3f2cb3a864 100644\n--- a/tests/tmp105-test.c\n+++ b/tests/tmp105-test.c\n@@ -154,6 +154,7 @@ int main(int argc, char **argv)\n     s = qtest_start(\"-machine n800 \"\n                     \"-device tmp105,bus=i2c-bus.0,id=\" TMP105_TEST_ID\n                     \",address=0x49\");\n+    global_qtest = s;\n     i2c = omap_i2c_create(s, OMAP2_I2C_1_BASE);\n\n     qtest_add_func(\"/tmp105/tx-rx\", send_and_receive);\ndiff --git a/tests/tpci200-test.c b/tests/tpci200-test.c\nindex 3b756d10f0..223d44da35 100644\n--- a/tests/tpci200-test.c\n+++ b/tests/tpci200-test.c\n@@ -22,7 +22,7 @@ int main(int argc, char **argv)\n     g_test_init(&argc, &argv, NULL);\n     qtest_add_func(\"/tpci200/nop\", nop);\n\n-    qtest_start(\"-device tpci200\");\n+    global_qtest = qtest_start(\"-device tpci200\");\n     ret = g_test_run();\n\n     qtest_quit(global_qtest);\ndiff --git a/tests/usb-hcd-ehci-test.c b/tests/usb-hcd-ehci-test.c\nindex 16d74512cc..c3568a1782 100644\n--- a/tests/usb-hcd-ehci-test.c\n+++ b/tests/usb-hcd-ehci-test.c\n@@ -156,17 +156,18 @@ int main(int argc, char **argv)\n     qtest_add_func(\"/ehci/pci/ehci-port-2\", pci_ehci_port_2);\n     qtest_add_func(\"/ehci/pci/ehci-port-3-hotplug\", pci_ehci_port_hotplug);\n\n-    qtest_start(\"-machine q35 -device ich9-usb-ehci1,bus=pcie.0,addr=1d.7,\"\n-                \"multifunction=on,id=ich9-ehci-1 \"\n-                \"-device ich9-usb-uhci1,bus=pcie.0,addr=1d.0,\"\n-                \"multifunction=on,masterbus=ich9-ehci-1.0,firstport=0 \"\n-                \"-device ich9-usb-uhci2,bus=pcie.0,addr=1d.1,\"\n-                \"multifunction=on,masterbus=ich9-ehci-1.0,firstport=2 \"\n-                \"-device ich9-usb-uhci3,bus=pcie.0,addr=1d.2,\"\n-                \"multifunction=on,masterbus=ich9-ehci-1.0,firstport=4 \"\n-                \"-drive if=none,id=usbcdrom,media=cdrom \"\n-                \"-device usb-tablet,bus=ich9-ehci-1.0,port=1,usb_version=1 \"\n-                \"-device usb-storage,bus=ich9-ehci-1.0,port=2,drive=usbcdrom \");\n+    global_qtest = qtest_start(\n+        \"-machine q35 -device ich9-usb-ehci1,bus=pcie.0,addr=1d.7,\"\n+        \"multifunction=on,id=ich9-ehci-1 \"\n+        \"-device ich9-usb-uhci1,bus=pcie.0,addr=1d.0,\"\n+        \"multifunction=on,masterbus=ich9-ehci-1.0,firstport=0 \"\n+        \"-device ich9-usb-uhci2,bus=pcie.0,addr=1d.1,\"\n+        \"multifunction=on,masterbus=ich9-ehci-1.0,firstport=2 \"\n+        \"-device ich9-usb-uhci3,bus=pcie.0,addr=1d.2,\"\n+        \"multifunction=on,masterbus=ich9-ehci-1.0,firstport=4 \"\n+        \"-drive if=none,id=usbcdrom,media=cdrom \"\n+        \"-device usb-tablet,bus=ich9-ehci-1.0,port=1,usb_version=1 \"\n+        \"-device usb-storage,bus=ich9-ehci-1.0,port=2,drive=usbcdrom \");\n\n     test_init();\n     ret = g_test_run();\ndiff --git a/tests/usb-hcd-ohci-test.c b/tests/usb-hcd-ohci-test.c\nindex aa38e44d03..62fd35f69a 100644\n--- a/tests/usb-hcd-ohci-test.c\n+++ b/tests/usb-hcd-ohci-test.c\n@@ -31,7 +31,7 @@ int main(int argc, char **argv)\n     qtest_add_func(\"/ohci/pci/init\", test_ohci_init);\n     qtest_add_func(\"/ohci/pci/hotplug\", test_ohci_hotplug);\n\n-    qtest_start(\"-device pci-ohci,id=ohci\");\n+    global_qtest = qtest_start(\"-device pci-ohci,id=ohci\");\n     ret = g_test_run();\n     qtest_quit(global_qtest);\n\ndiff --git a/tests/usb-hcd-xhci-test.c b/tests/usb-hcd-xhci-test.c\nindex e45509741c..bd3c65ae85 100644\n--- a/tests/usb-hcd-xhci-test.c\n+++ b/tests/usb-hcd-xhci-test.c\n@@ -80,8 +80,9 @@ int main(int argc, char **argv)\n     qtest_add_func(\"/xhci/pci/hotplug\", test_xhci_hotplug);\n     qtest_add_func(\"/xhci/pci/hotplug/usb-uas\", test_usb_uas_hotplug);\n\n-    qtest_start(\"-device nec-usb-xhci,id=xhci\"\n-                \" -drive id=drive0,if=none,file=null-co://,format=raw\");\n+    global_qtest = qtest_start(\n+        \"-device nec-usb-xhci,id=xhci\"\n+        \" -drive id=drive0,if=none,file=null-co://,format=raw\");\n     ret = g_test_run();\n     qtest_quit(global_qtest);\n\ndiff --git a/tests/virtio-balloon-test.c b/tests/virtio-balloon-test.c\nindex 34ad718601..cca7b0e8fb 100644\n--- a/tests/virtio-balloon-test.c\n+++ b/tests/virtio-balloon-test.c\n@@ -22,7 +22,7 @@ int main(int argc, char **argv)\n     g_test_init(&argc, &argv, NULL);\n     qtest_add_func(\"/virtio/balloon/pci/nop\", pci_nop);\n\n-    qtest_start(\"-device virtio-balloon-pci\");\n+    global_qtest = qtest_start(\"-device virtio-balloon-pci\");\n     ret = g_test_run();\n\n     qtest_quit(global_qtest);\ndiff --git a/tests/virtio-console-test.c b/tests/virtio-console-test.c\nindex 5c036ce02a..07a5f26880 100644\n--- a/tests/virtio-console-test.c\n+++ b/tests/virtio-console-test.c\n@@ -13,16 +13,14 @@\n /* Tests only initialization so far. TODO: Replace with functional tests */\n static void console_pci_nop(void)\n {\n-    qtest_start(\"-device virtio-serial-pci,id=vser0 \"\n-                \"-device virtconsole,bus=vser0.0\");\n-    qtest_quit(global_qtest);\n+    qtest_quit(qtest_start(\"-device virtio-serial-pci,id=vser0 \"\n+                           \"-device virtconsole,bus=vser0.0\"));\n }\n\n static void serialport_pci_nop(void)\n {\n-    qtest_start(\"-device virtio-serial-pci,id=vser0 \"\n-                \"-device virtserialport,bus=vser0.0\");\n-    qtest_quit(global_qtest);\n+    qtest_quit(qtest_start(\"-device virtio-serial-pci,id=vser0 \"\n+                           \"-device virtserialport,bus=vser0.0\"));\n }\n\n int main(int argc, char **argv)\ndiff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c\nindex e1085c7e77..9250c417a9 100644\n--- a/tests/virtio-net-test.c\n+++ b/tests/virtio-net-test.c\n@@ -246,7 +246,7 @@ static void hotplug(void)\n {\n     const char *arch = qtest_get_arch();\n\n-    qtest_start(\"-device virtio-net-pci\");\n+    global_qtest = qtest_start(\"-device virtio-net-pci\");\n\n     qpci_plug_device_test(global_qtest, \"virtio-net-pci\", \"net1\",\n                           PCI_SLOT_HP, NULL);\ndiff --git a/tests/virtio-rng-test.c b/tests/virtio-rng-test.c\nindex a3a8bde491..e632281fa4 100644\n--- a/tests/virtio-rng-test.c\n+++ b/tests/virtio-rng-test.c\n@@ -38,7 +38,7 @@ int main(int argc, char **argv)\n     qtest_add_func(\"/virtio/rng/pci/nop\", pci_nop);\n     qtest_add_func(\"/virtio/rng/pci/hotplug\", hotplug);\n\n-    qtest_start(\"-device virtio-rng-pci\");\n+    global_qtest = qtest_start(\"-device virtio-rng-pci\");\n     ret = g_test_run();\n\n     qtest_quit(global_qtest);\ndiff --git a/tests/virtio-serial-test.c b/tests/virtio-serial-test.c\nindex d0bbc2a8c9..1cc43465e6 100644\n--- a/tests/virtio-serial-test.c\n+++ b/tests/virtio-serial-test.c\n@@ -49,7 +49,7 @@ int main(int argc, char **argv)\n     qtest_add_func(\"/virtio/serial/pci/nop\", pci_nop);\n     qtest_add_func(\"/virtio/serial/pci/hotplug\", hotplug);\n\n-    qtest_start(\"-device virtio-serial-pci\");\n+    global_qtest = qtest_start(\"-device virtio-serial-pci\");\n     ret = g_test_run();\n\n     qtest_quit(global_qtest);\ndiff --git a/tests/vmxnet3-test.c b/tests/vmxnet3-test.c\nindex 631630b4d0..0b4b807616 100644\n--- a/tests/vmxnet3-test.c\n+++ b/tests/vmxnet3-test.c\n@@ -22,7 +22,7 @@ int main(int argc, char **argv)\n     g_test_init(&argc, &argv, NULL);\n     qtest_add_func(\"/vmxnet3/nop\", nop);\n\n-    qtest_start(\"-device vmxnet3\");\n+    global_qtest = qtest_start(\"-device vmxnet3\");\n     ret = g_test_run();\n\n     qtest_quit(global_qtest);\ndiff --git a/tests/wdt_ib700-test.c b/tests/wdt_ib700-test.c\nindex 4bb8374011..a169265e16 100644\n--- a/tests/wdt_ib700-test.c\n+++ b/tests/wdt_ib700-test.c\n@@ -56,7 +56,7 @@ static QDict *ib700_program_and_wait(QTestState *s)\n static void ib700_pause(void)\n {\n     QDict *d;\n-    QTestState *s = qtest_init(\"-watchdog-action pause -device ib700\");\n+    QTestState *s = qtest_start(\"-watchdog-action pause -device ib700\");\n\n     qtest_irq_intercept_in(s, \"ioapic\");\n     d = ib700_program_and_wait(s);\n@@ -69,7 +69,7 @@ static void ib700_pause(void)\n static void ib700_reset(void)\n {\n     QDict *d;\n-    QTestState *s = qtest_init(\"-watchdog-action reset -device ib700\");\n+    QTestState *s = qtest_start(\"-watchdog-action reset -device ib700\");\n\n     qtest_irq_intercept_in(s, \"ioapic\");\n     d = ib700_program_and_wait(s);\n@@ -84,7 +84,7 @@ static void ib700_shutdown(void)\n     QDict *d;\n     QTestState *s;\n\n-    s = qtest_init(\"-watchdog-action reset -no-reboot -device ib700\");\n+    s = qtest_start(\"-watchdog-action reset -no-reboot -device ib700\");\n     qtest_irq_intercept_in(s, \"ioapic\");\n     d = ib700_program_and_wait(s);\n     g_assert(!strcmp(qdict_get_str(d, \"action\"), \"reset\"));\n@@ -96,7 +96,7 @@ static void ib700_shutdown(void)\n static void ib700_none(void)\n {\n     QDict *d;\n-    QTestState *s = qtest_init(\"-watchdog-action none -device ib700\");\n+    QTestState *s = qtest_start(\"-watchdog-action none -device ib700\");\n\n     qtest_irq_intercept_in(s, \"ioapic\");\n     d = ib700_program_and_wait(s);\n",
    "prefixes": [
        "v7",
        "29/38"
    ]
}