From nobody Thu May 15 12:47:57 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507918969985948.3197207128757; Fri, 13 Oct 2017 11:22:49 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 138C413A49; Fri, 13 Oct 2017 18:22:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EAFBC18238; Fri, 13 Oct 2017 18:22:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B56C918355DE; Fri, 13 Oct 2017 18:22:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF3jA014072 for ; Fri, 13 Oct 2017 14:15:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9A498614F6; Fri, 13 Oct 2017 18:15:03 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E28D6BF66 for ; Fri, 13 Oct 2017 18:15:02 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 2BD861006F2; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 138C413A49 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:42 +0200 Message-Id: <4de28e5ed7c470486a4c15a3031b9748a952700b.1507918307.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 10/22] cputest: Replace bool with cpuTestCPUIDJson enum X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 13 Oct 2017 18:22:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We will soon need to handle more than two values. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - changed commit summary tests/cputest.c | 79 ++++++++++++++++++++++++++++++-----------------------= ---- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/tests/cputest.c b/tests/cputest.c index cc95f1d551..57cff04f38 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -670,6 +670,11 @@ cpuTestUpdateLive(const void *arg) } =20 =20 +typedef enum { + JSON_NONE, + JSON_HOST, +} cpuTestCPUIDJson; + #if WITH_QEMU && WITH_YAJL static int cpuTestJSONCPUID(const void *arg) @@ -863,7 +868,7 @@ mymain(void) #if WITH_QEMU && WITH_YAJL # define DO_TEST_CPUID_JSON(arch, host, json) \ do { \ - if (json) { \ + if (json !=3D JSON_NONE) { \ DO_TEST(arch, cpuTestJSONCPUID, host, host, \ NULL, NULL, 0, 0); \ } \ @@ -879,7 +884,7 @@ mymain(void) DO_TEST(arch, cpuTestGuestCPUID, host, host, \ NULL, NULL, 0, 0); \ DO_TEST_CPUID_JSON(arch, host, json); \ - if (json) { \ + if (json !=3D JSON_NONE) { \ DO_TEST(arch, cpuTestUpdateLive, host, host, \ NULL, NULL, 0, 0); \ } \ @@ -1010,41 +1015,41 @@ mymain(void) DO_TEST_GUESTCPU(VIR_ARCH_PPC64, "host", "guest-legacy-incompatible", = ppc_models, -1); DO_TEST_GUESTCPU(VIR_ARCH_PPC64, "host", "guest-legacy-invalid", ppc_m= odels, -1); =20 - DO_TEST_CPUID(VIR_ARCH_X86_64, "A10-5800K", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Atom-D510", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Atom-N450", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-2500", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-2540M", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-4670T", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-6600", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-2600", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3520M", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3740QM", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3770", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-4600U", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-4510U", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-5600U", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-5600U-arat", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core2-E6850", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core2-Q9500", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "EPYC-7601-32-Core", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "FX-8150", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Opteron-1352", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Opteron-2350", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Opteron-6234", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Opteron-6282", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Pentium-P6100", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Phenom-B95", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Ryzen-7-1800X-Eight-Core", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-5110", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E3-1245", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E5-2630", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E5-2650", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-4820", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-8890", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-Gold-6148", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-W3520", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-X5460", false); + DO_TEST_CPUID(VIR_ARCH_X86_64, "A10-5800K", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Atom-D510", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Atom-N450", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-2500", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-2540M", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-4670T", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-6600", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-2600", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3520M", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3740QM", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3770", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-4600U", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-4510U", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-5600U", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-5600U-arat", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core2-E6850", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core2-Q9500", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "EPYC-7601-32-Core", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "FX-8150", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Opteron-1352", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Opteron-2350", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Opteron-6234", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Opteron-6282", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Pentium-P6100", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Phenom-B95", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Ryzen-7-1800X-Eight-Core", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-5110", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E3-1245", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E5-2630", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E5-2650", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-4820", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-8890", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-Gold-6148", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-W3520", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-X5460", JSON_NONE); =20 cleanup: #if WITH_QEMU && WITH_YAJL --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list