vsphere/internal/virtualdevice/virtual_machine_device_subresource.go
func controllerTypeToClass(c types.BaseVirtualController) (string, error) {
	var t string
	switch c.(type) {
	case *types.VirtualIDEController:
		t = SubresourceControllerTypeIDE
	case *types.VirtualAHCIController:
		t = SubresourceControllerTypeSATA
	case *types.VirtualPCIController:
		t = SubresourceControllerTypePCI
	case *types.ParaVirtualSCSIController, *types.VirtualBusLogicController,
		*types.VirtualLsiLogicController, *types.VirtualLsiLogicSASController:
		t = SubresourceControllerTypeSCSI
	default:
		return subresourceControllerTypeUnknown, fmt.Errorf("unsupported controller type %T", c)
	}
	return t, nil
}
func controllerTypeToClass(c types.BaseVirtualController) (string, error) {
	var t string
	switch c.(type) {
	case *types.VirtualIDEController:
		t = SubresourceControllerTypeIDE
	case *types.VirtualAHCIController:
		t = SubresourceControllerTypeSATA
	case *types.VirtualPCIController:
		t = SubresourceControllerTypePCI
	case *types.ParaVirtualSCSIController, *types.VirtualBusLogicController,
		*types.VirtualLsiLogicController, *types.VirtualLsiLogicSASController:
		t = SubresourceControllerTypeSCSI
	default:
		return subresourceControllerTypeUnknown, fmt.Errorf("unsupported controller type %T", c)
	}
	return t, nil
}
func controllerTypeToClass ( c types . BaseVirtualController ) ( string , error ) { var t string switch c . ( type ) { case * types . VirtualIDEController : t = SubresourceControllerTypeIDE case * types . VirtualAHCIController : t = SubresourceControllerTypeSATA case * types . VirtualPCIController : t = SubresourceControllerTypePCI case * types . ParaVirtualSCSIController , * types . VirtualBusLogicController , * types . VirtualLsiLogicController , * types . VirtualLsiLogicSASController : t = SubresourceControllerTypeSCSI default : return subresourceControllerTypeUnknown , fmt . Errorf ( " " , c ) } return t , nil }
// controllerTypeToClass converts a controller type to a specific short-form
// controller class, namely for use with working with IDs.
controllerTypeToClass converts a controller type to a specific short - form controller class namely for use with working with IDs .