Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx> --- Notes: Version 3: - new patch src/qemu/qemu_capabilities.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 92041190eb..a0b5047276 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1674,6 +1674,14 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps) } +static void +virQEMUCapsAccelClear(virQEMUCapsAccelPtr caps) +{ + virQEMUCapsHostCPUDataClear(&caps->hostCPU); + virObjectUnref(caps->cpuModels); +} + + void virQEMUCapsDispose(void *obj) { virQEMUCapsPtr qemuCaps = obj; @@ -1686,9 +1694,6 @@ void virQEMUCapsDispose(void *obj) VIR_FREE(qemuCaps->machineTypes); virHashFree(qemuCaps->domCapsCache); - virObjectUnref(qemuCaps->kvm.cpuModels); - virObjectUnref(qemuCaps->tcg.cpuModels); - virBitmapFree(qemuCaps->flags); VIR_FREE(qemuCaps->package); @@ -1699,8 +1704,8 @@ void virQEMUCapsDispose(void *obj) virSEVCapabilitiesFree(qemuCaps->sevCapabilities); - virQEMUCapsHostCPUDataClear(&qemuCaps->kvm.hostCPU); - virQEMUCapsHostCPUDataClear(&qemuCaps->tcg.hostCPU); + virQEMUCapsAccelClear(&qemuCaps->kvm); + virQEMUCapsAccelClear(&qemuCaps->tcg); } void -- 2.23.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list