mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-31 10:05:31 +00:00
conf: Drop nameLen parameter from virDomainCapsCPUModelsAdd
All callers use nameLen == -1 anyway. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
537768a7ca
commit
18eeb75daf
@ -167,7 +167,7 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr old)
|
||||
|
||||
for (i = 0; i < old->nmodels; i++) {
|
||||
if (virDomainCapsCPUModelsAdd(cpuModels,
|
||||
old->models[i].name, -1,
|
||||
old->models[i].name,
|
||||
old->models[i].usable,
|
||||
old->models[i].blockers) < 0)
|
||||
goto error;
|
||||
@ -200,7 +200,7 @@ virDomainCapsCPUModelsFilter(virDomainCapsCPUModelsPtr old,
|
||||
continue;
|
||||
|
||||
if (virDomainCapsCPUModelsAdd(cpuModels,
|
||||
old->models[i].name, -1,
|
||||
old->models[i].name,
|
||||
old->models[i].usable,
|
||||
old->models[i].blockers) < 0)
|
||||
goto error;
|
||||
@ -238,15 +238,13 @@ virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels,
|
||||
int
|
||||
virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels,
|
||||
const char *name,
|
||||
ssize_t nameLen,
|
||||
virDomainCapsCPUUsable usable,
|
||||
char **blockers)
|
||||
{
|
||||
g_autofree char * nameCopy = NULL;
|
||||
VIR_AUTOSTRINGLIST blockersCopy = NULL;
|
||||
|
||||
if (VIR_STRNDUP(nameCopy, name, nameLen) < 0)
|
||||
return -1;
|
||||
nameCopy = g_strdup(name);
|
||||
|
||||
if (virStringListCopy(&blockersCopy, (const char **)blockers) < 0)
|
||||
return -1;
|
||||
|
@ -203,7 +203,6 @@ int virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels,
|
||||
char ***blockers);
|
||||
int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels,
|
||||
const char *name,
|
||||
ssize_t nameLen,
|
||||
virDomainCapsCPUUsable usable,
|
||||
char **blockers);
|
||||
virDomainCapsCPUModelPtr
|
||||
|
@ -1873,7 +1873,7 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps,
|
||||
}
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
if (virDomainCapsCPUModelsAdd(cpus, name[i], -1, usable, NULL) < 0)
|
||||
if (virDomainCapsCPUModelsAdd(cpus, name[i], usable, NULL) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -845,7 +845,7 @@ cpuTestUpdateLive(const void *arg)
|
||||
usable = hvModel->usable;
|
||||
}
|
||||
|
||||
if (virDomainCapsCPUModelsAdd(models, expected->model, -1,
|
||||
if (virDomainCapsCPUModelsAdd(models, expected->model,
|
||||
usable, blockers) < 0)
|
||||
goto cleanup;
|
||||
|
||||
@ -954,7 +954,7 @@ cpuTestInitModels(const char **list)
|
||||
return NULL;
|
||||
|
||||
for (model = list; *model; model++) {
|
||||
if (virDomainCapsCPUModelsAdd(cpus, *model, -1,
|
||||
if (virDomainCapsCPUModelsAdd(cpus, *model,
|
||||
VIR_DOMCAPS_CPU_USABLE_UNKNOWN, NULL) < 0)
|
||||
goto error;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user