Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/qemu/qemu_domain.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 97336d5002..7475fb4f39 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4123,16 +4123,26 @@ qemuDomainDefaultSCSIControllerModel(const virDomainDef *def,
const virDomainControllerDef *cont,
virQEMUCaps *qemuCaps)
{
+ /* For machine types with built-in SCSI controllers, the choice
+ * of model is obvious */
+ if (qemuDomainHasBuiltinESP(def))
+ return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90;
+
+ /* pSeries has its own special default */
if (qemuDomainIsPSeries(def))
return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI;
+
+ /* Most new architectures should ideally use virtio */
if (ARCH_IS_S390(def->os.arch))
return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI;
+
+ /* If there is no preference, base the choice on device
+ * availability. lsilogic is favored for backwards compatibility
+ * reasons */
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_LSI))
return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC;
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_SCSI))
return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI;
- if (qemuDomainHasBuiltinESP(def))
- return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90;
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to determine model for SCSI controller
idx=%1$d"),
--
2.43.0