MCPcopy Index your code
hub / github.com/google/gvisor / AddDevGofer

Method AddDevGofer

pkg/sentry/kernel/kernel.go:2315–2328  ·  view source on GitHub ↗

AddDevGofer initializes the dev gofer connection and starts tracking it. It takes ownership of goferFD.

(contName string, goferFD int)

Source from the content-addressed store, hash-verified

2313// AddDevGofer initializes the dev gofer connection and starts tracking it.
2314// It takes ownership of goferFD.
2315func (k *Kernel) AddDevGofer(contName string, goferFD int) error {
2316 client, err := devutil.NewGoferClient(k.SupervisorContext(), contName, goferFD)
2317 if err != nil {
2318 return err
2319 }
2320
2321 k.devGofersMu.Lock()
2322 defer k.devGofersMu.Unlock()
2323 if k.devGofers == nil {
2324 k.devGofers = make(map[string]*devutil.GoferClient)
2325 }
2326 k.devGofers[contName] = client
2327 return nil
2328}
2329
2330// RemoveDevGofer closes the dev gofer connection, if one exists, and stops
2331// tracking it.

Callers 1

prepareMountsMethod · 0.80

Calls 4

SupervisorContextMethod · 0.95
NewGoferClientFunction · 0.92
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected