]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu_ppc64.c: remove 'guest' param from ppc64Compute()
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Thu, 18 Nov 2021 14:20:20 +0000 (11:20 -0300)
committerDaniel Henrique Barboza <danielhb413@gmail.com>
Fri, 19 Nov 2021 16:32:59 +0000 (13:32 -0300)
ppc64Compute() is used only once, by virCPUppc64Compare(), which
doesn't use the 'guest' parameter. It was last used by an API
called 'cpuGuestData' that was dropped by commit 03fa904c0c0cb2.

Removing the 'guest' parameter will not only remove unused code from
ppc64Compute() but also remove the ppc64MakeCPUData() entirely.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
src/cpu/cpu_ppc64.c

index c7caaa960864e41b7660c780cad47cd9f825f98c..314d2f7c860eec9b2494e5d1eb4d6b9f9ecddc08 100644 (file)
@@ -379,32 +379,15 @@ ppc64LoadMap(void)
     return g_steal_pointer(&map);
 }
 
-static virCPUData *
-ppc64MakeCPUData(virArch arch,
-                 virCPUppc64Data *data)
-{
-    g_autoptr(virCPUData) cpuData = NULL;
-
-    cpuData = g_new0(virCPUData, 1);
-    cpuData->arch = arch;
-
-    if (ppc64DataCopy(&cpuData->data.ppc64, data) < 0)
-        return NULL;
-
-    return g_steal_pointer(&cpuData);
-}
-
 static virCPUCompareResult
 ppc64Compute(virCPUDef *host,
              const virCPUDef *other,
-             virCPUData **guestData,
              char **message)
 {
     g_autoptr(virCPUppc64Map) map = NULL;
     g_autoptr(virCPUppc64Model) host_model = NULL;
     g_autoptr(virCPUppc64Model) guest_model = NULL;
     g_autoptr(virCPUDef) cpu = NULL;
-    virArch arch;
     size_t i;
 
     /* Ensure existing configurations are handled correctly */
@@ -431,9 +414,6 @@ ppc64Compute(virCPUDef *host,
 
             return VIR_CPU_COMPARE_INCOMPATIBLE;
         }
-        arch = cpu->arch;
-    } else {
-        arch = host->arch;
     }
 
     if (cpu->vendor &&
@@ -506,10 +486,6 @@ ppc64Compute(virCPUDef *host,
         return VIR_CPU_COMPARE_INCOMPATIBLE;
     }
 
-    if (guestData)
-        if (!(*guestData = ppc64MakeCPUData(arch, &guest_model->data)))
-            return VIR_CPU_COMPARE_ERROR;
-
     return VIR_CPU_COMPARE_IDENTICAL;
 }
 
@@ -532,7 +508,7 @@ virCPUppc64Compare(virCPUDef *host,
         return VIR_CPU_COMPARE_INCOMPATIBLE;
     }
 
-    ret = ppc64Compute(host, cpu, NULL, &message);
+    ret = ppc64Compute(host, cpu, &message);
 
     if (failIncompatible && ret == VIR_CPU_COMPARE_INCOMPATIBLE) {
         ret = VIR_CPU_COMPARE_ERROR;