From nobody Sun Feb 8 10:21:42 2026 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 1507130037954224.4342608027057; Wed, 4 Oct 2017 08:13:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D0F1A780C9; Wed, 4 Oct 2017 15:13:56 +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 AFDE66FEF2; Wed, 4 Oct 2017 15:13:56 +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 4AF0D18355C3; Wed, 4 Oct 2017 15:13:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v94EwwB8006921 for ; Wed, 4 Oct 2017 10:58:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id B3DB25D9CD; Wed, 4 Oct 2017 14:58:58 +0000 (UTC) Received: from mamuti.net (unknown [10.34.246.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C9F65D962 for ; Wed, 4 Oct 2017 14:58:55 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 4D3B5104012; Wed, 4 Oct 2017 16:58:50 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D0F1A780C9 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 4 Oct 2017 16:58:34 +0200 Message-Id: <93f9e53aea858b72cc55672f399d43f6b4e6cd3f.1507128897.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.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/23] cputest: Replace json bool with 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 04 Oct 2017 15:13:57 +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 --- 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