From nobody Mon Dec 15 01:53:42 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 1507920421879180.20432280434272; Fri, 13 Oct 2017 11:47:01 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EA5E083F43; Fri, 13 Oct 2017 18:47:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C9B0D18A64; Fri, 13 Oct 2017 18:47:00 +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 95EF63FAED; Fri, 13 Oct 2017 18:47:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF7mt014160 for ; Fri, 13 Oct 2017 14:15:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9793F4250; Fri, 13 Oct 2017 18:15:07 +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 249036024D for ; Fri, 13 Oct 2017 18:15:02 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 1E93C1006E6; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EA5E083F43 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: Fri, 13 Oct 2017 20:14:38 +0200 Message-Id: <4858bb9037d9341855c50d500e29384c5f03f421.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.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 06/22] cpu: Drop unused parameter from cpuDecode 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 13 Oct 2017 18:47:01 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The "preferred" parameter is not used by any caller of cpuDecode anymore. It's only used internally in cpu_x86 to implement cpuBaseline. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - no change src/cpu/cpu.c | 15 ++++----------- src/cpu/cpu.h | 6 ++---- src/cpu/cpu_ppc64.c | 5 ++--- src/cpu/cpu_x86.c | 7 +++---- src/libxl/libxl_capabilities.c | 2 +- src/qemu/qemu_capabilities.c | 4 +--- tests/cputest.c | 2 +- 7 files changed, 14 insertions(+), 27 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 42b836354d..f589666562 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -192,34 +192,27 @@ virCPUCompare(virArch arch, * @cpu: CPU definition stub to be filled in * @data: internal CPU data to be decoded into @cpu definition * @models: list of CPU models that can be considered when decoding @data - * @preferred: CPU models that should be used if possible * * Decodes internal CPU data into a CPU definition consisting of a CPU mod= el * and a list of CPU features. The @cpu model stub is supposed to have arc= h, * type, match and fallback members set, this function will add the rest. = If * @models list is NULL, all models supported by libvirt will be considered * when decoding the data. In general, this function will select the model - * closest to the CPU specified by @data unless @preferred is non-NULL, in - * which case the @preferred model will be used as long as it is compatible - * with @data. + * closest to the CPU specified by @data. * * For VIR_ARCH_I686 and VIR_ARCH_X86_64 architectures this means the comp= uted * CPU definition will have the shortest possible list of additional featu= res. - * When @preferred is non-NULL, the @preferred model will be used even if - * other models would result in a shorter list of additional features. * * Returns 0 on success, -1 on error. */ int cpuDecode(virCPUDefPtr cpu, const virCPUData *data, - virDomainCapsCPUModelsPtr models, - const char *preferred) + virDomainCapsCPUModelsPtr models) { struct cpuArchDriver *driver; =20 - VIR_DEBUG("cpu=3D%p, data=3D%p, models=3D%p, preferred=3D%s", - cpu, data, models, NULLSTR(preferred)); + VIR_DEBUG("cpu=3D%p, data=3D%p, models=3D%p", cpu, data, models); if (models) { size_t i; for (i =3D 0; i < models->nmodels; i++) @@ -243,7 +236,7 @@ cpuDecode(virCPUDefPtr cpu, return -1; } =20 - return driver->decode(cpu, data, models, preferred); + return driver->decode(cpu, data, models); } =20 =20 diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index d325fe3d04..83d5bcb63f 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -53,8 +53,7 @@ typedef virCPUCompareResult typedef int (*cpuArchDecode) (virCPUDefPtr cpu, const virCPUData *data, - virDomainCapsCPUModelsPtr models, - const char *preferred); + virDomainCapsCPUModelsPtr models); =20 typedef int (*cpuArchEncode) (virArch arch, @@ -162,8 +161,7 @@ virCPUCompare(virArch arch, int cpuDecode (virCPUDefPtr cpu, const virCPUData *data, - virDomainCapsCPUModelsPtr models, - const char *preferred) + virDomainCapsCPUModelsPtr models) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); =20 int diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 902c465cf4..76582d4083 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -669,8 +669,7 @@ virCPUppc64Compare(virCPUDefPtr host, static int ppc64DriverDecode(virCPUDefPtr cpu, const virCPUData *data, - virDomainCapsCPUModelsPtr models, - const char *preferred ATTRIBUTE_UNUSED) + virDomainCapsCPUModelsPtr models) { int ret =3D -1; struct ppc64_map *map; @@ -741,7 +740,7 @@ virCPUppc64GetHost(virCPUDefPtr cpu, #endif data->pvr[0].mask =3D 0xfffffffful; =20 - ret =3D ppc64DriverDecode(cpu, cpuData, models, NULL); + ret =3D ppc64DriverDecode(cpu, cpuData, models); =20 cleanup: virCPUppc64DataFree(cpuData); diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 3f9e83ca72..84ec878d1b 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1945,10 +1945,9 @@ x86Decode(virCPUDefPtr cpu, static int x86DecodeCPUData(virCPUDefPtr cpu, const virCPUData *data, - virDomainCapsCPUModelsPtr models, - const char *preferred) + virDomainCapsCPUModelsPtr models) { - return x86Decode(cpu, &data->data.x86, models, preferred, false); + return x86Decode(cpu, &data->data.x86, models, NULL, false); } =20 =20 @@ -2412,7 +2411,7 @@ virCPUx86GetHost(virCPUDefPtr cpu, cpuidSet(CPUX86_EXTENDED, cpuData) < 0) goto cleanup; =20 - ret =3D x86DecodeCPUData(cpu, cpuData, models, NULL); + ret =3D x86DecodeCPUData(cpu, cpuData, models); =20 cleanup: virCPUx86DataFree(cpuData); diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index 4def561143..18596c7c72 100644 --- a/src/libxl/libxl_capabilities.c +++ b/src/libxl/libxl_capabilities.c @@ -192,7 +192,7 @@ libxlCapsInitCPU(virCapsPtr caps, libxl_physinfo *phy_i= nfo, ret =3D 0; =20 if (!(data =3D libxlCapsNodeData(cpu, phy_info->hw_cap, version)) || - cpuDecode(cpu, data, NULL, NULL) < 0) { + cpuDecode(cpu, data, NULL) < 0) { VIR_WARN("Failed to initialize host cpu features"); goto error; } diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 4bdc3f26c9..8803980495 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3397,9 +3397,7 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, if (virCPUx86DataSetSignature(data, sigFamily, sigModel) < 0) goto cleanup; =20 - if (cpuDecode(cpu, data, - virQEMUCapsGetCPUDefinitions(qemuCaps, type), - NULL) < 0) + if (cpuDecode(cpu, data, virQEMUCapsGetCPUDefinitions(qemuCaps, type))= < 0) goto cleanup; =20 ret =3D 0; diff --git a/tests/cputest.c b/tests/cputest.c index 552c07e2c5..cc95f1d551 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -491,7 +491,7 @@ cpuTestCPUID(bool guest, const void *arg) cpu->type =3D VIR_CPU_TYPE_HOST; } =20 - if (cpuDecode(cpu, hostData, NULL, NULL) < 0) + if (cpuDecode(cpu, hostData, NULL) < 0) goto cleanup; =20 if (virAsprintf(&result, "cpuid-%s-%s", --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list