deviceFD implements vfs.FileDescriptionImpl for /dev/vfio/vfio. +stateify savable
| 42 | // |
| 43 | // +stateify savable |
| 44 | type vfioFD struct { |
| 45 | vfsfd vfs.FileDescription |
| 46 | vfs.FileDescriptionDefaultImpl |
| 47 | vfs.DentryMetadataFileDescriptionImpl |
| 48 | vfs.NoLockFD |
| 49 | memmap.MappableNoTrackMappings |
| 50 | |
| 51 | // If hostFD is -1, this file descriptor has been restored from a save state, |
| 52 | // and should be treated as invalid. Any operations on this file descriptor |
| 53 | // will effectively be a no-op. |
| 54 | hostFD int32 |
| 55 | |
| 56 | device *vfioDevice |
| 57 | queue waiter.Queue |
| 58 | memmapFile fsutil.MmapNoInternalFile |
| 59 | |
| 60 | mu sync.Mutex `state:"nosave"` |
| 61 | // +checklocks:mu |
| 62 | devAddrSet DevAddrSet `state:"nosave"` |
| 63 | } |
| 64 | |
| 65 | func (fd *vfioFD) isRestored() bool { |
| 66 | return fd.hostFD == -1 |
nothing calls this directly
no outgoing calls
no test coverage detected