{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/81429483","pull_request_review_id":2412992,"id":81429483,"diff_hunk":"@@ -427,12 +427,80 @@ func (clnt *client) Resize(containerID, processFriendlyName string, width, heigh\n \n // Pause handles pause requests for containers\n func (clnt *client) Pause(containerID string) error {\n-\treturn errors.New(\"Windows: Containers cannot be paused\")\n+\tunlockContainer := true\n+\t// Get the libcontainerd container object\n+\tclnt.lock(containerID)\n+\tdefer func() {\n+\t\tif unlockContainer {\n+\t\t\tclnt.unlock(containerID)\n+\t\t}\n+\t}()\n+\tcontainer, err := clnt.getContainer(containerID)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\n+\tfor _, option := range container.options {\n+\t\tif h, ok := option.(*HyperVIsolationOption); ok {\n+\t\t\tif !h.IsHyperV {\n+\t\t\t\treturn errors.New(\"cannot pause Windows Server Containers, use Hyper-V containers to pause on Windows\")\n+\t\t\t}\n+\t\t\tbreak\n+\t\t}\n+\t}\n+\n+\terr = container.hcsContainer.Pause()\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\n+\t// Unlock container before calling back into the daemon\n+\tunlockContainer = false\n+\tclnt.unlock(containerID)\n+\n+\treturn clnt.backend.StateChanged(containerID, StateInfo{\n+\t\tCommonStateInfo: CommonStateInfo{\n+\t\t\tState: StatePause,\n+\t\t}})\n }\n \n // Resume handles resume requests for containers\n func (clnt *client) Resume(containerID string) error {\n-\treturn errors.New(\"Windows: Containers cannot be paused\")\n+\tunlockContainer := true\n+\t// Get the libcontainerd container object\n+\tclnt.lock(containerID)\n+\tdefer func() {\n+\t\tif unlockContainer {\n+\t\t\tclnt.unlock(containerID)\n+\t\t}\n+\t}()\n+\tcontainer, err := clnt.getContainer(containerID)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\n+\tfor _, option := range container.options {\n+\t\tif h, ok := option.(*HyperVIsolationOption); ok {\n+\t\t\tif !h.IsHyperV {\n+\t\t\t\treturn errors.New(\"cannot pause Windows Server Containers, use Hyper-V containers to pause on Windows\")","path":"libcontainerd/client_windows.go","position":null,"original_position":61,"commit_id":"b962c730923f52658009d0b42a2aa7b6f7b5e455","original_commit_id":"56efca403c8cbcdf0d899c6170bb4b2597b21586","user":{"login":"darrenstahlmsft","id":14114019,"avatar_url":"https://avatars.githubusercontent.com/u/14114019?v=3","gravatar_id":"","url":"https://api.github.com/users/darrenstahlmsft","html_url":"https://github.com/darrenstahlmsft","followers_url":"https://api.github.com/users/darrenstahlmsft/followers","following_url":"https://api.github.com/users/darrenstahlmsft/following{/other_user}","gists_url":"https://api.github.com/users/darrenstahlmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/darrenstahlmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darrenstahlmsft/subscriptions","organizations_url":"https://api.github.com/users/darrenstahlmsft/orgs","repos_url":"https://api.github.com/users/darrenstahlmsft/repos","events_url":"https://api.github.com/users/darrenstahlmsft/events{/privacy}","received_events_url":"https://api.github.com/users/darrenstahlmsft/received_events","type":"User","site_admin":false},"body":"Fixed","created_at":"2016-09-30T22:36:05Z","updated_at":"2016-09-30T22:36:05Z","html_url":"https://github.com/docker/docker/pull/26795#discussion_r81429483","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/26795","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/81429483"},"html":{"href":"https://github.com/docker/docker/pull/26795#discussion_r81429483"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/26795"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/26795","id":86235906,"html_url":"https://github.com/docker/docker/pull/26795","diff_url":"https://github.com/docker/docker/pull/26795.diff","patch_url":"https://github.com/docker/docker/pull/26795.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/26795","number":26795,"state":"open","locked":false,"title":"Implement Pause Resume support for Windows","user":{"login":"darrenstahlmsft","id":14114019,"avatar_url":"https://avatars.githubusercontent.com/u/14114019?v=3","gravatar_id":"","url":"https://api.github.com/users/darrenstahlmsft","html_url":"https://github.com/darrenstahlmsft","followers_url":"https://api.github.com/users/darrenstahlmsft/followers","following_url":"https://api.github.com/users/darrenstahlmsft/following{/other_user}","gists_url":"https://api.github.com/users/darrenstahlmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/darrenstahlmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darrenstahlmsft/subscriptions","organizations_url":"https://api.github.com/users/darrenstahlmsft/orgs","repos_url":"https://api.github.com/users/darrenstahlmsft/repos","events_url":"https://api.github.com/users/darrenstahlmsft/events{/privacy}","received_events_url":"https://api.github.com/users/darrenstahlmsft/received_events","type":"User","site_admin":false},"body":"<!--\r\nPlease make sure you've read and understood our contributing guidelines;\r\nhttps://github.com/docker/docker/blob/master/CONTRIBUTING.md\r\n\r\n** Make sure all your commits include a signature generated with `git commit -s` **\r\n\r\nFor additional information on our contributing process, read our contributing\r\nguide https://docs.docker.com/opensource/code/\r\n\r\nIf this is a bug fix, make sure your description includes \"fixes #xxxx\", or\r\n\"closes #xxxx\"\r\n\r\nPlease provide the following information:\r\n-->\r\n\r\n**- What I did**\r\n\r\nEnable Pause/Resume of containers on Windows. This only works with Hyper-V containers.\r\n\r\n**- How to verify it**\r\n\r\nThis requires Hyper-V containers, so can not currently be testing in CI, but here are some screenshots of it working locally:\r\nPaused:\r\n![paused](https://cloud.githubusercontent.com/assets/14114019/18727678/97e62c9e-7ffe-11e6-80e6-a5c228d71eb7.png)\r\n\r\nRunning again:\r\n![running](https://cloud.githubusercontent.com/assets/14114019/18727682/a23bde50-7ffe-11e6-8441-b0e98ffa6ff7.png)\r\n\r\n**- Description for the changelog**\r\n<!--\r\nWrite a short (one line) summary that describes the changes in this\r\npull request for inclusion in the changelog:\r\n-->\r\nEnabled pausing of Hyper-V containers on Windows.\r\n\r\nSigned-off-by: Darren Stahl <darst@microsoft.com>","created_at":"2016-09-21T20:32:24Z","updated_at":"2016-09-30T22:36:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03329f3081f9972c066cd7ced61e33c555a6d6e0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/26795/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/26795/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/26795/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/b962c730923f52658009d0b42a2aa7b6f7b5e455","head":{"label":"darrenstahlmsft:PauseResume","ref":"PauseResume","sha":"b962c730923f52658009d0b42a2aa7b6f7b5e455","user":{"login":"darrenstahlmsft","id":14114019,"avatar_url":"https://avatars.githubusercontent.com/u/14114019?v=3","gravatar_id":"","url":"https://api.github.com/users/darrenstahlmsft","html_url":"https://github.com/darrenstahlmsft","followers_url":"https://api.github.com/users/darrenstahlmsft/followers","following_url":"https://api.github.com/users/darrenstahlmsft/following{/other_user}","gists_url":"https://api.github.com/users/darrenstahlmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/darrenstahlmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darrenstahlmsft/subscriptions","organizations_url":"https://api.github.com/users/darrenstahlmsft/orgs","repos_url":"https://api.github.com/users/darrenstahlmsft/repos","events_url":"https://api.github.com/users/darrenstahlmsft/events{/privacy}","received_events_url":"https://api.github.com/users/darrenstahlmsft/received_events","type":"User","site_admin":false},"repo":{"id":65239067,"name":"docker","full_name":"darrenstahlmsft/docker","owner":{"login":"darrenstahlmsft","id":14114019,"avatar_url":"https://avatars.githubusercontent.com/u/14114019?v=3","gravatar_id":"","url":"https://api.github.com/users/darrenstahlmsft","html_url":"https://github.com/darrenstahlmsft","followers_url":"https://api.github.com/users/darrenstahlmsft/followers","following_url":"https://api.github.com/users/darrenstahlmsft/following{/other_user}","gists_url":"https://api.github.com/users/darrenstahlmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/darrenstahlmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darrenstahlmsft/subscriptions","organizations_url":"https://api.github.com/users/darrenstahlmsft/orgs","repos_url":"https://api.github.com/users/darrenstahlmsft/repos","events_url":"https://api.github.com/users/darrenstahlmsft/events{/privacy}","received_events_url":"https://api.github.com/users/darrenstahlmsft/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/darrenstahlmsft/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/darrenstahlmsft/docker","forks_url":"https://api.github.com/repos/darrenstahlmsft/docker/forks","keys_url":"https://api.github.com/repos/darrenstahlmsft/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/darrenstahlmsft/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/darrenstahlmsft/docker/teams","hooks_url":"https://api.github.com/repos/darrenstahlmsft/docker/hooks","issue_events_url":"https://api.github.com/repos/darrenstahlmsft/docker/issues/events{/number}","events_url":"https://api.github.com/repos/darrenstahlmsft/docker/events","assignees_url":"https://api.github.com/repos/darrenstahlmsft/docker/assignees{/user}","branches_url":"https://api.github.com/repos/darrenstahlmsft/docker/branches{/branch}","tags_url":"https://api.github.com/repos/darrenstahlmsft/docker/tags","blobs_url":"https://api.github.com/repos/darrenstahlmsft/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/darrenstahlmsft/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/darrenstahlmsft/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/darrenstahlmsft/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/darrenstahlmsft/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/darrenstahlmsft/docker/languages","stargazers_url":"https://api.github.com/repos/darrenstahlmsft/docker/stargazers","contributors_url":"https://api.github.com/repos/darrenstahlmsft/docker/contributors","subscribers_url":"https://api.github.com/repos/darrenstahlmsft/docker/subscribers","subscription_url":"https://api.github.com/repos/darrenstahlmsft/docker/subscription","commits_url":"https://api.github.com/repos/darrenstahlmsft/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/darrenstahlmsft/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/darrenstahlmsft/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/darrenstahlmsft/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/darrenstahlmsft/docker/contents/{+path}","compare_url":"https://api.github.com/repos/darrenstahlmsft/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/darrenstahlmsft/docker/merges","archive_url":"https://api.github.com/repos/darrenstahlmsft/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/darrenstahlmsft/docker/downloads","issues_url":"https://api.github.com/repos/darrenstahlmsft/docker/issues{/number}","pulls_url":"https://api.github.com/repos/darrenstahlmsft/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/darrenstahlmsft/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/darrenstahlmsft/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/darrenstahlmsft/docker/labels{/name}","releases_url":"https://api.github.com/repos/darrenstahlmsft/docker/releases{/id}","deployments_url":"https://api.github.com/repos/darrenstahlmsft/docker/deployments","created_at":"2016-08-08T21:02:29Z","updated_at":"2016-08-08T21:02:44Z","pushed_at":"2016-09-30T22:34:15Z","git_url":"git://github.com/darrenstahlmsft/docker.git","ssh_url":"git@github.com:darrenstahlmsft/docker.git","clone_url":"https://github.com/darrenstahlmsft/docker.git","svn_url":"https://github.com/darrenstahlmsft/docker","homepage":"http://www.docker.com","size":103746,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"6de38ebc4dfbea0f4a805a6baee109b4c830c272","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":7691631,"name":"docker","full_name":"docker/docker","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/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","deployments_url":"https://api.github.com/repos/docker/docker/deployments","created_at":"2013-01-18T18:10:57Z","updated_at":"2016-09-30T22:08:41Z","pushed_at":"2016-09-30T22:34:17Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":211538,"stargazers_count":35489,"watchers_count":35489,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10436,"mirror_url":null,"open_issues_count":1933,"forks":10436,"open_issues":1933,"watchers":35489,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/26795"},"html":{"href":"https://github.com/docker/docker/pull/26795"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/26795"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/26795/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/26795/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/26795/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/b962c730923f52658009d0b42a2aa7b6f7b5e455"}}}}
{"actor":{"display_login":"darrenstahlmsft"}}