mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
qemu: capabilities: Add accessor to qemu caps machine types presence
Test code will need to know whether the virQEMUCaps object contains any machine types already. Add a helper and expose it via 'qemu_capspriv.h'. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
3b8feb4793
commit
60b580b949
@ -2641,6 +2641,22 @@ virQEMUCapsAddMachine(virQEMUCapsPtr qemuCaps,
|
||||
mach->qemuDefault = isDefault;
|
||||
}
|
||||
|
||||
/**
|
||||
* virQEMUCapsHasMachines:
|
||||
* @qemuCaps: qemu capabilities object
|
||||
*
|
||||
* Returns true if @qemuCaps has at least one machine type defined. This is
|
||||
* called by the test suite to figure out whether to populate fake machine types
|
||||
* into the list.
|
||||
*/
|
||||
bool
|
||||
virQEMUCapsHasMachines(virQEMUCapsPtr qemuCaps)
|
||||
{
|
||||
|
||||
return !!qemuCaps->kvm.nmachineTypes || !!qemuCaps->tcg.nmachineTypes;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
virQEMUCapsProbeQMPMachineTypes(virQEMUCapsPtr qemuCaps,
|
||||
virDomainVirtType virtType,
|
||||
|
@ -108,6 +108,9 @@ virQEMUCapsSetMicrocodeVersion(virQEMUCapsPtr qemuCaps,
|
||||
void
|
||||
virQEMUCapsStripMachineAliases(virQEMUCapsPtr qemuCaps);
|
||||
|
||||
bool
|
||||
virQEMUCapsHasMachines(virQEMUCapsPtr qemuCaps);
|
||||
|
||||
void
|
||||
virQEMUCapsAddMachine(virQEMUCapsPtr qemuCaps,
|
||||
virDomainVirtType virtType,
|
||||
|
Loading…
x
Reference in New Issue
Block a user