The functions return virDomainCapsCPUModelsPtr and thus they should be
called *CPUModels for consistency. Functions called *CPUDefinitions will
work on qemuMonitorCPUDefsPtr.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
---
Notes:
Version 2:
- new patch
Version 3:
- no change
src/qemu/qemu_capabilities.c | 28 ++++++++++++++--------------
src/qemu/qemu_capabilities.h | 14 +++++++-------
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_process.c | 4 ++--
tests/cputest.c | 2 +-
5 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 1497c4f645..dfffc45d1d 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1911,10 +1911,10 @@ virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr defs,
virDomainCapsCPUModelsPtr
-virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps,
- virDomainVirtType type,
- const char **modelWhitelist,
- const char **modelBlacklist)
+virQEMUCapsGetCPUModels(virQEMUCapsPtr qemuCaps,
+ virDomainVirtType type,
+ const char **modelWhitelist,
+ const char **modelBlacklist)
{
virDomainCapsCPUModelsPtr cpuModels;
@@ -2472,9 +2472,9 @@ virQEMUCapsProbeQMPMachineProps(virQEMUCapsPtr qemuCaps,
int
-virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon,
- virArch arch,
- virDomainCapsCPUModelsPtr *cpuModels)
+virQEMUCapsFetchCPUModels(qemuMonitorPtr mon,
+ virArch arch,
+ virDomainCapsCPUModelsPtr *cpuModels)
{
g_autoptr(qemuMonitorCPUDefs) defs = NULL;
size_t i;
@@ -2524,7 +2524,7 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemuCaps,
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_DEFINITIONS))
return 0;
- if (virQEMUCapsFetchCPUDefinitions(mon, qemuCaps->arch, &models) < 0)
+ if (virQEMUCapsFetchCPUModels(mon, qemuCaps->arch, &models) < 0)
return -1;
if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM))
@@ -3145,7 +3145,7 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps,
if (!(data = virQEMUCapsGetCPUModelX86Data(qemuCaps, model, migratable)))
goto cleanup;
- cpuModels = virQEMUCapsGetCPUDefinitions(qemuCaps, type, NULL, NULL);
+ cpuModels = virQEMUCapsGetCPUModels(qemuCaps, type, NULL, NULL);
if (cpuDecode(cpu, data, cpuModels) < 0)
goto cleanup;
@@ -3234,7 +3234,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
VIR_DEBUG("No host CPU model info from QEMU; probing host CPU
directly");
- cpuModels = virQEMUCapsGetCPUDefinitions(qemuCaps, type, NULL, NULL);
+ cpuModels = virQEMUCapsGetCPUModels(qemuCaps, type, NULL, NULL);
hostCPU = virQEMUCapsProbeHostCPU(hostArch, cpuModels);
if (!hostCPU ||
@@ -5281,10 +5281,10 @@ virQEMUCapsFillDomainCPUCaps(virCapsPtr caps,
VIR_AUTOSTRINGLIST models = NULL;
if (virCPUGetModels(domCaps->arch, &models) >= 0) {
- domCaps->cpu.custom = virQEMUCapsGetCPUDefinitions(qemuCaps,
- domCaps->virttype,
- (const char **)models,
- blacklist);
+ domCaps->cpu.custom = virQEMUCapsGetCPUModels(qemuCaps,
+ domCaps->virttype,
+ (const char **)models,
+ blacklist);
} else {
domCaps->cpu.custom = NULL;
}
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index ba3fe3d2b6..923706c3bf 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -569,13 +569,13 @@ int virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps,
const char **name,
size_t count,
virDomainCapsCPUUsable usable);
-virDomainCapsCPUModelsPtr virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps,
- virDomainVirtType type,
- const char **modelWhitelist,
- const char **modelBlacklist);
-int virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon,
- virArch arch,
- virDomainCapsCPUModelsPtr *cpuModels);
+virDomainCapsCPUModelsPtr virQEMUCapsGetCPUModels(virQEMUCapsPtr qemuCaps,
+ virDomainVirtType type,
+ const char **modelWhitelist,
+ const char **modelBlacklist);
+int virQEMUCapsFetchCPUModels(qemuMonitorPtr mon,
+ virArch arch,
+ virDomainCapsCPUModelsPtr *cpuModels);
typedef enum {
/* Host CPU definition reported in domain capabilities. */
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 76787bf56a..8240a6e74e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13730,7 +13730,7 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn,
if (!qemuCaps)
goto cleanup;
- if (!(cpuModels = virQEMUCapsGetCPUDefinitions(qemuCaps, virttype, NULL, NULL)) ||
+ if (!(cpuModels = virQEMUCapsGetCPUModels(qemuCaps, virttype, NULL, NULL)) ||
cpuModels->nmodels == 0) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("QEMU '%s' does not support any CPU models for
"
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index bdd01993a2..2ea524ab33 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4358,7 +4358,7 @@ qemuProcessFetchCPUDefinitions(virQEMUDriverPtr driver,
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
goto error;
- rc = virQEMUCapsFetchCPUDefinitions(priv->mon, vm->def->os.arch,
&models);
+ rc = virQEMUCapsFetchCPUModels(priv->mon, vm->def->os.arch, &models);
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
goto error;
@@ -6127,7 +6127,7 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def,
VIR_QEMU_CAPS_HOST_CPU_MIGRATABLE)) <
0)
return -1;
- cpuModels = virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtType, NULL,
NULL);
+ cpuModels = virQEMUCapsGetCPUModels(qemuCaps, def->virtType, NULL, NULL);
if (virCPUTranslate(def->os.arch, def->cpu, cpuModels) < 0)
return -1;
diff --git a/tests/cputest.c b/tests/cputest.c
index 11c061e37a..ef2d4e28df 100644
--- a/tests/cputest.c
+++ b/tests/cputest.c
@@ -548,7 +548,7 @@ cpuTestGetCPUModels(const struct data *data,
if (!(qemuCaps = cpuTestMakeQEMUCaps(data)))
return -1;
- *models = virQEMUCapsGetCPUDefinitions(qemuCaps, VIR_DOMAIN_VIRT_KVM, NULL, NULL);
+ *models = virQEMUCapsGetCPUModels(qemuCaps, VIR_DOMAIN_VIRT_KVM, NULL, NULL);
virObjectUnref(qemuCaps);
--
2.23.0