1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

util: Remove return value from virTypedParamsCopy

It is already nonfallible, so just change the return type to void.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Martin Kletzander 2022-11-11 14:15:43 +01:00
parent 539e851c5d
commit 15c11a7e54
5 changed files with 11 additions and 17 deletions

View File

@ -3258,8 +3258,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain,
return NULL;
}
if (virTypedParamsCopy(&tmp, params, nparams) < 0)
return NULL;
virTypedParamsCopy(&tmp, params, nparams);
params = tmp;
ret = VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,

View File

@ -420,8 +420,7 @@ virIdentity *virIdentityNewCopy(virIdentity *src)
{
g_autoptr(virIdentity) ident = virIdentityNew();
if (virTypedParamsCopy(&ident->params, src->params, src->nparams) < 0)
return NULL;
virTypedParamsCopy(&ident->params, src->params, src->nparams);
ident->nparams = src->nparams;
ident->maxparams = src->nparams;
@ -826,8 +825,8 @@ int virIdentitySetParameters(virIdentity *ident,
ident->params = NULL;
ident->nparams = 0;
ident->maxparams = 0;
if (virTypedParamsCopy(&ident->params, params, nparams) < 0)
return -1;
virTypedParamsCopy(&ident->params, params, nparams);
ident->nparams = nparams;
ident->maxparams = nparams;
@ -839,8 +838,7 @@ virTypedParamList *virIdentityGetParameters(virIdentity *ident)
{
virTypedParameter *tmp = NULL;
if (virTypedParamsCopy(&tmp, ident->params, ident->nparams) < 0)
return NULL;
virTypedParamsCopy(&tmp, ident->params, ident->nparams);
return virTypedParamListFromParams(&tmp, ident->nparams);
}

View File

@ -347,7 +347,7 @@ virTypedParamsReplaceString(virTypedParameterPtr *params,
}
int
void
virTypedParamsCopy(virTypedParameterPtr *dst,
virTypedParameterPtr src,
int nparams)
@ -356,7 +356,7 @@ virTypedParamsCopy(virTypedParameterPtr *dst,
*dst = NULL;
if (!src || nparams <= 0)
return 0;
return;
*dst = g_new0(virTypedParameter, nparams);
@ -369,8 +369,6 @@ virTypedParamsCopy(virTypedParameterPtr *dst,
(*dst)[i].value = src[i].value;
}
}
return 0;
}

View File

@ -86,9 +86,9 @@ int virTypedParamsReplaceString(virTypedParameterPtr *params,
const char *name,
const char *value);
int virTypedParamsCopy(virTypedParameterPtr *dst,
virTypedParameterPtr src,
int nparams);
void virTypedParamsCopy(virTypedParameterPtr *dst,
virTypedParameterPtr src,
int nparams);
char *virTypedParameterToString(virTypedParameterPtr param);

View File

@ -3144,8 +3144,7 @@ vzDomainMigratePerformP2P(virDomainObj *dom,
int ret = -1;
int maxparams = nparams;
if (virTypedParamsCopy(&params, orig_params, nparams) < 0)
return -1;
virTypedParamsCopy(&params, orig_params, nparams);
if (!(dconn = virConnectOpen(dconnuri)))
goto done;