@@ -620,62 +620,6 @@ func validateID(id string) error {
620
620
return nil
621
621
}
622
622
623
- func (container * Container ) Checkpoint (opts * runconfig.CriuConfig ) error {
624
- if err := container .daemon .Checkpoint (container , opts ); err != nil {
625
- return err
626
- }
627
-
628
- if opts .LeaveRunning == false {
629
- container .ReleaseNetwork ()
630
- }
631
- return nil
632
- }
633
-
634
- func (container * Container ) Restore (opts * runconfig.CriuConfig , forceRestore bool ) error {
635
- var err error
636
- container .Lock ()
637
- defer container .Unlock ()
638
-
639
- defer func () {
640
- if err != nil {
641
- container .setError (err )
642
- // if no one else has set it, make sure we don't leave it at zero
643
- if container .ExitCode == 0 {
644
- container .ExitCode = 128
645
- }
646
- container .toDisk ()
647
- container .cleanup ()
648
- }
649
- }()
650
-
651
- if err := container .Mount (); err != nil {
652
- return err
653
- }
654
- if err = container .initializeNetworking (true ); err != nil {
655
- return err
656
- }
657
- linkedEnv , err := container .setupLinkedContainers ()
658
- if err != nil {
659
- return err
660
- }
661
- if err = container .setupWorkingDirectory (); err != nil {
662
- return err
663
- }
664
-
665
- env := container .createDaemonEnvironment (linkedEnv )
666
- if err = populateCommand (container , env ); err != nil {
667
- return err
668
- }
669
-
670
- mounts , err := container .setupMounts ()
671
- if err != nil {
672
- return err
673
- }
674
-
675
- container .command .Mounts = mounts
676
- return container .waitForRestore (opts , forceRestore )
677
- }
678
-
679
623
func (container * Container ) Copy (resource string ) (io.ReadCloser , error ) {
680
624
container .Lock ()
681
625
defer container .Unlock ()
@@ -845,26 +789,6 @@ func (container *Container) waitForStart() error {
845
789
return nil
846
790
}
847
791
848
- func (container * Container ) waitForRestore (opts * runconfig.CriuConfig , forceRestore bool ) error {
849
- container .monitor = newContainerMonitor (container , container .hostConfig .RestartPolicy )
850
-
851
- // After calling promise.Go() we'll have two goroutines:
852
- // - The current goroutine that will block in the select
853
- // below until restore is done.
854
- // - A new goroutine that will restore the container and
855
- // wait for it to exit.
856
- select {
857
- case <- container .monitor .restoreSignal :
858
- if container .ExitCode != 0 {
859
- return fmt .Errorf ("restore process failed" )
860
- }
861
- case err := <- promise .Go (func () error { return container .monitor .Restore (opts , forceRestore ) }):
862
- return err
863
- }
864
-
865
- return nil
866
- }
867
-
868
792
func (container * Container ) GetProcessLabel () string {
869
793
// even if we have a process label return "" if we are running
870
794
// in privileged mode
0 commit comments