mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
qemu: enable support for ESP SCSI controller family
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@redhat.com>
This commit is contained in:
parent
98caef4a55
commit
d2d737551a
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -2953,13 +2953,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,
|
||||
@ -3067,6 +3085,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:
|
||||
@ -3074,7 +3105,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:
|
||||
|
Loading…
Reference in New Issue
Block a user