{"action":"created","comment":{"url":"https://api.github.com/repos/docker/libcontainer/pulls/comments/27320056","id":27320056,"diff_hunk":"@@ -249,6 +257,124 @@ func (c *linuxContainer) NotifyOOM() (<-chan struct{}, error) {\n \treturn notifyOnOOM(c.cgroupManager.GetPaths())\n }\n \n+// XXX debug support, remove when debugging done.\n+func addArgsFromEnv(evar string, args *[]string) {\n+\tif e := os.Getenv(evar); e != \"\" {\n+\t\tfor _, f := range strings.Fields(e) {\n+\t\t\t*args = append(*args, f)\n+\t\t}\n+\t}\n+\tfmt.Printf(\">>> criu %v\\n\", *args)\n+}\n+\n+func (c *linuxContainer) Checkpoint() error {\n+\tc.m.Lock()\n+\tdefer c.m.Unlock()\n+\tdir := filepath.Join(c.root, \"checkpoint\")\n+\t// Since a container can be C/R'ed multiple times,\n+\t// the checkpoint directory may already exist.\n+\tif err := os.Mkdir(dir, 0655); err != nil && !os.IsExist(err) {\n+\t\treturn err\n+\t}\n+\targs := []string{\n+\t\t\"dump\", \"-v4\",\n+\t\t\"-D\", dir,\n+\t\t\"-o\", \"dump.log\",\n+\t\t\"--root\", c.config.Rootfs,\n+\t\t\"--manage-cgroups\", \"--evasive-devices\",\n+\t\t\"-t\", strconv.Itoa(c.initProcess.pid()),\n+\t}\n+\tfor _, m := range c.config.Mounts {\n+\t\tif m.Device == \"bind\" {\n+\t\t\targs = append(args,\n+\t\t\t\t\"--ext-mount-map\", fmt.Sprintf(\"%s:%s\", m.Destination, m.Destination))\n+\t\t}\n+\t}\n+\taddArgsFromEnv(\"CRIU_C\", &args) // XXX debug\n+\tif err := exec.Command(c.criuPath, args...).Run(); err != nil {","path":"container_linux.go","position":76,"original_position":76,"commit_id":"17e5c87099096507250d32d4d05f4014c651fdf8","original_commit_id":"17e5c87099096507250d32d4d05f4014c651fdf8","user":{"login":"vishh","id":7063592,"avatar_url":"https://avatars.githubusercontent.com/u/7063592?v=3","gravatar_id":"","url":"https://api.github.com/users/vishh","html_url":"https://github.com/vishh","followers_url":"https://api.github.com/users/vishh/followers","following_url":"https://api.github.com/users/vishh/following{/other_user}","gists_url":"https://api.github.com/users/vishh/gists{/gist_id}","starred_url":"https://api.github.com/users/vishh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vishh/subscriptions","organizations_url":"https://api.github.com/users/vishh/orgs","repos_url":"https://api.github.com/users/vishh/repos","events_url":"https://api.github.com/users/vishh/events{/privacy}","received_events_url":"https://api.github.com/users/vishh/received_events","type":"User","site_admin":false},"body":"+1","created_at":"2015-03-27T18:37:48Z","updated_at":"2015-03-27T18:37:48Z","html_url":"https://github.com/docker/libcontainer/pull/479#discussion_r27320056","pull_request_url":"https://api.github.com/repos/docker/libcontainer/pulls/479","_links":{"self":{"href":"https://api.github.com/repos/docker/libcontainer/pulls/comments/27320056"},"html":{"href":"https://github.com/docker/libcontainer/pull/479#discussion_r27320056"},"pull_request":{"href":"https://api.github.com/repos/docker/libcontainer/pulls/479"}}},"pull_request":{"url":"https://api.github.com/repos/docker/libcontainer/pulls/479","id":31867736,"html_url":"https://github.com/docker/libcontainer/pull/479","diff_url":"https://github.com/docker/libcontainer/pull/479.diff","patch_url":"https://github.com/docker/libcontainer/pull/479.patch","issue_url":"https://api.github.com/repos/docker/libcontainer/issues/479","number":479,"state":"open","locked":false,"title":"WIP: Add Checkpoint and Restore support to libcontainer","user":{"login":"crosbymichael","id":749551,"avatar_url":"https://avatars.githubusercontent.com/u/749551?v=3","gravatar_id":"","url":"https://api.github.com/users/crosbymichael","html_url":"https://github.com/crosbymichael","followers_url":"https://api.github.com/users/crosbymichael/followers","following_url":"https://api.github.com/users/crosbymichael/following{/other_user}","gists_url":"https://api.github.com/users/crosbymichael/gists{/gist_id}","starred_url":"https://api.github.com/users/crosbymichael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crosbymichael/subscriptions","organizations_url":"https://api.github.com/users/crosbymichael/orgs","repos_url":"https://api.github.com/users/crosbymichael/repos","events_url":"https://api.github.com/users/crosbymichael/events{/privacy}","received_events_url":"https://api.github.com/users/crosbymichael/received_events","type":"User","site_admin":false},"body":"This is a work in progress PR so that we can move the discussion around this work into a PR to help move things along and get other people involved.\r\n\r\nWe are trying to get `nsinit` work as an easy way to test but the first class support should be for using it from a daemon such as docker.  \r\n\r\nAny more work can be done on the `criu` branch of this repo via pull requests.","created_at":"2015-03-24T20:41:54Z","updated_at":"2015-03-27T18:37:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8cfd26999124e7877d2a09de2a827b2437673804","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/libcontainer/pulls/479/commits","review_comments_url":"https://api.github.com/repos/docker/libcontainer/pulls/479/comments","review_comment_url":"https://api.github.com/repos/docker/libcontainer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/libcontainer/issues/479/comments","statuses_url":"https://api.github.com/repos/docker/libcontainer/statuses/17e5c87099096507250d32d4d05f4014c651fdf8","head":{"label":"docker:criu","ref":"criu","sha":"17e5c87099096507250d32d4d05f4014c651fdf8","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":15693680,"name":"libcontainer","full_name":"docker/libcontainer","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/libcontainer","description":"Linux Containers","fork":false,"url":"https://api.github.com/repos/docker/libcontainer","forks_url":"https://api.github.com/repos/docker/libcontainer/forks","keys_url":"https://api.github.com/repos/docker/libcontainer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/libcontainer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/libcontainer/teams","hooks_url":"https://api.github.com/repos/docker/libcontainer/hooks","issue_events_url":"https://api.github.com/repos/docker/libcontainer/issues/events{/number}","events_url":"https://api.github.com/repos/docker/libcontainer/events","assignees_url":"https://api.github.com/repos/docker/libcontainer/assignees{/user}","branches_url":"https://api.github.com/repos/docker/libcontainer/branches{/branch}","tags_url":"https://api.github.com/repos/docker/libcontainer/tags","blobs_url":"https://api.github.com/repos/docker/libcontainer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/libcontainer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/libcontainer/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/libcontainer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/libcontainer/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/libcontainer/languages","stargazers_url":"https://api.github.com/repos/docker/libcontainer/stargazers","contributors_url":"https://api.github.com/repos/docker/libcontainer/contributors","subscribers_url":"https://api.github.com/repos/docker/libcontainer/subscribers","subscription_url":"https://api.github.com/repos/docker/libcontainer/subscription","commits_url":"https://api.github.com/repos/docker/libcontainer/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/libcontainer/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/libcontainer/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/libcontainer/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/libcontainer/contents/{+path}","compare_url":"https://api.github.com/repos/docker/libcontainer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/libcontainer/merges","archive_url":"https://api.github.com/repos/docker/libcontainer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/libcontainer/downloads","issues_url":"https://api.github.com/repos/docker/libcontainer/issues{/number}","pulls_url":"https://api.github.com/repos/docker/libcontainer/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/libcontainer/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/libcontainer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/libcontainer/labels{/name}","releases_url":"https://api.github.com/repos/docker/libcontainer/releases{/id}","created_at":"2014-01-07T03:05:05Z","updated_at":"2015-03-27T17:53:29Z","pushed_at":"2015-03-27T17:53:29Z","git_url":"git://github.com/docker/libcontainer.git","ssh_url":"git@github.com:docker/libcontainer.git","clone_url":"https://github.com/docker/libcontainer.git","svn_url":"https://github.com/docker/libcontainer","homepage":"http://www.docker.com/","size":6643,"stargazers_count":726,"watchers_count":726,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":198,"mirror_url":null,"open_issues_count":48,"forks":198,"open_issues":48,"watchers":726,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"37d229d0262b6fa7dfb96184eff3f7882ddd487e","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":15693680,"name":"libcontainer","full_name":"docker/libcontainer","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/libcontainer","description":"Linux Containers","fork":false,"url":"https://api.github.com/repos/docker/libcontainer","forks_url":"https://api.github.com/repos/docker/libcontainer/forks","keys_url":"https://api.github.com/repos/docker/libcontainer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/libcontainer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/libcontainer/teams","hooks_url":"https://api.github.com/repos/docker/libcontainer/hooks","issue_events_url":"https://api.github.com/repos/docker/libcontainer/issues/events{/number}","events_url":"https://api.github.com/repos/docker/libcontainer/events","assignees_url":"https://api.github.com/repos/docker/libcontainer/assignees{/user}","branches_url":"https://api.github.com/repos/docker/libcontainer/branches{/branch}","tags_url":"https://api.github.com/repos/docker/libcontainer/tags","blobs_url":"https://api.github.com/repos/docker/libcontainer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/libcontainer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/libcontainer/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/libcontainer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/libcontainer/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/libcontainer/languages","stargazers_url":"https://api.github.com/repos/docker/libcontainer/stargazers","contributors_url":"https://api.github.com/repos/docker/libcontainer/contributors","subscribers_url":"https://api.github.com/repos/docker/libcontainer/subscribers","subscription_url":"https://api.github.com/repos/docker/libcontainer/subscription","commits_url":"https://api.github.com/repos/docker/libcontainer/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/libcontainer/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/libcontainer/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/libcontainer/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/libcontainer/contents/{+path}","compare_url":"https://api.github.com/repos/docker/libcontainer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/libcontainer/merges","archive_url":"https://api.github.com/repos/docker/libcontainer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/libcontainer/downloads","issues_url":"https://api.github.com/repos/docker/libcontainer/issues{/number}","pulls_url":"https://api.github.com/repos/docker/libcontainer/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/libcontainer/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/libcontainer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/libcontainer/labels{/name}","releases_url":"https://api.github.com/repos/docker/libcontainer/releases{/id}","created_at":"2014-01-07T03:05:05Z","updated_at":"2015-03-27T17:53:29Z","pushed_at":"2015-03-27T17:53:29Z","git_url":"git://github.com/docker/libcontainer.git","ssh_url":"git@github.com:docker/libcontainer.git","clone_url":"https://github.com/docker/libcontainer.git","svn_url":"https://github.com/docker/libcontainer","homepage":"http://www.docker.com/","size":6643,"stargazers_count":726,"watchers_count":726,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":198,"mirror_url":null,"open_issues_count":48,"forks":198,"open_issues":48,"watchers":726,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/libcontainer/pulls/479"},"html":{"href":"https://github.com/docker/libcontainer/pull/479"},"issue":{"href":"https://api.github.com/repos/docker/libcontainer/issues/479"},"comments":{"href":"https://api.github.com/repos/docker/libcontainer/issues/479/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/libcontainer/pulls/479/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/libcontainer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/libcontainer/pulls/479/commits"},"statuses":{"href":"https://api.github.com/repos/docker/libcontainer/statuses/17e5c87099096507250d32d4d05f4014c651fdf8"}}}}