On Tue, Nov 05, 2019 at 02:27:02PM +0100, Jiri Denemark wrote:
All callers use nameLen == -1 anyway.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
---
Notes:
Version 2:
- no change
Version 3:
- no change
src/conf/domain_capabilities.c | 7 +++----
src/conf/domain_capabilities.h | 1 -
src/qemu/qemu_capabilities.c | 2 +-
tests/cputest.c | 4 ++--
4 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index e92df9e9da..0a89ccd071 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -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,14 +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)
+ if (VIR_STRDUP(nameCopy, name) < 0)
return -1;
nameCopy = g_strdup(name);
if (virStringListCopy(&blockersCopy, (const char **)blockers) < 0)
Either way, could you push this sooner than the patches waiting for
QEMU? I'd like to clean up the rest of VIR_STRNDUP and forbid
VIR_STR(N)DUP completely.
Jano