Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/812507/?format=api
{ "id": 812507, "url": "http://patchwork.ozlabs.org/api/patches/812507/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170911172022.4738-24-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-24-eblake@redhat.com>", "list_archive_url": null, "date": "2017-09-11T17:20:07", "name": "[v7,23/38] tests/boot-sector: Drop dependence on global_qtest", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "e144a8b9df6325be85d0be7370478fe2c1f67389", "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-24-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/812507/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/812507/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 3xrb9F0t7fz9s7F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 03:52:17 +1000 (AEST)", "from localhost ([::1]:59492 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 1drSsZ-0002Jh-5T\n\tfor incoming@patchwork.ozlabs.org; Mon, 11 Sep 2017 13:52:15 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:38711)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1drSOe-0007cn-79\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:21:21 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1drSOd-0001KE-77\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:21:20 -0400", "from mx1.redhat.com ([209.132.183.28]:64535)\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>) id 1drSOc-0001Jo-VY\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:21:19 -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 0F2BBCC9B8;\n\tMon, 11 Sep 2017 17:21:18 +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 3CCB95F91A;\n\tMon, 11 Sep 2017 17:21:14 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 0F2BBCC9B8", "From": "Eric Blake <eblake@redhat.com>", "To": "qemu-devel@nongnu.org", "Date": "Mon, 11 Sep 2017 12:20:07 -0500", "Message-Id": "<20170911172022.4738-24-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:18 +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 23/38] tests/boot-sector: Drop dependence on\n\tglobal_qtest", "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, Ben Warren <ben@skyportsystems.com>,\n\t\"Michael S. Tsirkin\" <mst@redhat.com>, armbru@redhat.com,\n\tIgor Mammedov <imammedo@redhat.com>, pbonzini@redhat.com", "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": "As a general rule, we prefer avoiding implicit global state\nbecause it makes code harder to safely copy and paste without\nthinking about the global state. Adjust the helper code to\nuse explicit state instead, and update all callers.\n\nFix some trailing whitespace while touching the file.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nReviewed-by: Thomas Huth <thuth@redhat.com>\nAcked-by: Michael S. Tsirkin <mst@redhat.com>\n---\n tests/boot-sector.h | 6 ++++--\n tests/bios-tables-test.c | 2 +-\n tests/boot-sector.c | 8 ++++----\n tests/pxe-test.c | 2 +-\n tests/vmgenid-test.c | 2 +-\n 5 files changed, 11 insertions(+), 9 deletions(-)", "diff": "diff --git a/tests/boot-sector.h b/tests/boot-sector.h\nindex 35d61c7e2b..6ee6bb4d97 100644\n--- a/tests/boot-sector.h\n+++ b/tests/boot-sector.h\n@@ -5,7 +5,7 @@\n *\n * Authors:\n * Michael S. Tsirkin <mst@redhat.com>\n- * Victor Kaplansky <victork@redhat.com> \n+ * Victor Kaplansky <victork@redhat.com>\n *\n * This work is licensed under the terms of the GNU GPL, version 2 or later.\n * See the COPYING file in the top-level directory.\n@@ -14,11 +14,13 @@\n #ifndef TEST_BOOT_SECTOR_H\n #define TEST_BOOT_SECTOR_H\n\n+#include \"libqtest.h\"\n+\n /* Create boot disk file. fname must be a suitable string for mkstemp() */\n int boot_sector_init(char *fname);\n\n /* Loop until signature in memory is OK. */\n-void boot_sector_test(void);\n+void boot_sector_test(QTestState *qts);\n\n /* unlink boot disk file. */\n void boot_sector_cleanup(const char *fname);\ndiff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c\nindex 564da45f65..bde62bf1cf 100644\n--- a/tests/bios-tables-test.c\n+++ b/tests/bios-tables-test.c\n@@ -632,7 +632,7 @@ static void test_acpi_one(const char *params, test_data *data)\n\n qtest_start(args);\n\n- boot_sector_test();\n+ boot_sector_test(global_qtest);\n\n test_acpi_rsdp_address(data);\n test_acpi_rsdp_table(data);\ndiff --git a/tests/boot-sector.c b/tests/boot-sector.c\nindex 9ee85370b0..8c8ac7f124 100644\n--- a/tests/boot-sector.c\n+++ b/tests/boot-sector.c\n@@ -5,7 +5,7 @@\n *\n * Authors:\n * Michael S. Tsirkin <mst@redhat.com>\n- * Victor Kaplansky <victork@redhat.com> \n+ * Victor Kaplansky <victork@redhat.com>\n *\n * This work is licensed under the terms of the GNU GPL, version 2 or later.\n * See the COPYING file in the top-level directory.\n@@ -130,7 +130,7 @@ int boot_sector_init(char *fname)\n }\n\n /* Loop until signature in memory is OK. */\n-void boot_sector_test(void)\n+void boot_sector_test(QTestState *qts)\n {\n uint8_t signature_low;\n uint8_t signature_high;\n@@ -146,8 +146,8 @@ void boot_sector_test(void)\n * instruction.\n */\n for (i = 0; i < TEST_CYCLES; ++i) {\n- signature_low = readb(SIGNATURE_ADDR);\n- signature_high = readb(SIGNATURE_ADDR + 1);\n+ signature_low = qtest_readb(qts, SIGNATURE_ADDR);\n+ signature_high = qtest_readb(qts, SIGNATURE_ADDR + 1);\n signature = (signature_high << 8) | signature_low;\n if (signature == SIGNATURE) {\n break;\ndiff --git a/tests/pxe-test.c b/tests/pxe-test.c\nindex 0d70afccd6..e2d3853534 100644\n--- a/tests/pxe-test.c\n+++ b/tests/pxe-test.c\n@@ -31,7 +31,7 @@ static void test_pxe_one(const char *params, bool ipv6)\n ipv6 ? \"on\" : \"off\", params);\n\n qtest_start(args);\n- boot_sector_test();\n+ boot_sector_test(global_qtest);\n qtest_quit(global_qtest);\n g_free(args);\n }\ndiff --git a/tests/vmgenid-test.c b/tests/vmgenid-test.c\nindex 918c82c82a..0ea98b86d7 100644\n--- a/tests/vmgenid-test.c\n+++ b/tests/vmgenid-test.c\n@@ -47,7 +47,7 @@ static uint32_t acpi_find_vgia(void)\n int i;\n\n /* Wait for guest firmware to finish and start the payload. */\n- boot_sector_test();\n+ boot_sector_test(global_qtest);\n\n /* Tables should be initialized now. */\n rsdp_offset = acpi_find_rsdp_address();\n", "prefixes": [ "v7", "23/38" ] }