}
-static bool
+bool
virQEMUCapsIsMachineSupported(virQEMUCapsPtr qemuCaps,
virDomainVirtType virtType,
const char *canonical_machine)
const char *virQEMUCapsGetCanonicalMachine(virQEMUCapsPtr qemuCaps,
virDomainVirtType virtType,
const char *name);
+bool virQEMUCapsIsMachineSupported(virQEMUCapsPtr qemuCaps,
+ virDomainVirtType virtType,
+ const char *canonical_machine)
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
int virQEMUCapsGetMachineMaxCpus(virQEMUCapsPtr qemuCaps,
virDomainVirtType virtType,
const char *name);
goto cleanup;
}
+ if (qemuCaps &&
+ !virQEMUCapsIsMachineSupported(qemuCaps, def->virtType, def->os.machine)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Emulator '%s' does not support machine type '%s'"),
+ def->emulator, def->os.machine);
+ goto cleanup;
+ }
+
if (def->mem.min_guarantee) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Parameter 'min_guarantee' not supported by QEMU."));