From nobody Sat Feb 7 08:44:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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.133.124]) by mx.zohomail.com with SMTPS id 1637245259874125.7010841278319; Thu, 18 Nov 2021 06:20:59 -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-500-m81Q-YrcP6ahjZxZQq-sRw-1; Thu, 18 Nov 2021 09:20:54 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1F56F804163; Thu, 18 Nov 2021 14:20:46 +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 02EDD179B3; Thu, 18 Nov 2021 14:20:46 +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 C9FB74E9E2; Thu, 18 Nov 2021 14:20:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AIEKfGU012969 for ; Thu, 18 Nov 2021 09:20:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4139940CFD10; Thu, 18 Nov 2021 14:20:41 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3B97F40CFD11 for ; Thu, 18 Nov 2021 14:20:41 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (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 203CB1066682 for ; Thu, 18 Nov 2021 14:20:41 +0000 (UTC) Received: from mail-ua1-f48.google.com (mail-ua1-f48.google.com [209.85.222.48]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-103-gQST1-RrM16mUca9N-UWvQ-1; Thu, 18 Nov 2021 09:20:39 -0500 Received: by mail-ua1-f48.google.com with SMTP id j14so4191684uan.10 for ; Thu, 18 Nov 2021 06:20:39 -0800 (PST) Received: from rekt.ibmuc.com ([152.250.208.89]) by smtp.gmail.com with ESMTPSA id b8sm1734306vsl.19.2021.11.18.06.20.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Nov 2021 06:20:39 -0800 (PST) X-MC-Unique: m81Q-YrcP6ahjZxZQq-sRw-1 X-MC-Unique: gQST1-RrM16mUca9N-UWvQ-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=DfNQmB9tcBL0CKDZhNp2FYuozN0/Rnvy95tzXD6XqhNtk70A/BhOsaxWRw6NZxyFN/ 5YYk6ssnLYQPuaLGeJCBzXQYn6rWlMuJ1mabV1jUGqseem2DMgNAX58dhb7DUyEINZDg oXGRFPzflx56mbw/TGJKA1mjVqz/UWMFZqe5QSZFx0kBxR5X052Jm4/TDj0GiDGC8WqC vzkLUiwOoZiO0vUnpyEDL/jlQht2/F9rg8TMcueVV0+RoTPL54U+IIYjBat3SwelgJ0R OBHv9q3ikYqwIbWrg8lmeYSsNTHQXW4MZX5lhsF/Y0Szk5FDSBx1lTYJ2f/DQLrVo6Kh LOpQ== X-Gm-Message-State: AOAM531vPBKWUUKyYiBxxS+knVhVROnIkQxJwbNxjtQUgQhaHR+17Ihj HpiUsIL4pAKucnnIrKlmFi+KAa60lPODsw== X-Google-Smtp-Source: ABdhPJwxKtEwmktg0vOoTW4YU6YKNtQv187xEsO0ZNmjQMsTrXDUqXasUY1IZJk35gpRYWmqRbyoWg== X-Received: by 2002:a05:6102:242f:: with SMTP id l15mr81521450vsi.11.1637245239224; Thu, 18 Nov 2021 06:20:39 -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 11:20:19 -0300 Message-Id: <20211118142024.275704-3-danielhb413@gmail.com> In-Reply-To: <20211118142024.275704-1-danielhb413@gmail.com> References: <20211118142024.275704-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.1 X-loop: libvir-list@redhat.com Cc: danielhb413@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.11 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: 1637245260826100001 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 Reviewed-by: J=C3=A1n Tomko --- 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