The qemuValidateDomainDeviceDefControllerPCI() function is
called if PCI controllers are present in the domain
configuration, which shouldn't happen if the machine type
doesn't support PCI. If we somehow find ourselves in that
scenario, reporting an error would be the right thing to do.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
return -1;
}
+ if (!qemuDomainSupportsPCI(def)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Machine type '%1$s' does not support PCI"),
+ def->os.machine);
+ return -1;
+ }
+
/* modelName */
switch ((virDomainControllerModelPCI) cont->model) {
case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE: