// Attach for physical endpoint binds the physical network interface to
// vfio-pci and adds device to the hypervisor with vfio-passthrough.
Attach for physical endpoint binds the physical network interface to
vfio-pci and adds device to the hypervisor with vfio-passthrough.
// Attach for physical endpoint binds the physical network interface to // vfio - pci and adds device to the hypervisor with vfio - passthrough .
func (endpoint *PhysicalEndpoint) Attach(h hypervisor) error {
	if err := bindNICToVFIO(endpoint); err != nil {
		return err
	}
	var vendorID, deviceID string
	if splits := strings.Split(endpoint.VendorDeviceID, " "); len(splits) == 2 {
		vendorID = splits[0]
		deviceID = splits[1]
	}
	d := config.VFIODev{
		BDF:      endpoint.BDF,
		VendorID: vendorID,
		DeviceID: deviceID,
	}
	return h.addDevice(d, vfioDev)
}
func ( endpoint * PhysicalEndpoint ) Attach ( h hypervisor ) error { if err := bindNICToVFIO ( endpoint ) ; err != nil { return err } var vendorID , deviceID string if splits := strings . Split ( endpoint . VendorDeviceID , " " ) ; len ( splits ) == 2 { vendorID = splits [ 0 ] deviceID = splits [ 1 ] } d := config . VFIODev { BDF : endpoint . BDF , VendorID : vendorID , DeviceID : deviceID , } return h . addDevice ( d , vfioDev ) }
Attach for physical endpoint binds the physical network interface to
vfio-pci and adds device to the hypervisor with vfio-passthrough.
Attach for physical endpoint binds the physical network interface to vfio - pci and adds device to the hypervisor with vfio - passthrough .
// Unbind physical interface from host driver and bind to vfio // so that it can be passed to qemu. // TODO: use device manager as general device management entrance