From 0f9ec81439c9f1758bb18e6fc3d4c0ae8b2933d7 Mon Sep 17 00:00:00 2001 From: Ayush Ranjan Date: Sat, 13 Jul 2024 03:21:52 -0700 Subject: [PATCH] Call Loader.kernelInitExtra() on restore (earlier called Loader.initDone()). The kernel init extra function was not being called on restore. PiperOrigin-RevId: 652026617 --- runsc/boot/loader.go | 2 +- runsc/boot/restore.go | 4 ++++ runsc/boot/restore_impl.go | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go index fe0760b33..c9d06500a 100644 --- a/runsc/boot/loader.go +++ b/runsc/boot/loader.go @@ -628,7 +628,7 @@ func New(args Args) (*Loader, error) { enableAutosave(l, args.Conf.TestOnlyAutosaveResume, l.saveFDs) } - if err := l.initDone(args); err != nil { + if err := l.kernelInitExtra(); err != nil { return nil, err } diff --git a/runsc/boot/restore.go b/runsc/boot/restore.go index 064f10450..3963f2360 100644 --- a/runsc/boot/restore.go +++ b/runsc/boot/restore.go @@ -276,6 +276,10 @@ func (r *restorer) restore(l *Loader) error { l.k.RestoreContainerMapping(l.containerIDs) + if err := l.kernelInitExtra(); err != nil { + return err + } + // Refresh the control server with the newly created kernel. l.ctrl.refreshHandlers() diff --git a/runsc/boot/restore_impl.go b/runsc/boot/restore_impl.go index b7436629f..5b1aa7e88 100644 --- a/runsc/boot/restore_impl.go +++ b/runsc/boot/restore_impl.go @@ -42,6 +42,6 @@ func newProcInternalData(*specs.Spec) *proc.InternalData { return &proc.InternalData{} } -func (l *Loader) initDone(args Args) error { +func (l *Loader) kernelInitExtra() error { return nil }