Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip SCSI controller check when empty #1179

Merged
merged 1 commit into from
Aug 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -694,18 +694,18 @@ func createSCSIController(l *object.VirtualDeviceList, ct string, st string) ([]
// depending on if all controllers are one specific kind or not. Only the first
// number of controllers specified by count are checked.
func ReadSCSIBusType(l object.VirtualDeviceList, count int) string {
ctlrs := make([]types.BaseVirtualSCSIController, count)
controllers := make([]types.BaseVirtualSCSIController, count)
for _, dev := range l {
if sc, ok := dev.(types.BaseVirtualSCSIController); ok && sc.GetVirtualSCSIController().BusNumber < int32(count) {
ctlrs[sc.GetVirtualSCSIController().BusNumber] = sc
controllers[sc.GetVirtualSCSIController().BusNumber] = sc
}
}
log.Printf("[DEBUG] ReadSCSIBusType: SCSI controller layout for first %d controllers: %s", count, scsiControllerListString(ctlrs))
if len(ctlrs) == 0 {
log.Printf("[DEBUG] ReadSCSIBusType: SCSI controller layout for first %d controllers: %s", count, scsiControllerListString(controllers))
if len(controllers) == 0 || controllers[0] == nil {
return subresourceControllerTypeUnknown
}
last := l.Type(ctlrs[0].(types.BaseVirtualDevice))
for _, ctlr := range ctlrs[1:] {
last := l.Type(controllers[0].(types.BaseVirtualDevice))
for _, ctlr := range controllers[1:] {
if ctlr == nil || l.Type(ctlr.(types.BaseVirtualDevice)) != last {
return subresourceControllerTypeMixed
}
Expand Down