Plumb restore context to afterLoad()

This allows for external information to be passed to restore code, like
host FDs to be remapped.

Updates #1956

PiperOrigin-RevId: 612540749
This commit is contained in:
Fabricio Voznika
2024-03-04 12:21:50 -08:00
committed by gVisor bot
parent c6b06ab1a5
commit c087777e37
46 changed files with 214 additions and 155 deletions
+3 -1
View File
@@ -15,11 +15,13 @@
package netstack
import (
"context"
"gvisor.dev/gvisor/pkg/tcpip/stack"
)
// afterLoad is invoked by stateify.
func (s *Stack) afterLoad() {
func (s *Stack) afterLoad(context.Context) {
s.Stack = stack.StackFromEnv // FIXME(b/36201077)
if s.Stack == nil {
panic("can't restore without netstack/tcpip/stack.Stack")