The NCR53C90 is the built-in SCSI controller on all sparc machine types,
but not sparc64. Note that it has the fixed alias "scsi", which differs
from our normal naming convention of "scsi0".
The DC390 and AM53C974 are PCI SCSI controllers that can be added to any
PCI machine.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_alias.c | 6 ++++++
src/qemu/qemu_command.c | 18 +++++++++++++---
src/qemu/qemu_domain_address.c | 7 +++++++
src/qemu/qemu_validate.c | 38 ++++++++++++++++++++++++++++++----
4 files changed, 62 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c
index 101ab5608f..dcb6c7156d 100644
--- a/src/qemu/qemu_alias.c
+++ b/src/qemu/qemu_alias.c
@@ -176,6 +176,12 @@ qemuAssignDeviceControllerAlias(virDomainDefPtr domainDef,
controller->info.alias = g_strdup("usb");
return 0;
}
+ } else if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI) {
+ if (controller->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90 &&
+ controller->idx == 0) {
+ controller->info.alias = g_strdup("scsi");
+ return 0;
+ }
}
/* all other controllers use the default ${type}${index} naming
* scheme for alias/id.
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index d3de13c6ee..fbaacb8dd8 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2471,11 +2471,15 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VMPVSCSI:
virBufferAddLit(&buf, "pvscsi");
break;
+ case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AM53C974:
+ virBufferAddLit(&buf, "am53c974");
+ break;
+ case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DC390:
+ virBufferAddLit(&buf, "dc-390");
+ break;
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AUTO:
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_BUSLOGIC:
- case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90:
- case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DC390:
- case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AM53C974:
+ case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90: /* It is built-in dev */
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported controller model: %s"),
virDomainControllerModelSCSITypeToString(def->model));
@@ -2713,6 +2717,14 @@ qemuBuildSkipController(const virDomainControllerDef *controller,
controller->idx == 0 && qemuDomainHasBuiltinIDE(def))
return true;
+ /* first ESP SCSI controller is implicit on certain machine types */
+ if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI &&
+ controller->idx == 0 &&
+ controller->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90 &&
+ qemuDomainHasBuiltinESP(def)) {
+ return true;
+ }
+
return false;
}
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index f1fb532f39..2788dc7fb3 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -64,6 +64,8 @@ qemuDomainGetSCSIControllerModel(const virDomainDef *def,
return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC;
else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_SCSI))
return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI;
+ else if (qemuDomainHasBuiltinESP(def))
+ return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90;
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to determine model for SCSI controller idx=%d"),
@@ -2249,6 +2251,11 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
cont->idx == 0)
continue;
+ /* NCR53C90 SCSI controller is always a built-in device */
+ if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI &&
+ cont->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90)
+ continue;
+
if (!virDeviceInfoPCIAddressIsWanted(&cont->info))
continue;
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 2cd9ee8230..96636d1cff 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -2998,13 +2998,31 @@ qemuValidateCheckSCSIControllerModel(virQEMUCapsPtr qemuCaps,
break;
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AUTO:
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_BUSLOGIC:
- case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90:
- case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DC390:
- case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AM53C974:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported controller model: %s"),
virDomainControllerModelSCSITypeToString(model));
return false;
+ case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90:
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_NCR53C90)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("This QEMU doesn't support "
+ "the NCR53C90 (ESP) controller"));
+ }
+ return true;
+ case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DC390:
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_DC390)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("This QEMU doesn't support "
+ "the DC390 (ESP) controller"));
+ }
+ return true;
+ case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AM53C974:
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_AM53C974)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("This QEMU doesn't support "
+ "the AM53C974 (ESP) controller"));
+ }
+ return true;
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DEFAULT:
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -3112,6 +3130,19 @@ qemuValidateDomainDeviceDefControllerSCSI(const
virDomainControllerDef *controll
return -1;
break;
+ case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90:
+ if (controller->idx != 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("ncr53c90 can only be used as first SCSI
controller"));
+ return -1;
+ }
+ if (!qemuDomainHasBuiltinESP(def)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("ncr53c90 SCSI controller is not a built-in for
this machine"));
+ return -1;
+ }
+ break;
+
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AUTO:
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_BUSLOGIC:
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC:
@@ -3119,7 +3150,6 @@ qemuValidateDomainDeviceDefControllerSCSI(const
virDomainControllerDef *controll
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VMPVSCSI:
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI:
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1078:
- case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90:
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DC390:
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AM53C974:
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DEFAULT:
--
2.28.0