mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 15:15:25 +00:00
qemu: Introduce virQEMUCapsSetHostModel
A simple helper as a complement to virQEMUCapsGetHostModel. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
4d80317655
commit
bffc3b9fe5
@ -2455,6 +2455,18 @@ virQEMUCapsGetHostModel(virQEMUCapsPtr qemuCaps,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
virQEMUCapsSetHostModel(virQEMUCapsPtr qemuCaps,
|
||||
virDomainVirtType type,
|
||||
virCPUDefPtr cpu)
|
||||
{
|
||||
if (type == VIR_DOMAIN_VIRT_KVM)
|
||||
qemuCaps->kvmCPUModel = cpu;
|
||||
else
|
||||
qemuCaps->tcgCPUModel = cpu;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps,
|
||||
virCapsPtr caps,
|
||||
@ -3336,10 +3348,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (type == VIR_DOMAIN_VIRT_KVM)
|
||||
qemuCaps->kvmCPUModel = cpu;
|
||||
else
|
||||
qemuCaps->tcgCPUModel = cpu;
|
||||
virQEMUCapsSetHostModel(qemuCaps, type, cpu);
|
||||
|
||||
cleanup:
|
||||
virCPUDefFree(hostCPU);
|
||||
|
Loading…
Reference in New Issue
Block a user