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@xxxxxxxxxx> --- Notes: Version 2: - new patch 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 87ac9bacdc..cdc3a2d4b0 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1923,10 +1923,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; @@ -2488,9 +2488,9 @@ virQEMUCapsProbeQMPMachineProps(virQEMUCapsPtr qemuCaps, int -virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, - virArch arch, - virDomainCapsCPUModelsPtr *cpuModels) +virQEMUCapsFetchCPUModels(qemuMonitorPtr mon, + virArch arch, + virDomainCapsCPUModelsPtr *cpuModels) { VIR_AUTOPTR(qemuMonitorCPUDefs) defs = NULL; size_t i; @@ -2541,7 +2541,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)) @@ -3164,7 +3164,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; @@ -3253,7 +3253,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 || @@ -5308,10 +5308,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 802f07fe92..50c07f38ad 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13939,7 +13939,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 93fe994f8e..d1c4035c1c 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4366,7 +4366,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; @@ -6139,7 +6139,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 4428d451cf..727e603ed7 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -550,7 +550,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 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list