mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Implmenet ioctl command VFIO_DEVICE_RESET.
PiperOrigin-RevId: 618077589
This commit is contained in:
@@ -106,6 +106,7 @@ var (
|
||||
VFIO_DEVICE_GET_REGION_INFO = IO(VFIO_TYPE, VFIO_BASE+8)
|
||||
VFIO_DEVICE_GET_IRQ_INFO = IO(VFIO_TYPE, VFIO_BASE+9)
|
||||
VFIO_DEVICE_SET_IRQS = IO(VFIO_TYPE, VFIO_BASE+10)
|
||||
VFIO_DEVICE_RESET = IO(VFIO_TYPE, VFIO_BASE+11)
|
||||
)
|
||||
|
||||
// VFIODeviceInfo is analogous to vfio_device_info
|
||||
|
||||
@@ -242,6 +242,9 @@ func (fd *pciDeviceFD) Ioctl(ctx context.Context, uio usermem.IO, sysno uintptr,
|
||||
return fd.vfioIrqInfo(ctx, t, args[2].Pointer())
|
||||
case linux.VFIO_DEVICE_SET_IRQS:
|
||||
return fd.vfioSetIrqs(ctx, t, args[2].Pointer())
|
||||
case linux.VFIO_DEVICE_RESET:
|
||||
// VFIO_DEVICE_RESET is just a simple IOCTL command that carries no data.
|
||||
return IOCTLInvoke[uint32, uintptr](fd.hostFD, linux.VFIO_DEVICE_RESET, 0)
|
||||
}
|
||||
return 0, linuxerr.ENOSYS
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user