From nobody Mon Feb 9 09:08:39 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555303924; cv=none; d=zoho.com; s=zohoarc; b=ntH6LFd5ZEdK+IlGCoHRvgl/pm7J24vhAcejB4XvuS4Q4D7L7p+yRibFdcqPmAAYfcErwPRYRoPV2MP7ueafbW5s94cZoPSre+GDfn1r8kmKV6G/SQ80gz141v0z8A5LZSPU8pMaK/6vlSsRgovkWtid8IVARZr8uVv9/ykd39I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555303924; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Su7oRsF/ZZsPP+nexeizVxxpt+4pMa2eqcQxVZG3Mfg=; b=OsuUWYDeFGa8xj2q7kaV9hjCz9JW1KdOA6IipToSJpLjS9ppGOPN3hYlxyTHzJs1WaZHInjLodcEBIjD5doR6Vf6A1RJrOp0a9UMcWdP5X8GszANWytxSWy2r4FU0jzEntCJZXyaE/oFcxkm39i7Tng+xg8RYMOQfipi3IVmvCk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1555303924973305.5399336078225; Sun, 14 Apr 2019 21:52:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E65713082E4B; Mon, 15 Apr 2019 04:52:01 +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 BF2D35D717; Mon, 15 Apr 2019 04:52:01 +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 79A3C41F3D; Mon, 15 Apr 2019 04:52:01 +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 x3F4okqc005012 for ; Mon, 15 Apr 2019 00:50:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2F340608C1; Mon, 15 Apr 2019 04:50:46 +0000 (UTC) Received: from localhost.localdomain (unknown [10.35.206.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2313D608BF; Mon, 15 Apr 2019 04:50:42 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 15 Apr 2019 06:50:19 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: bwalk@linux.ibm.com, jdenemar@redhat.com Subject: [libvirt] [PATCH 3/3] cpu_x86: Fix placement of *CheckFeature functions 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: , 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 15 Apr 2019 04:52:02 +0000 (UTC) Content-Type: text/plain; charset="utf-8" In e17d10386 these functions were mistakenly moved into an #ifdef block, but remained used outside of it leaving the build broken for platforms where #ifdef evaluated to false. Signed-off-by: Michal Privoznik --- src/cpu/cpu_x86.c | 68 ++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 1fe6770d57..f05bfa24e0 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -2707,39 +2707,6 @@ cpuidSet(uint32_t base, virCPUDataPtr data) } =20 =20 -static int -virCPUx86CheckFeature(const virCPUDef *cpu, - const char *name) -{ - int ret =3D -1; - virCPUx86MapPtr map; - virCPUx86ModelPtr model =3D NULL; - - if (!(map =3D virCPUx86GetMap())) - return -1; - - if (!(model =3D x86ModelFromCPU(cpu, map, -1))) - goto cleanup; - - ret =3D x86FeatureInData(name, &model->data, map); - - cleanup: - x86ModelFree(model); - return ret; -} - - -static int -virCPUx86DataCheckFeature(const virCPUData *data, - const char *name) -{ - virCPUx86MapPtr map; - - if (!(map =3D virCPUx86GetMap())) - return -1; - - return x86FeatureInData(name, &data->data.x86, map); -} =20 =20 static int @@ -2769,6 +2736,41 @@ virCPUx86GetHost(virCPUDefPtr cpu, #endif =20 =20 +static int +virCPUx86CheckFeature(const virCPUDef *cpu, + const char *name) +{ + int ret =3D -1; + virCPUx86MapPtr map; + virCPUx86ModelPtr model =3D NULL; + + if (!(map =3D virCPUx86GetMap())) + return -1; + + if (!(model =3D x86ModelFromCPU(cpu, map, -1))) + goto cleanup; + + ret =3D x86FeatureInData(name, &model->data, map); + + cleanup: + x86ModelFree(model); + return ret; +} + + +static int +virCPUx86DataCheckFeature(const virCPUData *data, + const char *name) +{ + virCPUx86MapPtr map; + + if (!(map =3D virCPUx86GetMap())) + return -1; + + return x86FeatureInData(name, &data->data.x86, map); +} + + static virCPUDefPtr virCPUx86Baseline(virCPUDefPtr *cpus, unsigned int ncpus, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list