Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Notes:
Version 3:
- new patch
src/qemu/qemu_capabilities.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index c6a2f65239..92041190eb 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1600,6 +1600,19 @@ virQEMUCapsSEVInfoCopy(virSEVCapabilityPtr *dst,
}
+static int
+virQEMUCapsAccelCopy(virQEMUCapsAccelPtr dst,
+ virQEMUCapsAccelPtr src)
+{
+ if (virQEMUCapsHostCPUDataCopy(&dst->hostCPU, &src->hostCPU) < 0)
+ return -1;
+
+ dst->cpuModels = qemuMonitorCPUDefsCopy(src->cpuModels);
+
+ return 0;
+}
+
+
virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps)
{
virQEMUCapsPtr ret = virQEMUCapsNew();
@@ -1626,11 +1639,8 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps)
ret->arch = qemuCaps->arch;
- ret->kvm.cpuModels = qemuMonitorCPUDefsCopy(qemuCaps->kvm.cpuModels);
- ret->tcg.cpuModels = qemuMonitorCPUDefsCopy(qemuCaps->tcg.cpuModels);
-
- if (virQEMUCapsHostCPUDataCopy(&ret->kvm.hostCPU,
&qemuCaps->kvm.hostCPU) < 0 ||
- virQEMUCapsHostCPUDataCopy(&ret->tcg.hostCPU,
&qemuCaps->tcg.hostCPU) < 0)
+ if (virQEMUCapsAccelCopy(&ret->kvm, &qemuCaps->kvm) < 0 ||
+ virQEMUCapsAccelCopy(&ret->tcg, &qemuCaps->tcg) < 0)
goto error;
if (VIR_ALLOC_N(ret->machineTypes, qemuCaps->nmachineTypes) < 0)
--
2.23.0