Re: [PATCH 2/7] cpu_x86.c: remove 'guest' param from x86Compute()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On a Thursday in 2021, Daniel Henrique Barboza wrote:
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' != 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' = 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 <danielhb413@xxxxxxxxx>
---
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 = NULL;
@@ -1848,7 +1847,6 @@ x86Compute(virCPUDef *host,
    g_autoptr(virCPUData) guestData = NULL;
    virCPUCompareResult ret;
    virCPUx86CompareResult result;
-    virArch arch;
    size_t i;

../../work/libvirt/src/cpu/cpu_x86.c:1846:31: error: unused variable 'guest_model' [-Werror,-Wunused-variable]
    g_autoptr(virCPUx86Model) guest_model = NULL;
                              ^
../../work/libvirt/src/cpu/cpu_x86.c:1847:27: error: unused variable 'guestData' [-Werror,-Wunused-variable]
    g_autoptr(virCPUData) guestData = NULL;


    if (cpu->arch != VIR_ARCH_NONE) {

Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>

Jano

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux