MCPcopy
hub / github.com/google/gvisor / vfioFD

Struct vfioFD

pkg/sentry/devices/tpuproxy/vfio/vfio_fd.go:44–63  ·  view source on GitHub ↗

deviceFD implements vfs.FileDescriptionImpl for /dev/vfio/vfio. +stateify savable

Source from the content-addressed store, hash-verified

42//
43// +stateify savable
44type 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
65func (fd *vfioFD) isRestored() bool {
66 return fd.hostFD == -1

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected