After removing the host CPU model re-computation,
this function is no longer necessary.
This reverts commits:
commit d0498881a04dddd772f9f63b03de80fb4c33d090
virQEMUCapsFreeHostCPUModel: Don't always free host cpuData
commit 5276ec712a44b3680569a096e8fe56a925f0d495
testUpdateQEMUCaps: Don't leak host cpuData
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 25 ++-----------------------
src/qemu/qemu_capspriv.h | 5 -----
tests/qemuxml2argvtest.c | 5 -----
3 files changed, 2 insertions(+), 33 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 08cf822b88..69663de1ce 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1526,19 +1526,12 @@ virQEMUCapsHostCPUDataCopy(virQEMUCapsHostCPUDataPtr dst,
static void
-virQEMUCapsHostCPUDataClearModels(virQEMUCapsHostCPUDataPtr cpuData)
+virQEMUCapsHostCPUDataClear(virQEMUCapsHostCPUDataPtr cpuData)
{
+ qemuMonitorCPUModelInfoFree(cpuData->info);
virCPUDefFree(cpuData->reported);
virCPUDefFree(cpuData->migratable);
virCPUDefFree(cpuData->full);
-}
-
-
-static void
-virQEMUCapsHostCPUDataClear(virQEMUCapsHostCPUDataPtr cpuData)
-{
- qemuMonitorCPUModelInfoFree(cpuData->info);
- virQEMUCapsHostCPUDataClearModels(cpuData);
memset(cpuData, 0, sizeof(*cpuData));
}
@@ -2984,20 +2977,6 @@ virQEMUCapsNewHostCPUModel(void)
}
-void
-virQEMUCapsFreeHostCPUModel(virQEMUCapsPtr qemuCaps,
- virArch hostArch,
- virDomainVirtType type)
-{
- virQEMUCapsHostCPUDataPtr cpuData = virQEMUCapsGetHostCPUData(qemuCaps, type);
-
- if (!virQEMUCapsGuestIsNative(hostArch, qemuCaps->arch))
- return;
-
- virQEMUCapsHostCPUDataClearModels(cpuData);
-}
-
-
void
virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
virArch hostArch,
diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h
index cb5e0dd9a9..8d1a40fe74 100644
--- a/src/qemu/qemu_capspriv.h
+++ b/src/qemu/qemu_capspriv.h
@@ -56,11 +56,6 @@ void
virQEMUCapsSetArch(virQEMUCapsPtr qemuCaps,
virArch arch);
-void
-virQEMUCapsFreeHostCPUModel(virQEMUCapsPtr qemuCaps,
- virArch hostArch,
- virDomainVirtType type);
-
void
virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
virArch hostArch,
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 1a137399d4..867e0d569f 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -418,11 +418,6 @@ testUpdateQEMUCaps(const struct testInfo *info,
!!(info->flags & FLAG_SKIP_LEGACY_CPUS)) < 0)
goto cleanup;
- virQEMUCapsFreeHostCPUModel(info->qemuCaps, caps->host.arch,
- VIR_DOMAIN_VIRT_KVM);
- virQEMUCapsFreeHostCPUModel(info->qemuCaps, caps->host.arch,
- VIR_DOMAIN_VIRT_QEMU);
-
virQEMUCapsInitHostCPUModel(info->qemuCaps, caps->host.arch,
VIR_DOMAIN_VIRT_KVM);
virQEMUCapsInitHostCPUModel(info->qemuCaps, caps->host.arch,
--
2.16.4