Both functions always return 0.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 35f8e9828a..826293a879 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1885,7 +1885,7 @@ virQEMUCapsHostCPUDataClear(virQEMUCapsHostCPUData *cpuData)
}
-static int
+static void
virQEMUCapsSEVInfoCopy(virSEVCapability **dst,
virSEVCapability *src)
{
@@ -1893,7 +1893,7 @@ virQEMUCapsSEVInfoCopy(virSEVCapability **dst,
if (!src) {
*dst = NULL;
- return 0;
+ return;
}
tmp = g_new0(virSEVCapability, 1);
@@ -1910,11 +1910,10 @@ virQEMUCapsSEVInfoCopy(virSEVCapability **dst,
tmp->max_es_guests = src->max_es_guests;
*dst = g_steal_pointer(&tmp);
- return 0;
}
-static int
+static void
virQEMUCapsSGXInfoCopy(virSGXCapability **dst,
virSGXCapability *src)
{
@@ -1922,7 +1921,7 @@ virQEMUCapsSGXInfoCopy(virSGXCapability **dst,
if (!src) {
*dst = NULL;
- return 0;
+ return;
}
tmp = g_new0(virSGXCapability, 1);
@@ -1940,7 +1939,6 @@ virQEMUCapsSGXInfoCopy(virSGXCapability **dst,
}
*dst = g_steal_pointer(&tmp);
- return 0;
}
@@ -2017,16 +2015,11 @@ virQEMUCaps *virQEMUCapsNewCopy(virQEMUCaps *qemuCaps)
for (i = 0; i < qemuCaps->ngicCapabilities; i++)
ret->gicCapabilities[i] = qemuCaps->gicCapabilities[i];
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SEV_GUEST) &&
- virQEMUCapsSEVInfoCopy(&ret->sevCapabilities,
- qemuCaps->sevCapabilities) < 0)
- return NULL;
-
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SEV_GUEST))
+ virQEMUCapsSEVInfoCopy(&ret->sevCapabilities,
qemuCaps->sevCapabilities);
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SGX_EPC) &&
- virQEMUCapsSGXInfoCopy(&ret->sgxCapabilities,
- qemuCaps->sgxCapabilities) < 0)
- return NULL;
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SGX_EPC))
+ virQEMUCapsSGXInfoCopy(&ret->sgxCapabilities,
qemuCaps->sgxCapabilities);
ret->hypervCapabilities = g_memdup(qemuCaps->hypervCapabilities,
sizeof(virDomainCapsFeatureHyperv));
--
2.39.2