The "preferred" parameter is not used by any caller of cpuDecode
anymore. It's only used internally in cpu_x86 to implement cpuBaseline.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
Reviewed-by: John Ferlan <jferlan(a)redhat.com>
---
Notes:
Version 2:
- no change
src/cpu/cpu.c | 15 ++++-----------
src/cpu/cpu.h | 6 ++----
src/cpu/cpu_ppc64.c | 5 ++---
src/cpu/cpu_x86.c | 7 +++----
src/libxl/libxl_capabilities.c | 2 +-
src/qemu/qemu_capabilities.c | 4 +---
tests/cputest.c | 2 +-
7 files changed, 14 insertions(+), 27 deletions(-)
diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c
index 42b836354d..f589666562 100644
--- a/src/cpu/cpu.c
+++ b/src/cpu/cpu.c
@@ -192,34 +192,27 @@ virCPUCompare(virArch arch,
* @cpu: CPU definition stub to be filled in
* @data: internal CPU data to be decoded into @cpu definition
* @models: list of CPU models that can be considered when decoding @data
- * @preferred: CPU models that should be used if possible
*
* Decodes internal CPU data into a CPU definition consisting of a CPU model
* and a list of CPU features. The @cpu model stub is supposed to have arch,
* type, match and fallback members set, this function will add the rest. If
* @models list is NULL, all models supported by libvirt will be considered
* when decoding the data. In general, this function will select the model
- * closest to the CPU specified by @data unless @preferred is non-NULL, in
- * which case the @preferred model will be used as long as it is compatible
- * with @data.
+ * closest to the CPU specified by @data.
*
* For VIR_ARCH_I686 and VIR_ARCH_X86_64 architectures this means the computed
* CPU definition will have the shortest possible list of additional features.
- * When @preferred is non-NULL, the @preferred model will be used even if
- * other models would result in a shorter list of additional features.
*
* Returns 0 on success, -1 on error.
*/
int
cpuDecode(virCPUDefPtr cpu,
const virCPUData *data,
- virDomainCapsCPUModelsPtr models,
- const char *preferred)
+ virDomainCapsCPUModelsPtr models)
{
struct cpuArchDriver *driver;
- VIR_DEBUG("cpu=%p, data=%p, models=%p, preferred=%s",
- cpu, data, models, NULLSTR(preferred));
+ VIR_DEBUG("cpu=%p, data=%p, models=%p", cpu, data, models);
if (models) {
size_t i;
for (i = 0; i < models->nmodels; i++)
@@ -243,7 +236,7 @@ cpuDecode(virCPUDefPtr cpu,
return -1;
}
- return driver->decode(cpu, data, models, preferred);
+ return driver->decode(cpu, data, models);
}
diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h
index d325fe3d04..83d5bcb63f 100644
--- a/src/cpu/cpu.h
+++ b/src/cpu/cpu.h
@@ -53,8 +53,7 @@ typedef virCPUCompareResult
typedef int
(*cpuArchDecode) (virCPUDefPtr cpu,
const virCPUData *data,
- virDomainCapsCPUModelsPtr models,
- const char *preferred);
+ virDomainCapsCPUModelsPtr models);
typedef int
(*cpuArchEncode) (virArch arch,
@@ -162,8 +161,7 @@ virCPUCompare(virArch arch,
int
cpuDecode (virCPUDefPtr cpu,
const virCPUData *data,
- virDomainCapsCPUModelsPtr models,
- const char *preferred)
+ virDomainCapsCPUModelsPtr models)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int
diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c
index 902c465cf4..76582d4083 100644
--- a/src/cpu/cpu_ppc64.c
+++ b/src/cpu/cpu_ppc64.c
@@ -669,8 +669,7 @@ virCPUppc64Compare(virCPUDefPtr host,
static int
ppc64DriverDecode(virCPUDefPtr cpu,
const virCPUData *data,
- virDomainCapsCPUModelsPtr models,
- const char *preferred ATTRIBUTE_UNUSED)
+ virDomainCapsCPUModelsPtr models)
{
int ret = -1;
struct ppc64_map *map;
@@ -741,7 +740,7 @@ virCPUppc64GetHost(virCPUDefPtr cpu,
#endif
data->pvr[0].mask = 0xfffffffful;
- ret = ppc64DriverDecode(cpu, cpuData, models, NULL);
+ ret = ppc64DriverDecode(cpu, cpuData, models);
cleanup:
virCPUppc64DataFree(cpuData);
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 3f9e83ca72..84ec878d1b 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -1945,10 +1945,9 @@ x86Decode(virCPUDefPtr cpu,
static int
x86DecodeCPUData(virCPUDefPtr cpu,
const virCPUData *data,
- virDomainCapsCPUModelsPtr models,
- const char *preferred)
+ virDomainCapsCPUModelsPtr models)
{
- return x86Decode(cpu, &data->data.x86, models, preferred, false);
+ return x86Decode(cpu, &data->data.x86, models, NULL, false);
}
@@ -2412,7 +2411,7 @@ virCPUx86GetHost(virCPUDefPtr cpu,
cpuidSet(CPUX86_EXTENDED, cpuData) < 0)
goto cleanup;
- ret = x86DecodeCPUData(cpu, cpuData, models, NULL);
+ ret = x86DecodeCPUData(cpu, cpuData, models);
cleanup:
virCPUx86DataFree(cpuData);
diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c
index 4def561143..18596c7c72 100644
--- a/src/libxl/libxl_capabilities.c
+++ b/src/libxl/libxl_capabilities.c
@@ -192,7 +192,7 @@ libxlCapsInitCPU(virCapsPtr caps, libxl_physinfo *phy_info,
ret = 0;
if (!(data = libxlCapsNodeData(cpu, phy_info->hw_cap, version)) ||
- cpuDecode(cpu, data, NULL, NULL) < 0) {
+ cpuDecode(cpu, data, NULL) < 0) {
VIR_WARN("Failed to initialize host cpu features");
goto error;
}
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 4bdc3f26c9..8803980495 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3397,9 +3397,7 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps,
if (virCPUx86DataSetSignature(data, sigFamily, sigModel) < 0)
goto cleanup;
- if (cpuDecode(cpu, data,
- virQEMUCapsGetCPUDefinitions(qemuCaps, type),
- NULL) < 0)
+ if (cpuDecode(cpu, data, virQEMUCapsGetCPUDefinitions(qemuCaps, type)) < 0)
goto cleanup;
ret = 0;
diff --git a/tests/cputest.c b/tests/cputest.c
index 552c07e2c5..cc95f1d551 100644
--- a/tests/cputest.c
+++ b/tests/cputest.c
@@ -491,7 +491,7 @@ cpuTestCPUID(bool guest, const void *arg)
cpu->type = VIR_CPU_TYPE_HOST;
}
- if (cpuDecode(cpu, hostData, NULL, NULL) < 0)
+ if (cpuDecode(cpu, hostData, NULL) < 0)
goto cleanup;
if (virAsprintf(&result, "cpuid-%s-%s",
--
2.14.2