From nobody Sun Feb 8 12:51:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) client-ip=63.128.21.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 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=1585316886; cv=none; d=zohomail.com; s=zohoarc; b=SnI8u5jMkC4mooMosm+DX3jEXhzlFLK7Bx2yLBD/xkzgSv8JIDhyiO4aQ5AKJEdWKQ8aX5ua6CQWLKeb8mJ70RqBlHHEv1gue63EiUiGUukK1T/odHEFmAzdiqTu5kkL18/AJSlgYMUm8i+0JiULS4E/Du0fGvVJdz7gn9wWmwY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585316886; h=Content-Type:Content-Transfer-Encoding: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; bh=pVTvrnGGrKJa1R1EnT9UJrTHDeZUzyY8LQEeq+u3uNw=; b=Pw2vFyGcWmRdojHeuKcaIiSMwupolqZc34ABquLmcOMeE/U9IahV9MkIRMtN14XY0APSIjd4vZBEljJlg/P+VywCfFAcYz8Uy0aPEylGv/+gpryJj1IXbpuhEvaqwhzEMK1X9p+dccNLVfTG0v9JDoaIhq2+scEg22InUH4ESKI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.zohomail.com with SMTPS id 1585316886604367.6671777741617; Fri, 27 Mar 2020 06:48:06 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-87-8jRJcvK7PgqbPaJvC4eyfg-1; Fri, 27 Mar 2020 09:46:11 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2B13C1005509; Fri, 27 Mar 2020 13:46:04 +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 E7F5F5DDA5; Fri, 27 Mar 2020 13:46:03 +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 666A6944D1; Fri, 27 Mar 2020 13:46:03 +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 02RDiQXo006473 for ; Fri, 27 Mar 2020 09:44:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5CE1160BF4; Fri, 27 Mar 2020 13:44:26 +0000 (UTC) Received: from rein.int.mamuti.net (unknown [10.40.192.72]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E8C860C18 for ; Fri, 27 Mar 2020 13:44:24 +0000 (UTC) Received: by rein.int.mamuti.net (Postfix, from userid 500) id 2242618F8BB; Fri, 27 Mar 2020 14:44:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585316885; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=pVTvrnGGrKJa1R1EnT9UJrTHDeZUzyY8LQEeq+u3uNw=; b=c5yJUNSdafhcp+D484NxylPPfknAY7JSaE40yURfoXnOUGQaH9/sqvUeIQ/FPZWFE9IXA8 J+CJ3+sAkjn0sPLUqlkHuDVTeLjsA8O1O1ylCcdbKU2C3525hJmyvWuy+mrOAQRHpDtxNX WDMfJB3wTqSMC3PEZJH7XXTkfKckQl8= X-MC-Unique: 8jRJcvK7PgqbPaJvC4eyfg-1 From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 30/39] cpu_x86: Move and rename x86ModelHasSignature Date: Fri, 27 Mar 2020 14:43:59 +0100 Message-Id: <4039d8eb1643ae1cd2094d689dc27a852ef655ce.1585316580.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Later in this series the function will work on a newly introduced virCPUx86Signatures structure. Let's move it to the place were all related functions will be added and rename the function as virCPUx86SignaturesMatch for easier review of the virCPUx86Signatures patch. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_x86.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 4b6eaf8060..ff44cae77e 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1110,6 +1110,21 @@ virCPUx86SignaturesCopy(virCPUx86ModelPtr dst, } =20 =20 +static bool +virCPUx86SignaturesMatch(virCPUx86ModelPtr model, + uint32_t signature) +{ + size_t i; + + for (i =3D 0; i < model->nsignatures; i++) { + if (model->signatures[i] =3D=3D signature) + return true; + } + + return false; +} + + static void x86ModelFree(virCPUx86ModelPtr model) { @@ -1877,21 +1892,6 @@ virCPUx86Compare(virCPUDefPtr host, } =20 =20 -static bool -x86ModelHasSignature(virCPUx86ModelPtr model, - uint32_t signature) -{ - size_t i; - - for (i =3D 0; i < model->nsignatures; i++) { - if (model->signatures[i] =3D=3D signature) - return true; - } - - return false; -} - - static char * x86FormatSignatures(virCPUx86ModelPtr model) { @@ -1963,8 +1963,8 @@ x86DecodeUseCandidate(virCPUx86ModelPtr current, * consider candidates with matching family/model. */ if (signature && - x86ModelHasSignature(current, signature) && - !x86ModelHasSignature(candidate, signature)) { + virCPUx86SignaturesMatch(current, signature) && + !virCPUx86SignaturesMatch(candidate, signature)) { VIR_DEBUG("%s differs in signature from matching %s", cpuCandidate->model, cpuCurrent->model); return 0; @@ -1980,8 +1980,8 @@ x86DecodeUseCandidate(virCPUx86ModelPtr current, * result in longer list of features. */ if (signature && - x86ModelHasSignature(candidate, signature) && - !x86ModelHasSignature(current, signature)) { + virCPUx86SignaturesMatch(candidate, signature) && + !virCPUx86SignaturesMatch(current, signature)) { VIR_DEBUG("%s provides matching signature", cpuCandidate->model); return 1; } --=20 2.26.0