From nobody Sun Feb 8 17:37:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1637244141147475.342316568339; Thu, 18 Nov 2021 06:02:21 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-479-mj79Xc34NAmy77hOb9J4ew-1; Thu, 18 Nov 2021 09:02:16 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1ECFE804142; Thu, 18 Nov 2021 14:02:10 +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 E0E495F4F4; Thu, 18 Nov 2021 14:02:09 +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 2A8311800FE4; Thu, 18 Nov 2021 14:02:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AIE05k8010901 for ; Thu, 18 Nov 2021 09:00:05 -0500 Received: by smtp.corp.redhat.com (Postfix) id EE7AD4047279; Thu, 18 Nov 2021 14:00:04 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EAD41404727A for ; Thu, 18 Nov 2021 14:00:04 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D2AC0185A7BA for ; Thu, 18 Nov 2021 14:00:04 +0000 (UTC) Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-542-y-EStvYvOliXGgYranrJgw-1; Thu, 18 Nov 2021 09:00:02 -0500 Received: by mail-qk1-f182.google.com with SMTP id t83so6345355qke.8 for ; Thu, 18 Nov 2021 06:00:02 -0800 (PST) Received: from rekt.ibmuc.com ([152.250.208.89]) by smtp.gmail.com with ESMTPSA id e7sm1542168qtx.72.2021.11.18.06.00.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Nov 2021 06:00:02 -0800 (PST) X-MC-Unique: mj79Xc34NAmy77hOb9J4ew-1 X-MC-Unique: y-EStvYvOliXGgYranrJgw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EMbpwKXPT8lppPkIBDMnSQQ/2gjYRbVCueAiT1H2JSY=; b=3oFX0rUPkECahqzMYU281S36eRkEihVoS8Ih6mzQ4Q2L4QUWRtjtgPSVmeKVAbbbdk pnKLEtfx7N2ULHqkpO9JSjA7YeIgjKLQcJfPfN5UHHwLT4Vt+TvBRv+BBkSk1zQZP+BY mjaDbk8G7gxsHfyiNv8hGtSttDAM6aCaZBLrpDy6Qw7PGAXTiX5SKvo84nLmYFW5JP9W hzlQSeaI7802kevylPQ+Amnpg2FAs1NcNmFoe5PQanQJTkNxbJrXl5fpycEpQJc3amVm 1XaGxu+Rie0ty6KtPXKtJUQRqfLOesR/7HPHM46w5HmeMFmAalBMWKFIQ/Rb+H2z90a9 JSMw== X-Gm-Message-State: AOAM531aIun8nRtH3ML29dmSoNoOLnvgkq1TFTJ45XBFW30q9ZeVwdh2 6R7+sSDPzz7R8Hy1FkP3YzJlgfjaWeGMLw== X-Google-Smtp-Source: ABdhPJxktLLdGrtox55Swk/ldpWbd5/BLt/KRrr3b113cbhhfAVFfuI9ZKKOnTnVVKLIetIKFBPqWA== X-Received: by 2002:a05:620a:113b:: with SMTP id p27mr21211201qkk.33.1637244002209; Thu, 18 Nov 2021 06:00:02 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 2/7] cpu_x86.c: remove 'guest' param from x86Compute() Date: Thu, 18 Nov 2021 10:59:39 -0300 Message-Id: <20211118135944.272979-3-danielhb413@gmail.com> In-Reply-To: <20211118135944.272979-1-danielhb413@gmail.com> References: <20211118135944.272979-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-loop: libvir-list@redhat.com Cc: danielh413@gmail.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.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1637244182360100001 Content-Type: text/plain; charset="utf-8" x86Compute() is a static function called only by virCPUx86Compare() which passes NULL to the 'guest' parameter of x86Compute(). The last caller of x86Compute() that used it with 'guest' !=3D NULL was an API called 'cpuGuestData'. This API was dropped by commit 03fa904c0c0cb2 a few years ago. Since then all callers of x86Compute() uses it with 'guest' =3D NULL. Removing the 'guest' parameter allow us to remove a good chunk of logic that isn't being used for awhile. Signed-off-by: Daniel Henrique Barboza --- src/cpu/cpu_x86.c | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 54cfed3fe6..e396bbb4e4 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1833,7 +1833,6 @@ virCPUx86DataParse(xmlNodePtr node) static virCPUCompareResult x86Compute(virCPUDef *host, virCPUDef *cpu, - virCPUData **guest, char **message) { virCPUx86Map *map =3D NULL; @@ -1848,7 +1847,6 @@ x86Compute(virCPUDef *host, g_autoptr(virCPUData) guestData =3D NULL; virCPUCompareResult ret; virCPUx86CompareResult result; - virArch arch; size_t i; =20 if (cpu->arch !=3D VIR_ARCH_NONE) { @@ -1870,9 +1868,6 @@ x86Compute(virCPUDef *host, } return VIR_CPU_COMPARE_INCOMPATIBLE; } - arch =3D cpu->arch; - } else { - arch =3D host->arch; } =20 if (cpu->vendor && @@ -1939,37 +1934,6 @@ x86Compute(virCPUDef *host, return VIR_CPU_COMPARE_INCOMPATIBLE; } =20 - if (guest) { - guest_model =3D x86ModelCopy(host_model); - - if (cpu->vendor && host_model->vendor && - virCPUx86DataAddItem(&guest_model->data, - &host_model->vendor->data) < 0) - return VIR_CPU_COMPARE_ERROR; - - if (host_model->signatures && host_model->signatures->count > 0) { - virCPUx86Signature *sig =3D &host_model->signatures->items[0]; - if (x86DataAddSignature(&guest_model->data, - virCPUx86SignatureToCPUID(sig)) < 0) - return VIR_CPU_COMPARE_ERROR; - } - - if (cpu->type =3D=3D VIR_CPU_TYPE_GUEST - && cpu->match =3D=3D VIR_CPU_MATCH_EXACT) - x86DataSubtract(&guest_model->data, &diff->data); - - if (x86DataAdd(&guest_model->data, &cpu_force->data)) - return VIR_CPU_COMPARE_ERROR; - - x86DataSubtract(&guest_model->data, &cpu_disable->data); - - if (!(guestData =3D virCPUDataNew(arch))) - return VIR_CPU_COMPARE_ERROR; - x86DataCopy(&guestData->data.x86, &guest_model->data); - - *guest =3D g_steal_pointer(&guestData); - } - return ret; } #undef virX86CpuIncompatible @@ -1994,7 +1958,7 @@ virCPUx86Compare(virCPUDef *host, return VIR_CPU_COMPARE_INCOMPATIBLE; } =20 - ret =3D x86Compute(host, cpu, NULL, &message); + ret =3D x86Compute(host, cpu, &message); =20 if (ret =3D=3D VIR_CPU_COMPARE_INCOMPATIBLE && failIncompatible) { if (message) --=20 2.31.1