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>
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,
void
virQEMUCapsStripMachineAliases(virQEMUCapsPtr qemuCaps);
+bool
+virQEMUCapsHasMachines(virQEMUCapsPtr qemuCaps);
+
void
virQEMUCapsAddMachine(virQEMUCapsPtr qemuCaps,
virDomainVirtType virtType,