qemu: capabilities: Remove return value from virQEMUCaps(SEV|SGX)InfoCopy

Both functions always return 0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2023-03-03 09:46:10 +01:00
parent e61adbf26b
commit 8b039b3839

View File

@ -1884,7 +1884,7 @@ virQEMUCapsHostCPUDataClear(virQEMUCapsHostCPUData *cpuData)
} }
static int static void
virQEMUCapsSEVInfoCopy(virSEVCapability **dst, virQEMUCapsSEVInfoCopy(virSEVCapability **dst,
virSEVCapability *src) virSEVCapability *src)
{ {
@ -1892,7 +1892,7 @@ virQEMUCapsSEVInfoCopy(virSEVCapability **dst,
if (!src) { if (!src) {
*dst = NULL; *dst = NULL;
return 0; return;
} }
tmp = g_new0(virSEVCapability, 1); tmp = g_new0(virSEVCapability, 1);
@ -1909,11 +1909,10 @@ virQEMUCapsSEVInfoCopy(virSEVCapability **dst,
tmp->max_es_guests = src->max_es_guests; tmp->max_es_guests = src->max_es_guests;
*dst = g_steal_pointer(&tmp); *dst = g_steal_pointer(&tmp);
return 0;
} }
static int static void
virQEMUCapsSGXInfoCopy(virSGXCapability **dst, virQEMUCapsSGXInfoCopy(virSGXCapability **dst,
virSGXCapability *src) virSGXCapability *src)
{ {
@ -1921,7 +1920,7 @@ virQEMUCapsSGXInfoCopy(virSGXCapability **dst,
if (!src) { if (!src) {
*dst = NULL; *dst = NULL;
return 0; return;
} }
tmp = g_new0(virSGXCapability, 1); tmp = g_new0(virSGXCapability, 1);
@ -1939,7 +1938,6 @@ virQEMUCapsSGXInfoCopy(virSGXCapability **dst,
} }
*dst = g_steal_pointer(&tmp); *dst = g_steal_pointer(&tmp);
return 0;
} }
@ -2017,16 +2015,11 @@ virQEMUCaps *virQEMUCapsNewCopy(virQEMUCaps *qemuCaps)
for (i = 0; i < qemuCaps->ngicCapabilities; i++) for (i = 0; i < qemuCaps->ngicCapabilities; i++)
ret->gicCapabilities[i] = qemuCaps->gicCapabilities[i]; ret->gicCapabilities[i] = qemuCaps->gicCapabilities[i];
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SEV_GUEST) && if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SEV_GUEST))
virQEMUCapsSEVInfoCopy(&ret->sevCapabilities, virQEMUCapsSEVInfoCopy(&ret->sevCapabilities, qemuCaps->sevCapabilities);
qemuCaps->sevCapabilities) < 0)
return NULL;
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SGX_EPC))
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SGX_EPC) && virQEMUCapsSGXInfoCopy(&ret->sgxCapabilities, qemuCaps->sgxCapabilities);
virQEMUCapsSGXInfoCopy(&ret->sgxCapabilities,
qemuCaps->sgxCapabilities) < 0)
return NULL;
ret->hypervCapabilities = g_memdup(qemuCaps->hypervCapabilities, ret->hypervCapabilities = g_memdup(qemuCaps->hypervCapabilities,
sizeof(virDomainCapsFeatureHyperv)); sizeof(virDomainCapsFeatureHyperv));