From nobody Wed Feb 11 10:03:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; envelope-from=libvir-list-bounces@redhat.com; helo=mx5-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mx.zohomail.com with SMTPS id 1489510891515639.1153031596541; Tue, 14 Mar 2017 10:01:31 -0700 (PDT) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2EGwPjE011298; Tue, 14 Mar 2017 12:58:25 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2EGvtt5002598 for ; Tue, 14 Mar 2017 12:57:55 -0400 Received: from virval.usersys.redhat.com (dhcp129-92.brq.redhat.com [10.34.129.92]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2EGvriY011778 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 14 Mar 2017 12:57:54 -0400 Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 7BE22100234; Tue, 14 Mar 2017 17:57:53 +0100 (CET) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 14 Mar 2017 17:57:40 +0100 Message-Id: <563f8d62dcf72003fc80db9cd88130d186ce7aac.1489510598.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/12] tests: Switch to sparse initialization of virCPUDef 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark --- tests/domaincapstest.c | 38 ++++++++++++++++++++++++-------------- tests/testutilsqemu.c | 48 ++++++++++++++++++++--------------------------= -- 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index a4bc8d6d0..462f86801 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -66,10 +66,10 @@ fillAllCaps(virDomainCapsPtr domCaps) virDomainCapsDeviceVideoPtr video =3D &domCaps->video; virDomainCapsDeviceHostdevPtr hostdev =3D &domCaps->hostdev; virCPUDef host =3D { - VIR_CPU_TYPE_HOST, 0, 0, - VIR_ARCH_X86_64, (char *) "host", - NULL, 0, (char *) "CPU Vendorrr", - 0, 0, 0, 0, 0, NULL, + .type =3D VIR_CPU_TYPE_HOST, + .arch =3D VIR_ARCH_X86_64, + .model =3D (char *) "host", + .vendor =3D (char *) "CPU Vendorrr", }; =20 domCaps->maxvcpus =3D 255; @@ -119,25 +119,35 @@ fillAllCaps(virDomainCapsPtr domCaps) # include "testutilsqemu.h" =20 static virCPUDef aarch64Cpu =3D { - 0, 0, 0, 0, NULL, NULL, 0, NULL, 1, 1, 1, 0, 0, NULL, + .sockets =3D 1, + .cores =3D 1, + .threads =3D 1, }; =20 static virCPUDef ppc64leCpu =3D { - VIR_CPU_TYPE_HOST, 0, 0, - VIR_ARCH_PPC64LE, (char *) "POWER8", - NULL, 0, NULL, 1, 1, 1, 0, 0, NULL, + .type =3D VIR_CPU_TYPE_HOST, + .arch =3D VIR_ARCH_PPC64LE, + .model =3D (char *) "POWER8", + .sockets =3D 1, + .cores =3D 1, + .threads =3D 1, }; =20 static virCPUDef x86Cpu =3D { - VIR_CPU_TYPE_HOST, 0, 0, - VIR_ARCH_X86_64, (char *) "Broadwell", - NULL, 0, NULL, 1, 1, 1, 0, 0, NULL, + .type =3D VIR_CPU_TYPE_HOST, + .arch =3D VIR_ARCH_X86_64, + .model =3D (char *) "Broadwell", + .sockets =3D 1, + .cores =3D 1, + .threads =3D 1, }; =20 static virCPUDef s390Cpu =3D { - VIR_CPU_TYPE_HOST, 0, 0, - VIR_ARCH_S390X, NULL, - NULL, 0, NULL, 1, 1, 1, 0, 0, NULL, + .type =3D VIR_CPU_TYPE_HOST, + .arch =3D VIR_ARCH_S390X, + .sockets =3D 1, + .cores =3D 1, + .threads =3D 1, }; =20 static int diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 0726cd317..026b73e9b 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -34,20 +34,16 @@ static virCPUFeatureDef cpuDefaultFeatures[] =3D { { (char *) "lahf_lm", -1 }, }; static virCPUDef cpuDefaultData =3D { - VIR_CPU_TYPE_HOST, /* type */ - 0, /* mode */ - 0, /* match */ - VIR_ARCH_X86_64, /* arch */ - (char *) "core2duo", /* model */ - NULL, /* vendor_id */ - 0, /* fallback */ - (char *) "Intel", /* vendor */ - 1, /* sockets */ - 2, /* cores */ - 1, /* threads */ - ARRAY_CARDINALITY(cpuDefaultFeatures), /* nfeatures */ - ARRAY_CARDINALITY(cpuDefaultFeatures), /* nfeatures_max */ - cpuDefaultFeatures, /* features */ + .type =3D VIR_CPU_TYPE_HOST, + .arch =3D VIR_ARCH_X86_64, + .model =3D (char *) "core2duo", + .vendor =3D (char *) "Intel", + .sockets =3D 1, + .cores =3D 2, + .threads =3D 1, + .nfeatures =3D ARRAY_CARDINALITY(cpuDefaultFeatures), + .nfeatures_max =3D ARRAY_CARDINALITY(cpuDefaultFeatures), + .features =3D cpuDefaultFeatures, }; =20 static virCPUFeatureDef cpuHaswellFeatures[] =3D { @@ -77,20 +73,16 @@ static virCPUFeatureDef cpuHaswellFeatures[] =3D { { (char *) "lahf_lm", -1 }, }; static virCPUDef cpuHaswellData =3D { - VIR_CPU_TYPE_HOST, /* type */ - 0, /* mode */ - 0, /* match */ - VIR_ARCH_X86_64, /* arch */ - (char *) "Haswell", /* model */ - NULL, /* vendor_id */ - 0, /* fallback */ - (char *) "Intel", /* vendor */ - 1, /* sockets */ - 2, /* cores */ - 2, /* threads */ - ARRAY_CARDINALITY(cpuHaswellFeatures), /* nfeatures */ - ARRAY_CARDINALITY(cpuHaswellFeatures), /* nfeatures_max */ - cpuHaswellFeatures, /* features */ + .type =3D VIR_CPU_TYPE_HOST, + .arch =3D VIR_ARCH_X86_64, + .model =3D (char *) "Haswell", + .vendor =3D (char *) "Intel", + .sockets =3D 1, + .cores =3D 2, + .threads =3D 2, + .nfeatures =3D ARRAY_CARDINALITY(cpuHaswellFeatures), + .nfeatures_max =3D ARRAY_CARDINALITY(cpuHaswellFeatures), + .features =3D cpuHaswellFeatures, }; =20 static virCPUDef cpuPower8Data =3D { --=20 2.12.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list