mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 15:52:55 +00:00
qemu: Introduce virQEMUCapsHostCPUDataClear
To keep freeing of host CPU data in one place. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
8be4346ca5
commit
b0605e8487
@ -2142,6 +2142,21 @@ virQEMUCapsHostCPUDataCopy(virQEMUCapsPtr dst,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
virQEMUCapsHostCPUDataClear(virQEMUCapsPtr qemuCaps)
|
||||
{
|
||||
qemuMonitorCPUModelInfoFree(qemuCaps->kvmCPUModelInfo);
|
||||
qemuMonitorCPUModelInfoFree(qemuCaps->tcgCPUModelInfo);
|
||||
qemuCaps->kvmCPUModelInfo = NULL;
|
||||
qemuCaps->tcgCPUModelInfo = NULL;
|
||||
|
||||
virCPUDefFree(qemuCaps->kvmCPUModel);
|
||||
virCPUDefFree(qemuCaps->tcgCPUModel);
|
||||
qemuCaps->kvmCPUModel = NULL;
|
||||
qemuCaps->tcgCPUModel = NULL;
|
||||
}
|
||||
|
||||
|
||||
virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps)
|
||||
{
|
||||
virQEMUCapsPtr ret = virQEMUCapsNew();
|
||||
@ -2228,10 +2243,7 @@ void virQEMUCapsDispose(void *obj)
|
||||
|
||||
VIR_FREE(qemuCaps->gicCapabilities);
|
||||
|
||||
qemuMonitorCPUModelInfoFree(qemuCaps->kvmCPUModelInfo);
|
||||
qemuMonitorCPUModelInfoFree(qemuCaps->tcgCPUModelInfo);
|
||||
virCPUDefFree(qemuCaps->kvmCPUModel);
|
||||
virCPUDefFree(qemuCaps->tcgCPUModel);
|
||||
virQEMUCapsHostCPUDataClear(qemuCaps);
|
||||
}
|
||||
|
||||
void
|
||||
@ -4109,15 +4121,7 @@ virQEMUCapsReset(virQEMUCapsPtr qemuCaps)
|
||||
VIR_FREE(qemuCaps->gicCapabilities);
|
||||
qemuCaps->ngicCapabilities = 0;
|
||||
|
||||
qemuMonitorCPUModelInfoFree(qemuCaps->kvmCPUModelInfo);
|
||||
qemuMonitorCPUModelInfoFree(qemuCaps->tcgCPUModelInfo);
|
||||
qemuCaps->kvmCPUModelInfo = NULL;
|
||||
qemuCaps->tcgCPUModelInfo = NULL;
|
||||
|
||||
virCPUDefFree(qemuCaps->kvmCPUModel);
|
||||
virCPUDefFree(qemuCaps->tcgCPUModel);
|
||||
qemuCaps->kvmCPUModel = NULL;
|
||||
qemuCaps->tcgCPUModel = NULL;
|
||||
virQEMUCapsHostCPUDataClear(qemuCaps);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user