mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-26 15:45:28 +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
|
bool
|
||||||
virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps,
|
virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps,
|
||||||
virCapsPtr caps,
|
virCapsPtr caps,
|
||||||
@ -3336,10 +3348,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == VIR_DOMAIN_VIRT_KVM)
|
virQEMUCapsSetHostModel(qemuCaps, type, cpu);
|
||||||
qemuCaps->kvmCPUModel = cpu;
|
|
||||||
else
|
|
||||||
qemuCaps->tcgCPUModel = cpu;
|
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virCPUDefFree(hostCPU);
|
virCPUDefFree(hostCPU);
|
||||||
|
Loading…
Reference in New Issue
Block a user