From nobody Sun May 19 02:38:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521826790476927.594867132382; Fri, 23 Mar 2018 10:39:50 -0700 (PDT) Received: from localhost ([::1]:39156 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezQfK-0006lr-VI for importer@patchew.org; Fri, 23 Mar 2018 13:39:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezQdV-0005Yf-Oj for qemu-devel@nongnu.org; Fri, 23 Mar 2018 13:37:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezQdU-0002IC-PK for qemu-devel@nongnu.org; Fri, 23 Mar 2018 13:37:53 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43498 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ezQdU-0002Hw-JA for qemu-devel@nongnu.org; Fri, 23 Mar 2018 13:37:52 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3723E722DE for ; Fri, 23 Mar 2018 17:37:52 +0000 (UTC) Received: from red.redhat.com (ovpn-121-135.rdu2.redhat.com [10.10.121.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4F2884436; Fri, 23 Mar 2018 17:37:47 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Fri, 23 Mar 2018 12:37:38 -0500 Message-Id: <20180323173741.1445744-2-eblake@redhat.com> In-Reply-To: <20180323173741.1445744-1-eblake@redhat.com> References: <20180323173741.1445744-1-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 23 Mar 2018 17:37:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 23 Mar 2018 17:37:52 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'eblake@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 1/4] Revert "tests: qmp-test: add oob test" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Armbruster , Peter Xu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu This reverts commit d003f7a8f9cafe50119975844fa01afc2baf41fb. Enabling OOB caused several iotests failures; due to the imminent 2.12 release, the safest action is to disable OOB, but first we have to revert tests that rely on OOB. Signed-off-by: Peter Xu Message-Id: <20180323140821.28957-3-peterx@redhat.com> Tested-by: Christian Borntraeger [eblake: reorder commits, enhance commit message] Signed-off-by: Eric Blake --- tests/qmp-test.c | 65 ----------------------------------------------------= ---- 1 file changed, 65 deletions(-) diff --git a/tests/qmp-test.c b/tests/qmp-test.c index 07c0b87e27a..2e4b599a4c8 100644 --- a/tests/qmp-test.c +++ b/tests/qmp-test.c @@ -164,70 +164,6 @@ static void test_qmp_protocol(void) qtest_quit(qts); } -/* Tests for Out-Of-Band support. */ -static void test_qmp_oob(void) -{ - QDict *resp; - int acks =3D 0; - const char *cmd_id; - - global_qtest =3D qtest_init_without_qmp_handshake(common_args); - - /* Ignore the greeting message. */ - resp =3D qmp_receive(); - g_assert(qdict_get_qdict(resp, "QMP")); - QDECREF(resp); - - /* Try a fake capability, it should fail. */ - resp =3D qmp("{ 'execute': 'qmp_capabilities', " - " 'arguments': { 'enable': [ 'cap-does-not-exist' ] } }"); - g_assert(qdict_haskey(resp, "error")); - QDECREF(resp); - - /* Now, enable OOB in current QMP session, it should succeed. */ - resp =3D qmp("{ 'execute': 'qmp_capabilities', " - " 'arguments': { 'enable': [ 'oob' ] } }"); - g_assert(qdict_haskey(resp, "return")); - QDECREF(resp); - - /* - * Try any command that does not support OOB but with OOB flag. We - * should get failure. - */ - resp =3D qmp("{ 'execute': 'query-cpus'," - " 'control': { 'run-oob': true } }"); - g_assert(qdict_haskey(resp, "error")); - QDECREF(resp); - - /* - * First send the "x-oob-test" command with lock=3Dtrue and - * oob=3Dfalse, it should hang the dispatcher and main thread; - * later, we send another lock=3Dfalse with oob=3Dtrue to continue - * that thread processing. Finally we should receive replies from - * both commands. - */ - qmp_async("{ 'execute': 'x-oob-test'," - " 'arguments': { 'lock': true }, " - " 'id': 'lock-cmd'}"); - qmp_async("{ 'execute': 'x-oob-test', " - " 'arguments': { 'lock': false }, " - " 'control': { 'run-oob': true }, " - " 'id': 'unlock-cmd' }"); - - /* Ignore all events. Wait for 2 acks */ - while (acks < 2) { - resp =3D qmp_receive(); - cmd_id =3D qdict_get_str(resp, "id"); - if (!g_strcmp0(cmd_id, "lock-cmd") || - !g_strcmp0(cmd_id, "unlock-cmd")) { - acks++; - } - QDECREF(resp); - } - - qtest_end(); -} - static int query_error_class(const char *cmd) { static struct { @@ -412,7 +348,6 @@ int main(int argc, char *argv[]) g_test_init(&argc, &argv, NULL); qtest_add_func("qmp/protocol", test_qmp_protocol); - qtest_add_func("qmp/oob", test_qmp_oob); qmp_schema_init(&schema); add_query_tests(&schema); --=20 2.14.3 From nobody Sun May 19 02:38:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521826790169792.2134401873095; Fri, 23 Mar 2018 10:39:50 -0700 (PDT) Received: from localhost ([::1]:39157 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezQfM-0006nb-BL for importer@patchew.org; Fri, 23 Mar 2018 13:39:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezQdW-0005Yj-3Q for qemu-devel@nongnu.org; Fri, 23 Mar 2018 13:37:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezQdV-0002Im-7n for qemu-devel@nongnu.org; Fri, 23 Mar 2018 13:37:54 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43500 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ezQdV-0002Ib-43 for qemu-devel@nongnu.org; Fri, 23 Mar 2018 13:37:53 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B507B722DE for ; Fri, 23 Mar 2018 17:37:52 +0000 (UTC) Received: from red.redhat.com (ovpn-121-135.rdu2.redhat.com [10.10.121.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B7B984441; Fri, 23 Mar 2018 17:37:52 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Fri, 23 Mar 2018 12:37:39 -0500 Message-Id: <20180323173741.1445744-3-eblake@redhat.com> In-Reply-To: <20180323173741.1445744-1-eblake@redhat.com> References: <20180323173741.1445744-1-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 23 Mar 2018 17:37:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 23 Mar 2018 17:37:52 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'eblake@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 2/4] Revert "tests: qmp-test: verify command batching" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Armbruster , Peter Xu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu This reverts commit 91ad45061af0fe44ac5dadb5bedaf4d7a08077c8. Enabling OOB caused several iotests failures; due to the imminent 2.12 release, the safest action is to disable OOB, but first we have to revert tests that rely on OOB. Signed-off-by: Peter Xu Message-Id: <20180323140821.28957-4-peterx@redhat.com> Tested-by: Christian Borntraeger [eblake: reorder commits, enhance commit message] Signed-off-by: Eric Blake --- tests/qmp-test.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/tests/qmp-test.c b/tests/qmp-test.c index 2e4b599a4c8..d1fa1cb2177 100644 --- a/tests/qmp-test.c +++ b/tests/qmp-test.c @@ -82,7 +82,6 @@ static void test_qmp_protocol(void) QTestState *qts; const QListEntry *entry; QString *qstr; - int i; qts =3D qtest_init_without_qmp_handshake(common_args); @@ -140,27 +139,6 @@ static void test_qmp_protocol(void) g_assert_cmpint(qdict_get_int(resp, "id"), =3D=3D, 2); QDECREF(resp); - /* - * Test command batching. In current test OOB is not enabled, we - * should be able to run as many commands in batch as we like. - * Using 16 (>8, which is OOB queue length) to make sure OOB won't - * break existing clients. Note: this test does not control the - * scheduling of QEMU's QMP command processing threads so it may - * not really trigger batching inside QEMU. This is just a - * best-effort test. - */ - for (i =3D 0; i < 16; i++) { - qtest_async_qmp(qts, "{ 'execute': 'query-version' }"); - } - /* Verify the replies to make sure no command is dropped. */ - for (i =3D 0; i < 16; i++) { - resp =3D qtest_qmp_receive(qts); - /* It should never be dropped. Each of them should be a reply. */ - g_assert(qdict_haskey(resp, "return")); - g_assert(!qdict_haskey(resp, "event")); - QDECREF(resp); - } - qtest_quit(qts); } --=20 2.14.3 From nobody Sun May 19 02:38:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521826928633764.0065725769798; Fri, 23 Mar 2018 10:42:08 -0700 (PDT) Received: from localhost ([::1]:39170 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezQhb-0000T6-OU for importer@patchew.org; Fri, 23 Mar 2018 13:42:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezQdW-0005Yq-NS for qemu-devel@nongnu.org; Fri, 23 Mar 2018 13:37:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezQdV-0002JI-SV for qemu-devel@nongnu.org; Fri, 23 Mar 2018 13:37:54 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35488 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ezQdV-0002Iy-NG for qemu-devel@nongnu.org; Fri, 23 Mar 2018 13:37:53 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 53960813F699 for ; Fri, 23 Mar 2018 17:37:53 +0000 (UTC) Received: from red.redhat.com (ovpn-121-135.rdu2.redhat.com [10.10.121.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC61B8443D; Fri, 23 Mar 2018 17:37:52 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Fri, 23 Mar 2018 12:37:40 -0500 Message-Id: <20180323173741.1445744-4-eblake@redhat.com> In-Reply-To: <20180323173741.1445744-1-eblake@redhat.com> References: <20180323173741.1445744-1-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 23 Mar 2018 17:37:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 23 Mar 2018 17:37:53 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'eblake@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 3/4] Revert "monitor: enable IO thread for (qmp & !mux) typed" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Armbruster , Peter Xu , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu This reverts commit 3fd2457d18edf5736f713dfe1ada9c87a9badab1. Enabling OOB caused several iotests failures; due to the imminent 2.12 release, the safest action is to disable OOB for now. If other patches fix the issues that iotests exposed, it may be turned back on in time for the release, otherwise it will be 2.13 material; either way, the framework changes not reverted now do not hurt if they remain as part of the 2.12 release. Additionally, revert the tests in the patch 02130314d8 ("qmp: introduce QMPCapability", 2018-03-19), as both parts must be reverted at once to keep 'make check' passing. Signed-off-by: Peter Xu Message-Id: <20180323140821.28957-2-peterx@redhat.com> Tested-by: Christian Borntraeger [eblake: reorder/squash commits, enhance commit message] Signed-off-by: Eric Blake --- monitor.c | 5 +---- tests/qmp-test.c | 10 +--------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/monitor.c b/monitor.c index 6ccd2fc0895..77f4c41cfa6 100644 --- a/monitor.c +++ b/monitor.c @@ -36,7 +36,6 @@ #include "net/slirp.h" #include "chardev/char-fe.h" #include "chardev/char-io.h" -#include "chardev/char-mux.h" #include "ui/qemu-spice.h" #include "sysemu/numa.h" #include "monitor/monitor.h" @@ -4537,10 +4536,8 @@ static void monitor_qmp_setup_handlers_bh(void *opaq= ue) void monitor_init(Chardev *chr, int flags) { Monitor *mon =3D g_malloc(sizeof(*mon)); - /* Enable IOThread for QMPs that are not using MUX chardev backends. */ - bool use_io_thr =3D (!CHARDEV_IS_MUX(chr)) && (flags & MONITOR_USE_CON= TROL); - monitor_data_init(mon, false, use_io_thr); + monitor_data_init(mon, false, false); qemu_chr_fe_init(&mon->chr, chr, &error_abort); mon->flags =3D flags; diff --git a/tests/qmp-test.c b/tests/qmp-test.c index d1fa1cb2177..558e83540cc 100644 --- a/tests/qmp-test.c +++ b/tests/qmp-test.c @@ -80,8 +80,6 @@ static void test_qmp_protocol(void) QDict *resp, *q, *ret; QList *capabilities; QTestState *qts; - const QListEntry *entry; - QString *qstr; qts =3D qtest_init_without_qmp_handshake(common_args); @@ -91,13 +89,7 @@ static void test_qmp_protocol(void) g_assert(q); test_version(qdict_get(q, "version")); capabilities =3D qdict_get_qlist(q, "capabilities"); - g_assert(capabilities); - entry =3D qlist_first(capabilities); - g_assert(entry); - qstr =3D qobject_to(QString, entry->value); - g_assert(qstr); - g_assert_cmpstr(qstring_get_str(qstr), =3D=3D, "oob"); - QDECREF(resp); + g_assert(capabilities && qlist_empty(capabilities)); /* Test valid command before handshake */ resp =3D qtest_qmp(qts, "{ 'execute': 'query-version' }"); --=20 2.14.3 From nobody Sun May 19 02:38:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521826928749603.1401398460547; Fri, 23 Mar 2018 10:42:08 -0700 (PDT) Received: from localhost ([::1]:39171 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezQhb-0000VD-TO for importer@patchew.org; Fri, 23 Mar 2018 13:42:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezQdX-0005ZC-Kv for qemu-devel@nongnu.org; Fri, 23 Mar 2018 13:37:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezQdW-0002Jd-6i for qemu-devel@nongnu.org; Fri, 23 Mar 2018 13:37:55 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46872 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ezQdW-0002J9-2Y for qemu-devel@nongnu.org; Fri, 23 Mar 2018 13:37:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AF120406E8A4 for ; Fri, 23 Mar 2018 17:37:53 +0000 (UTC) Received: from red.redhat.com (ovpn-121-135.rdu2.redhat.com [10.10.121.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77AA58443F for ; Fri, 23 Mar 2018 17:37:53 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Fri, 23 Mar 2018 12:37:41 -0500 Message-Id: <20180323173741.1445744-5-eblake@redhat.com> In-Reply-To: <20180323173741.1445744-1-eblake@redhat.com> References: <20180323173741.1445744-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 23 Mar 2018 17:37:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 23 Mar 2018 17:37:53 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'eblake@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 4/4] qapi: Force UTF8 encoding when parsing qapi files X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Commit d4e5ec877 already fixed things to work around Python 3's lame bug of having LC_ALL=3DC not be 8-bit clean, when parsing the main QMP qapi files; but failed to do likewise in the tests directory. As a result, running 'LC_ALL=3DC make check' fails on escape-too-big and unicode-str when using python 3 with a nasty stack trace instead of the intended graceful error message that QAPI doesn't yet support 8-bit data (the two tests contain Unicode =C3=A9, when parsed in UTF-8; they represent something different when parsed in a proper single-byte C locale, but that doesn't matter to the error message printed out, provided that brain-dead Python hasn't first choked on the input instead of being 8-bit clean). Ideally, we'd teach the qapi generator scripts to automatically slurp things in using UTF-8 regardless of locale, and to honor content that is not limited to 7 bit data rather than gracefully erroring out; but until then, since our graceful error depends on python parsing 8-bit data (even if nothing we generate uses 8-bit data), our quick fix is to use the right locale when running these tests. Reported-by: Peter Maydell Signed-off-by: Eric Blake Message-Id: <20180319205040.1113423-1-eblake@redhat.com> Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/Makefile.include | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 0b277036df1..eb218a9539d 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -669,13 +669,13 @@ tests/test-qapi-events.c tests/test-qapi-events.h \ tests/test-qapi-introspect.c tests/test-qapi-introspect.h: \ tests/test-qapi-gen-timestamp ; tests/test-qapi-gen-timestamp: $(SRC_PATH)/tests/qapi-schema/qapi-schema-t= est.json $(qapi-py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \ + $(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi-gen.py \ -o tests -p "test-" $<, \ "GEN","$(@:%-timestamp=3D%)") @>$@ tests/qapi-schema/doc-good.test.texi: $(SRC_PATH)/tests/qapi-schema/doc-go= od.json $(qapi-py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \ + $(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi-gen.py \ -o tests/qapi-schema -p "doc-good-" $<, \ "GEN","$@") @mv tests/qapi-schema/doc-good-qapi-doc.texi $@ @@ -927,7 +927,7 @@ check-tests/qemu-iotests-quick.sh: tests/qemu-iotests-q= uick.sh qemu-img$(EXESUF) .PHONY: $(patsubst %, check-%, $(check-qapi-schema-y)) $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/= %.json $(call quiet-command, PYTHONPATH=3D$(SRC_PATH)/scripts \ - $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py \ + $(PYTHON_UTF8) $(SRC_PATH)/tests/qapi-schema/test-qapi.py \ $^ >$*.test.out 2>$*.test.err; \ echo $$? >$*.test.exit, \ "TEST","$*.out") --=20 2.14.3