@@ -42,7 +42,6 @@ import (
4242 "gvisor.dev/gvisor/pkg/sentry/fsimpl/erofs"
4343 "gvisor.dev/gvisor/pkg/sentry/kernel"
4444 "gvisor.dev/gvisor/pkg/sentry/kernel/auth"
45- "gvisor.dev/gvisor/pkg/sentry/pgalloc"
4645 "gvisor.dev/gvisor/pkg/sentry/platform"
4746 "gvisor.dev/gvisor/pkg/state/statefile"
4847 "gvisor.dev/gvisor/pkg/sync"
@@ -51,6 +50,7 @@ import (
5150 "gvisor.dev/gvisor/runsc/cgroup"
5251 "gvisor.dev/gvisor/runsc/config"
5352 "gvisor.dev/gvisor/runsc/flag"
53+ "gvisor.dev/gvisor/runsc/sandbox"
5454 "gvisor.dev/gvisor/runsc/specutils"
5555)
5656
@@ -1063,7 +1063,7 @@ func testCheckpointRestore(t *testing.T, conf *config.Config, compression statef
10631063 }
10641064
10651065 // Checkpoint running container; save state into new file.
1066- if err := cont .Checkpoint (dir , false /* direct */ , statefile. Options {Compression : compression }, pgalloc. SaveOpts { }); err != nil {
1066+ if err := cont .Checkpoint (dir , sandbox. CheckpointOpts {Compression : compression }); err != nil {
10671067 t .Fatalf ("error checkpointing container to empty file: %v" , err )
10681068 }
10691069
@@ -1267,7 +1267,7 @@ func TestCheckpointRestoreExecKilled(t *testing.T) {
12671267 }
12681268
12691269 // Checkpoint running container.
1270- if err := cont .Checkpoint (dir , false /* direct */ , statefile. Options {Compression : statefile .CompressionLevelFlateBestSpeed }, pgalloc. SaveOpts { }); err != nil {
1270+ if err := cont .Checkpoint (dir , sandbox. CheckpointOpts {Compression : statefile .CompressionLevelFlateBestSpeed }); err != nil {
12711271 t .Fatalf ("error checkpointing container: %v" , err )
12721272 }
12731273 cont .Destroy ()
@@ -1346,7 +1346,7 @@ func TestCheckpointRestoreCreateMountPoint(t *testing.T) {
13461346 }
13471347
13481348 // Checkpoint running container; save state into new file.
1349- if err := cont .Checkpoint (dir , false , statefile. Options {Compression : statefile .CompressionLevelDefault }, pgalloc. SaveOpts { }); err != nil {
1349+ if err := cont .Checkpoint (dir , sandbox. CheckpointOpts {Compression : statefile .CompressionLevelDefault }); err != nil {
13501350 t .Fatalf ("error checkpointing container to file: %v" , err )
13511351 }
13521352
@@ -1445,7 +1445,7 @@ func TestUnixDomainSockets(t *testing.T) {
14451445 }
14461446
14471447 // Checkpoint running container; save state into new file.
1448- if err := cont .Checkpoint (dir , false /* direct */ , statefile. Options {Compression : statefile .CompressionLevelDefault }, pgalloc. SaveOpts { }); err != nil {
1448+ if err := cont .Checkpoint (dir , sandbox. CheckpointOpts {Compression : statefile .CompressionLevelDefault }); err != nil {
14491449 t .Fatalf ("error checkpointing container to empty file: %v" , err )
14501450 }
14511451
@@ -2829,7 +2829,7 @@ func TestUsageFD(t *testing.T) {
28292829 }
28302830
28312831 // Checkpoint running container.
2832- if err := cont .Checkpoint (dir , false /* direct */ , statefile. Options {Compression : statefile .CompressionLevelDefault }, pgalloc. SaveOpts { }); err != nil {
2832+ if err := cont .Checkpoint (dir , sandbox. CheckpointOpts {Compression : statefile .CompressionLevelDefault }); err != nil {
28332833 t .Fatalf ("error checkpointing container: %v" , err )
28342834 }
28352835 cont .Destroy ()
@@ -3954,7 +3954,7 @@ func TestSpecValidation(t *testing.T) {
39543954 t .Fatalf ("error chmoding file: %q, %v" , dir , err )
39553955 }
39563956 // Checkpoint running container; save state into new file.
3957- if err := cont .Checkpoint (dir , false /* direct */ , statefile. Options {Compression : statefile .CompressionLevelFlateBestSpeed }, pgalloc. SaveOpts { }); err != nil {
3957+ if err := cont .Checkpoint (dir , sandbox. CheckpointOpts {Compression : statefile .CompressionLevelFlateBestSpeed }); err != nil {
39583958 t .Fatalf ("error checkpointing container to empty file: %v" , err )
39593959 }
39603960
@@ -4148,11 +4148,8 @@ func TestCheckpointResume(t *testing.T) {
41484148 t .Fatalf ("Failed to wait for output file: %v" , err )
41494149 }
41504150
4151- sfOpts := statefile.Options {
4152- Resume : true ,
4153- }
41544151 // Checkpoint running container; save state into new file.
4155- if err := cont .Checkpoint (dir , false /* direct */ , sfOpts , pgalloc. SaveOpts { }); err != nil {
4152+ if err := cont .Checkpoint (dir , sandbox. CheckpointOpts { Resume : true }); err != nil {
41564153 t .Fatalf ("error checkpointing container to empty file: %v" , err )
41574154 }
41584155
0 commit comments