mirror of https://gitee.com/openkylin/libvirt.git
qemu: remove unnecessary virQEMUCapsFreeHostCPUModel
After removing the host CPU model re-computation, this function is no longer necessary. This reverts commits: commitd0498881a0
virQEMUCapsFreeHostCPUModel: Don't always free host cpuData commit5276ec712a
testUpdateQEMUCaps: Don't leak host cpuData Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
4ed727a015
commit
51c02bd4f9
|
@ -1525,20 +1525,13 @@ virQEMUCapsHostCPUDataCopy(virQEMUCapsHostCPUDataPtr dst,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
virQEMUCapsHostCPUDataClearModels(virQEMUCapsHostCPUDataPtr cpuData)
|
|
||||||
{
|
|
||||||
virCPUDefFree(cpuData->reported);
|
|
||||||
virCPUDefFree(cpuData->migratable);
|
|
||||||
virCPUDefFree(cpuData->full);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
virQEMUCapsHostCPUDataClear(virQEMUCapsHostCPUDataPtr cpuData)
|
virQEMUCapsHostCPUDataClear(virQEMUCapsHostCPUDataPtr cpuData)
|
||||||
{
|
{
|
||||||
qemuMonitorCPUModelInfoFree(cpuData->info);
|
qemuMonitorCPUModelInfoFree(cpuData->info);
|
||||||
virQEMUCapsHostCPUDataClearModels(cpuData);
|
virCPUDefFree(cpuData->reported);
|
||||||
|
virCPUDefFree(cpuData->migratable);
|
||||||
|
virCPUDefFree(cpuData->full);
|
||||||
|
|
||||||
memset(cpuData, 0, sizeof(*cpuData));
|
memset(cpuData, 0, sizeof(*cpuData));
|
||||||
}
|
}
|
||||||
|
@ -2981,20 +2974,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
|
void
|
||||||
virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
|
virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
|
||||||
virArch hostArch,
|
virArch hostArch,
|
||||||
|
|
|
@ -56,11 +56,6 @@ void
|
||||||
virQEMUCapsSetArch(virQEMUCapsPtr qemuCaps,
|
virQEMUCapsSetArch(virQEMUCapsPtr qemuCaps,
|
||||||
virArch arch);
|
virArch arch);
|
||||||
|
|
||||||
void
|
|
||||||
virQEMUCapsFreeHostCPUModel(virQEMUCapsPtr qemuCaps,
|
|
||||||
virArch hostArch,
|
|
||||||
virDomainVirtType type);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
|
virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
|
||||||
virArch hostArch,
|
virArch hostArch,
|
||||||
|
|
|
@ -418,11 +418,6 @@ testUpdateQEMUCaps(const struct testInfo *info,
|
||||||
!!(info->flags & FLAG_SKIP_LEGACY_CPUS)) < 0)
|
!!(info->flags & FLAG_SKIP_LEGACY_CPUS)) < 0)
|
||||||
goto cleanup;
|
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,
|
virQEMUCapsInitHostCPUModel(info->qemuCaps, caps->host.arch,
|
||||||
VIR_DOMAIN_VIRT_KVM);
|
VIR_DOMAIN_VIRT_KVM);
|
||||||
virQEMUCapsInitHostCPUModel(info->qemuCaps, caps->host.arch,
|
virQEMUCapsInitHostCPUModel(info->qemuCaps, caps->host.arch,
|
||||||
|
|
Loading…
Reference in New Issue