summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@google.com>2021-06-17 13:59:51 -0700
committergVisor bot <gvisor-bot@google.com>2021-06-17 14:02:05 -0700
commit3cf1644a3b4266979b7dda8b6291edf19264fa19 (patch)
tree3b8d0ff887cb953409618b1e4b4d41342520e15c /runsc/boot
parent0f5c1f5eafb2cc67a9148bdf346b6083e5a8480c (diff)
Move tcpip.Clock impl to Timekeeper
...and pass it explicitly. This reverts commit b63e61828d0652ad1769db342c17a3529d2d24ed. PiperOrigin-RevId: 380039167
Diffstat (limited to 'runsc/boot')
-rw-r--r--runsc/boot/controller.go2
-rw-r--r--runsc/boot/loader.go9
2 files changed, 4 insertions, 7 deletions
diff --git a/runsc/boot/controller.go b/runsc/boot/controller.go
index 9b270cbf2..d52cf5a00 100644
--- a/runsc/boot/controller.go
+++ b/runsc/boot/controller.go
@@ -439,7 +439,7 @@ func (cm *containerManager) Restore(o *RestoreOpts, _ *struct{}) error {
// Load the state.
loadOpts := state.LoadOpts{Source: specFile}
- if err := loadOpts.Load(ctx, k, networkStack, time.NewCalibratedClocks(), &vfs.CompleteRestoreOptions{}); err != nil {
+ if err := loadOpts.Load(ctx, k, nil, networkStack, time.NewCalibratedClocks(), &vfs.CompleteRestoreOptions{}); err != nil {
return err
}
diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go
index ad4d50008..8d71d7447 100644
--- a/runsc/boot/loader.go
+++ b/runsc/boot/loader.go
@@ -278,19 +278,15 @@ func New(args Args) (*Loader, error) {
}
// Create timekeeper.
- tk, err := kernel.NewTimekeeper(k, vdso.ParamPage.FileRange())
- if err != nil {
- return nil, fmt.Errorf("creating timekeeper: %w", err)
- }
+ tk := kernel.NewTimekeeper(k, vdso.ParamPage.FileRange())
tk.SetClocks(time.NewCalibratedClocks())
- k.SetTimekeeper(tk)
if err := enableStrace(args.Conf); err != nil {
return nil, fmt.Errorf("enabling strace: %w", err)
}
// Create root network namespace/stack.
- netns, err := newRootNetworkNamespace(args.Conf, k, k)
+ netns, err := newRootNetworkNamespace(args.Conf, tk, k)
if err != nil {
return nil, fmt.Errorf("creating network: %w", err)
}
@@ -332,6 +328,7 @@ func New(args Args) (*Loader, error) {
// to createVFS in order to mount (among other things) procfs.
if err = k.Init(kernel.InitKernelArgs{
FeatureSet: cpuid.HostFeatureSet(),
+ Timekeeper: tk,
RootUserNamespace: creds.UserNamespace,
RootNetworkNamespace: netns,
ApplicationCores: uint(args.NumCPU),