It is already nonfallible, so just change the return type to void.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/libvirt-domain.c | 3 +--
src/util/viridentity.c | 10 ++++------
src/util/virtypedparam.c | 6 ++----
src/util/virtypedparam.h | 6 +++---
src/vz/vz_driver.c | 3 +--
5 files changed, 11 insertions(+), 17 deletions(-)
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 1c2f1ce71c16..56c2abf3fae7 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -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,
diff --git a/src/util/viridentity.c b/src/util/viridentity.c
index 46dcf3a04e4f..4e9a783cee2c 100644
--- a/src/util/viridentity.c
+++ b/src/util/viridentity.c
@@ -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);
}
diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c
index 2d7e4ab35470..ae676d02fe93 100644
--- a/src/util/virtypedparam.c
+++ b/src/util/virtypedparam.c
@@ -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;
}
diff --git a/src/util/virtypedparam.h b/src/util/virtypedparam.h
index c4bc58ee8f6a..936dac24eabc 100644
--- a/src/util/virtypedparam.h
+++ b/src/util/virtypedparam.h
@@ -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);
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index 4f5e340d536c..d5147a6c0d9c 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -3144,8 +3144,7 @@ vzDomainMigratePerformP2P(virDomainObj *dom,
int ret = -1;
int maxparams = nparams;
- if (virTypedParamsCopy(¶ms, orig_params, nparams) < 0)
- return -1;
+ virTypedParamsCopy(¶ms, orig_params, nparams);
if (!(dconn = virConnectOpen(dconnuri)))
goto done;
--
2.38.1