code: func (l VirtualDeviceList) SelectByBackingInfo(backing types.BaseVirtualDeviceBackingInfo) VirtualDeviceList {
  	t := reflect.TypeOf(backing)
  
  	return l.Select(func(device types.BaseVirtualDevice) bool {
  		db := device.GetVirtualDevice().Backing
  		if db == nil {
  			return false
  		}
  
  		if reflect.TypeOf(db) != t {
  			return false
  		}
  
  		if reflect.ValueOf(backing).IsNil() {
  			// selecting by backing type
  			return true
  		}
  
  		switch a := db.(type) {
  		case *types.VirtualEthernetCardNetworkBackingInfo:
  			b := backing.(*types.VirtualEthernetCardNetworkBackingInfo)
  			return a.DeviceName == b.DeviceName
  		case *types.VirtualEthernetCardDistributedVirtualPortBackingInfo:
  			b := backing.(*types.VirtualEthernetCardDistributedVirtualPortBackingInfo)
  			return a.Port.SwitchUuid == b.Port.SwitchUuid &&
  				a.Port.PortgroupKey == b.Port.PortgroupKey
  		case *types.VirtualDiskFlatVer2BackingInfo:
  			b := backing.(*types.VirtualDiskFlatVer2BackingInfo)
  			if a.Parent != nil && b.Parent != nil {
  				return a.Parent.FileName == b.Parent.FileName
  			}
  			return a.FileName == b.FileName
  		case *types.VirtualSerialPortURIBackingInfo:
  			b := backing.(*types.VirtualSerialPortURIBackingInfo)
  			return a.ServiceURI == b.ServiceURI
  		case types.BaseVirtualDeviceFileBackingInfo:
  			b := backing.(types.BaseVirtualDeviceFileBackingInfo)
  			return a.GetVirtualDeviceFileBackingInfo().FileName == b.GetVirtualDeviceFileBackingInfo().FileName
  		default:
  			return false
  		}
  	})
  }
docs: // SelectByBackingInfo returns a new list with devices matching the given backing info.
  // If the value of backing is nil, any device with a backing of the same type will be returned.