checkpoint: call Prestart hooks on restore before restoring processes
Docker uses Prestart hooks to call a libnetwork hook to create network devices and set addesses and routes. Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
46c25be297
commit
b8121e8998
|
@ -934,6 +934,20 @@ func (c *linuxContainer) criuNotifications(resp *criurpc.CriuResp, process *Proc
|
||||||
if err := lockNetwork(c.config); err != nil {
|
if err := lockNetwork(c.config); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
case notify.GetScript() == "setup-namespaces":
|
||||||
|
if c.config.Hooks != nil {
|
||||||
|
s := configs.HookState{
|
||||||
|
Version: c.config.Version,
|
||||||
|
ID: c.id,
|
||||||
|
Pid: int(notify.GetPid()),
|
||||||
|
Root: c.config.Rootfs,
|
||||||
|
}
|
||||||
|
for _, hook := range c.config.Hooks.Prestart {
|
||||||
|
if err := hook.Run(s); err != nil {
|
||||||
|
return newSystemError(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
case notify.GetScript() == "post-restore":
|
case notify.GetScript() == "post-restore":
|
||||||
pid := notify.GetPid()
|
pid := notify.GetPid()
|
||||||
r, err := newRestoredProcess(int(pid), fds)
|
r, err := newRestoredProcess(int(pid), fds)
|
||||||
|
|
Loading…
Reference in New Issue