On Thu, Oct 12, 2017 at 07:27:22 -0400, John Ferlan wrote:
On 10/04/2017 10:58 AM, Jiri Denemark wrote:
> All APIs which expect a list of CPU models supported by hypervisors were
> switched from char **models and int models to just accept a pointer to
> virDomainCapsCPUModels object stored in domain capabilities. This avoids
> the need to transform virDomainCapsCPUModelsPtr into a NULL-terminated
> list of model names and also allows the various cpu driver APIs to
> access additional details (such as its usability) about each CPU model.
...
> @@ -514,21 +503,20 @@ virCPUProbeHost(virArch arch)
> virCPUDefPtr
> cpuBaseline(virCPUDefPtr *cpus,
> unsigned int ncpus,
> - const char **models,
> - unsigned int nmodels,
> + virDomainCapsCPUModelsPtr models,
> bool migratable)
> {
> struct cpuArchDriver *driver;
> size_t i;
>
> - VIR_DEBUG("ncpus=%u, nmodels=%u", ncpus, nmodels);
> + VIR_DEBUG("ncpus=%u", ncpus);
You could add models=%p... not that it's necessary
Done.
> diff --git a/src/qemu/qemu_capabilities.c
b/src/qemu/qemu_capabilities.c
> index 7ddc6cafd4..225cee4ef9 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
[...]
> -int
> +virDomainCapsCPUModelsPtr
> virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps,
> - virDomainVirtType type,
> - char ***names,
> - size_t *count)
> + virDomainVirtType type)
> {
> - size_t i;
> - char **models = NULL;
> - virDomainCapsCPUModelsPtr cpus;
> -
> - *count = 0;
> - if (names)
> - *names = NULL;
> -
> if (type == VIR_DOMAIN_VIRT_KVM)
> - cpus = qemuCaps->kvmCPUModels;
> + return qemuCaps->kvmCPUModels;
> else
> - cpus = qemuCaps->tcgCPUModels;
> + return qemuCaps->tcgCPUModels;
>
...
> + return NULL;
Nice overall simplification, but how do we reach here?
Eh, the "return NULL;" shouldn't be there.
Jirka