diff options
author | Tamir Duberstein <tamird@google.com> | 2021-06-17 13:59:51 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-06-17 14:02:05 -0700 |
commit | 3cf1644a3b4266979b7dda8b6291edf19264fa19 (patch) | |
tree | 3b8d0ff887cb953409618b1e4b4d41342520e15c /pkg/sentry/fsimpl/testutil | |
parent | 0f5c1f5eafb2cc67a9148bdf346b6083e5a8480c (diff) |
Move tcpip.Clock impl to Timekeeper
...and pass it explicitly.
This reverts commit b63e61828d0652ad1769db342c17a3529d2d24ed.
PiperOrigin-RevId: 380039167
Diffstat (limited to 'pkg/sentry/fsimpl/testutil')
-rw-r--r-- | pkg/sentry/fsimpl/testutil/kernel.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/pkg/sentry/fsimpl/testutil/kernel.go b/pkg/sentry/fsimpl/testutil/kernel.go index 97aa20cd1..473b41cff 100644 --- a/pkg/sentry/fsimpl/testutil/kernel.go +++ b/pkg/sentry/fsimpl/testutil/kernel.go @@ -80,12 +80,8 @@ func Boot() (*kernel.Kernel, error) { } // Create timekeeper. - tk, err := kernel.NewTimekeeper(k, vdso.ParamPage.FileRange()) - if err != nil { - return nil, fmt.Errorf("creating timekeeper: %v", err) - } + tk := kernel.NewTimekeeper(k, vdso.ParamPage.FileRange()) tk.SetClocks(time.NewCalibratedClocks()) - k.SetTimekeeper(tk) creds := auth.NewRootCredentials(auth.NewRootUserNamespace()) @@ -94,6 +90,7 @@ func Boot() (*kernel.Kernel, error) { if err = k.Init(kernel.InitKernelArgs{ ApplicationCores: uint(runtime.GOMAXPROCS(-1)), FeatureSet: cpuid.HostFeatureSet(), + Timekeeper: tk, RootUserNamespace: creds.UserNamespace, Vdso: vdso, RootUTSNamespace: kernel.NewUTSNamespace("hostname", "domain", creds.UserNamespace), |