提交 60b580b9 编写于 作者: P Peter Krempa

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: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 3b8feb47
...@@ -2641,6 +2641,22 @@ virQEMUCapsAddMachine(virQEMUCapsPtr qemuCaps, ...@@ -2641,6 +2641,22 @@ virQEMUCapsAddMachine(virQEMUCapsPtr qemuCaps,
mach->qemuDefault = isDefault; 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 static int
virQEMUCapsProbeQMPMachineTypes(virQEMUCapsPtr qemuCaps, virQEMUCapsProbeQMPMachineTypes(virQEMUCapsPtr qemuCaps,
virDomainVirtType virtType, virDomainVirtType virtType,
......
...@@ -108,6 +108,9 @@ virQEMUCapsSetMicrocodeVersion(virQEMUCapsPtr qemuCaps, ...@@ -108,6 +108,9 @@ virQEMUCapsSetMicrocodeVersion(virQEMUCapsPtr qemuCaps,
void void
virQEMUCapsStripMachineAliases(virQEMUCapsPtr qemuCaps); virQEMUCapsStripMachineAliases(virQEMUCapsPtr qemuCaps);
bool
virQEMUCapsHasMachines(virQEMUCapsPtr qemuCaps);
void void
virQEMUCapsAddMachine(virQEMUCapsPtr qemuCaps, virQEMUCapsAddMachine(virQEMUCapsPtr qemuCaps,
virDomainVirtType virtType, virDomainVirtType virtType,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册