From nobody Wed Nov 5 05:21:15 2025 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1532704763569748.0794191142668; Fri, 27 Jul 2018 08:19:23 -0700 (PDT) Received: from localhost ([::1]:41779 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fj4WY-0001sP-9L for importer@patchew.org; Fri, 27 Jul 2018 11:19:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fj4RW-00066e-B5 for qemu-devel@nongnu.org; Fri, 27 Jul 2018 11:14:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fj4RU-0000DF-6K for qemu-devel@nongnu.org; Fri, 27 Jul 2018 11:14:10 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55270 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 1fj4RU-0000AP-05 for qemu-devel@nongnu.org; Fri, 27 Jul 2018 11:14:08 -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 94D667788A; Fri, 27 Jul 2018 15:14:04 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-135.ams2.redhat.com [10.36.116.135]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6CDAE1C5B9; Fri, 27 Jul 2018 15:14:04 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C562511384C3; Fri, 27 Jul 2018 17:13:59 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Fri, 27 Jul 2018 17:13:48 +0200 Message-Id: <20180727151359.29061-13-armbru@redhat.com> In-Reply-To: <20180727151359.29061-1-armbru@redhat.com> References: <20180727151359.29061-1-armbru@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.1]); Fri, 27 Jul 2018 15:14:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 27 Jul 2018 15:14:04 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@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] [PATCH v2 12/23] cpu-plug-test: Don't pass integers as strings to device_add 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: thuth@redhat.com, f4bug@amsat.org 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" test_plug_with_device_add_x86() plugs Haswell-i386-cpu and Haswell-x86_64-cpu with device_add. It passes socket-id, core-id, thread-id as JSON strings. The properties are actually integers. test_plug_with_device_add_coreid() plugs power8_v2.0-spapr-cpu-core and qemu-s390x-cpu with device_add. It passes core-id as JSON string. The properties are actually integers. Passing JSON string values to integer properties works only due to device_add implementation accidents. Fix the test to pass JSON numbers. While there, use %u rather than %i with unsigned int. Cc: Thomas Huth Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Reviewed-by: Eric Blake --- tests/cpu-plug-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/cpu-plug-test.c b/tests/cpu-plug-test.c index 5f39ba0df3..ab3bf6df90 100644 --- a/tests/cpu-plug-test.c +++ b/tests/cpu-plug-test.c @@ -88,8 +88,8 @@ static void test_plug_with_device_add_x86(gconstpointer d= ata) for (c =3D 0; c < td->cores; c++) { for (t =3D 0; t < td->threads; t++) { char *id =3D g_strdup_printf("id-%i-%i-%i", s, c, t); - qtest_qmp_device_add(td->device_model, id, "'socket-id':'%= i', " - "'core-id':'%i', 'thread-id':'%i'", + qtest_qmp_device_add(td->device_model, id, "'socket-id':%u= , " + "'core-id':%u, 'thread-id':%u", s, c, t); g_free(id); } @@ -114,7 +114,7 @@ static void test_plug_with_device_add_coreid(gconstpoin= ter data) =20 for (c =3D td->cores; c < td->maxcpus / td->sockets / td->threads; c++= ) { char *id =3D g_strdup_printf("id-%i", c); - qtest_qmp_device_add(td->device_model, id, "'core-id':'%i'", c); + qtest_qmp_device_add(td->device_model, id, "'core-id':%u", c); g_free(id); } =20 --=20 2.17.1