{"action":"created","comment":{"url":"https://api.github.com/repos/xapi-project/xen-api/pulls/comments/90405942","pull_request_review_id":10923330,"id":90405942,"diff_hunk":"@@ -602,17 +602,32 @@ let cancel_tasks ~__context ~self ~all_tasks_in_db ~task_ids =\n   let set = (fun value -> Db.VM.set_current_operations ~__context ~self ~value) in\n   Helpers.cancel_tasks ~__context ~ops ~all_tasks_in_db ~task_ids ~set\n \n-(* VM is considered as \"live\" when it's either Running or Paused, i.e. with a live domain *)\n+(** VM is considered as \"live\" when it's either Running or Paused, i.e. with a live domain *)\n let is_live ~__context ~self =\n   let power_state = Db.VM.get_power_state ~__context ~self in\n   power_state = `Running || power_state = `Paused\n \n-let assert_power_state_in ~__context ~self ~allowed =\n+(** Assert if VM is in a certain set of states before starting an operation *)\n+let assert_initial_power_state_in ~__context ~self ~allowed =\n   let actual = Db.VM.get_power_state ~__context ~self in\n   if not (List.mem actual allowed)\n   then raise (Api_errors.Server_error(Api_errors.vm_bad_power_state, [\n       Ref.string_of self;\n       List.map Record_util.power_to_string allowed |> String.concat \";\";\n       Record_util.power_to_string actual ]))\n \n-let assert_power_state_is ~expected = assert_power_state_in ~allowed:[expected]\n+(** Assert if VM is in a certain state before starting an operation *)","path":"ocaml/xapi/xapi_vm_lifecycle.ml","position":21,"original_position":21,"commit_id":"dde52f9fa1d181cd86765a6f3ba1bb1a8ba9adbe","original_commit_id":"dde52f9fa1d181cd86765a6f3ba1bb1a8ba9adbe","user":{"login":"lindig","id":843617,"avatar_url":"https://avatars.githubusercontent.com/u/843617?v=3","gravatar_id":"","url":"https://api.github.com/users/lindig","html_url":"https://github.com/lindig","followers_url":"https://api.github.com/users/lindig/followers","following_url":"https://api.github.com/users/lindig/following{/other_user}","gists_url":"https://api.github.com/users/lindig/gists{/gist_id}","starred_url":"https://api.github.com/users/lindig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lindig/subscriptions","organizations_url":"https://api.github.com/users/lindig/orgs","repos_url":"https://api.github.com/users/lindig/repos","events_url":"https://api.github.com/users/lindig/events{/privacy}","received_events_url":"https://api.github.com/users/lindig/received_events","type":"User","site_admin":false},"body":"Not a native speaker, but should this not read \"assert *that*\"? This would also apply above.","created_at":"2016-12-01T09:05:34Z","updated_at":"2016-12-01T09:15:01Z","html_url":"https://github.com/xapi-project/xen-api/pull/2854#discussion_r90405942","pull_request_url":"https://api.github.com/repos/xapi-project/xen-api/pulls/2854","_links":{"self":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/comments/90405942"},"html":{"href":"https://github.com/xapi-project/xen-api/pull/2854#discussion_r90405942"},"pull_request":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/2854"}}},"pull_request":{"url":"https://api.github.com/repos/xapi-project/xen-api/pulls/2854","id":95539280,"html_url":"https://github.com/xapi-project/xen-api/pull/2854","diff_url":"https://github.com/xapi-project/xen-api/pull/2854.diff","patch_url":"https://github.com/xapi-project/xen-api/pull/2854.patch","issue_url":"https://api.github.com/repos/xapi-project/xen-api/issues/2854","number":2854,"state":"open","locked":false,"title":"CA-228680: Improve error message when VM crashes before VM.start finishes","user":{"login":"Frezzle","id":5685776,"avatar_url":"https://avatars.githubusercontent.com/u/5685776?v=3","gravatar_id":"","url":"https://api.github.com/users/Frezzle","html_url":"https://github.com/Frezzle","followers_url":"https://api.github.com/users/Frezzle/followers","following_url":"https://api.github.com/users/Frezzle/following{/other_user}","gists_url":"https://api.github.com/users/Frezzle/gists{/gist_id}","starred_url":"https://api.github.com/users/Frezzle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Frezzle/subscriptions","organizations_url":"https://api.github.com/users/Frezzle/orgs","repos_url":"https://api.github.com/users/Frezzle/repos","events_url":"https://api.github.com/users/Frezzle/events{/privacy}","received_events_url":"https://api.github.com/users/Frezzle/received_events","type":"User","site_admin":false},"body":"Also fixed indentation.\r\n\r\nSigned-off-by: Frederico Mazzone <frederico.mazzone@citrix.com>","created_at":"2016-11-28T17:12:43Z","updated_at":"2016-12-01T09:15:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d778b9d1e4b3105e3db52791f3ba35056fa0b964","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/xapi-project/xen-api/pulls/2854/commits","review_comments_url":"https://api.github.com/repos/xapi-project/xen-api/pulls/2854/comments","review_comment_url":"https://api.github.com/repos/xapi-project/xen-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xapi-project/xen-api/issues/2854/comments","statuses_url":"https://api.github.com/repos/xapi-project/xen-api/statuses/dde52f9fa1d181cd86765a6f3ba1bb1a8ba9adbe","head":{"label":"Frezzle:CA-228680","ref":"CA-228680","sha":"dde52f9fa1d181cd86765a6f3ba1bb1a8ba9adbe","user":{"login":"Frezzle","id":5685776,"avatar_url":"https://avatars.githubusercontent.com/u/5685776?v=3","gravatar_id":"","url":"https://api.github.com/users/Frezzle","html_url":"https://github.com/Frezzle","followers_url":"https://api.github.com/users/Frezzle/followers","following_url":"https://api.github.com/users/Frezzle/following{/other_user}","gists_url":"https://api.github.com/users/Frezzle/gists{/gist_id}","starred_url":"https://api.github.com/users/Frezzle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Frezzle/subscriptions","organizations_url":"https://api.github.com/users/Frezzle/orgs","repos_url":"https://api.github.com/users/Frezzle/repos","events_url":"https://api.github.com/users/Frezzle/events{/privacy}","received_events_url":"https://api.github.com/users/Frezzle/received_events","type":"User","site_admin":false},"repo":{"id":67230959,"name":"xen-api","full_name":"Frezzle/xen-api","owner":{"login":"Frezzle","id":5685776,"avatar_url":"https://avatars.githubusercontent.com/u/5685776?v=3","gravatar_id":"","url":"https://api.github.com/users/Frezzle","html_url":"https://github.com/Frezzle","followers_url":"https://api.github.com/users/Frezzle/followers","following_url":"https://api.github.com/users/Frezzle/following{/other_user}","gists_url":"https://api.github.com/users/Frezzle/gists{/gist_id}","starred_url":"https://api.github.com/users/Frezzle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Frezzle/subscriptions","organizations_url":"https://api.github.com/users/Frezzle/orgs","repos_url":"https://api.github.com/users/Frezzle/repos","events_url":"https://api.github.com/users/Frezzle/events{/privacy}","received_events_url":"https://api.github.com/users/Frezzle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Frezzle/xen-api","description":"The Xapi Project's XenAPI Server","fork":true,"url":"https://api.github.com/repos/Frezzle/xen-api","forks_url":"https://api.github.com/repos/Frezzle/xen-api/forks","keys_url":"https://api.github.com/repos/Frezzle/xen-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Frezzle/xen-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Frezzle/xen-api/teams","hooks_url":"https://api.github.com/repos/Frezzle/xen-api/hooks","issue_events_url":"https://api.github.com/repos/Frezzle/xen-api/issues/events{/number}","events_url":"https://api.github.com/repos/Frezzle/xen-api/events","assignees_url":"https://api.github.com/repos/Frezzle/xen-api/assignees{/user}","branches_url":"https://api.github.com/repos/Frezzle/xen-api/branches{/branch}","tags_url":"https://api.github.com/repos/Frezzle/xen-api/tags","blobs_url":"https://api.github.com/repos/Frezzle/xen-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Frezzle/xen-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Frezzle/xen-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/Frezzle/xen-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Frezzle/xen-api/statuses/{sha}","languages_url":"https://api.github.com/repos/Frezzle/xen-api/languages","stargazers_url":"https://api.github.com/repos/Frezzle/xen-api/stargazers","contributors_url":"https://api.github.com/repos/Frezzle/xen-api/contributors","subscribers_url":"https://api.github.com/repos/Frezzle/xen-api/subscribers","subscription_url":"https://api.github.com/repos/Frezzle/xen-api/subscription","commits_url":"https://api.github.com/repos/Frezzle/xen-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/Frezzle/xen-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/Frezzle/xen-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/Frezzle/xen-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/Frezzle/xen-api/contents/{+path}","compare_url":"https://api.github.com/repos/Frezzle/xen-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Frezzle/xen-api/merges","archive_url":"https://api.github.com/repos/Frezzle/xen-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Frezzle/xen-api/downloads","issues_url":"https://api.github.com/repos/Frezzle/xen-api/issues{/number}","pulls_url":"https://api.github.com/repos/Frezzle/xen-api/pulls{/number}","milestones_url":"https://api.github.com/repos/Frezzle/xen-api/milestones{/number}","notifications_url":"https://api.github.com/repos/Frezzle/xen-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Frezzle/xen-api/labels{/name}","releases_url":"https://api.github.com/repos/Frezzle/xen-api/releases{/id}","deployments_url":"https://api.github.com/repos/Frezzle/xen-api/deployments","created_at":"2016-09-02T14:49:11Z","updated_at":"2016-09-02T14:49:16Z","pushed_at":"2016-11-30T15:58:27Z","git_url":"git://github.com/Frezzle/xen-api.git","ssh_url":"git@github.com:Frezzle/xen-api.git","clone_url":"https://github.com/Frezzle/xen-api.git","svn_url":"https://github.com/Frezzle/xen-api","homepage":"http://xenproject.org/developers/teams/xapi.html","size":28484,"stargazers_count":0,"watchers_count":0,"language":"OCaml","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":"xapi-project:master","ref":"master","sha":"bb80696f62969d588990e1fbf2196ab064419941","user":{"login":"xapi-project","id":317268,"avatar_url":"https://avatars.githubusercontent.com/u/317268?v=3","gravatar_id":"","url":"https://api.github.com/users/xapi-project","html_url":"https://github.com/xapi-project","followers_url":"https://api.github.com/users/xapi-project/followers","following_url":"https://api.github.com/users/xapi-project/following{/other_user}","gists_url":"https://api.github.com/users/xapi-project/gists{/gist_id}","starred_url":"https://api.github.com/users/xapi-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xapi-project/subscriptions","organizations_url":"https://api.github.com/users/xapi-project/orgs","repos_url":"https://api.github.com/users/xapi-project/repos","events_url":"https://api.github.com/users/xapi-project/events{/privacy}","received_events_url":"https://api.github.com/users/xapi-project/received_events","type":"Organization","site_admin":false},"repo":{"id":960233,"name":"xen-api","full_name":"xapi-project/xen-api","owner":{"login":"xapi-project","id":317268,"avatar_url":"https://avatars.githubusercontent.com/u/317268?v=3","gravatar_id":"","url":"https://api.github.com/users/xapi-project","html_url":"https://github.com/xapi-project","followers_url":"https://api.github.com/users/xapi-project/followers","following_url":"https://api.github.com/users/xapi-project/following{/other_user}","gists_url":"https://api.github.com/users/xapi-project/gists{/gist_id}","starred_url":"https://api.github.com/users/xapi-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xapi-project/subscriptions","organizations_url":"https://api.github.com/users/xapi-project/orgs","repos_url":"https://api.github.com/users/xapi-project/repos","events_url":"https://api.github.com/users/xapi-project/events{/privacy}","received_events_url":"https://api.github.com/users/xapi-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xapi-project/xen-api","description":"The Xapi Project's XenAPI Server","fork":false,"url":"https://api.github.com/repos/xapi-project/xen-api","forks_url":"https://api.github.com/repos/xapi-project/xen-api/forks","keys_url":"https://api.github.com/repos/xapi-project/xen-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xapi-project/xen-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xapi-project/xen-api/teams","hooks_url":"https://api.github.com/repos/xapi-project/xen-api/hooks","issue_events_url":"https://api.github.com/repos/xapi-project/xen-api/issues/events{/number}","events_url":"https://api.github.com/repos/xapi-project/xen-api/events","assignees_url":"https://api.github.com/repos/xapi-project/xen-api/assignees{/user}","branches_url":"https://api.github.com/repos/xapi-project/xen-api/branches{/branch}","tags_url":"https://api.github.com/repos/xapi-project/xen-api/tags","blobs_url":"https://api.github.com/repos/xapi-project/xen-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xapi-project/xen-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xapi-project/xen-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/xapi-project/xen-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xapi-project/xen-api/statuses/{sha}","languages_url":"https://api.github.com/repos/xapi-project/xen-api/languages","stargazers_url":"https://api.github.com/repos/xapi-project/xen-api/stargazers","contributors_url":"https://api.github.com/repos/xapi-project/xen-api/contributors","subscribers_url":"https://api.github.com/repos/xapi-project/xen-api/subscribers","subscription_url":"https://api.github.com/repos/xapi-project/xen-api/subscription","commits_url":"https://api.github.com/repos/xapi-project/xen-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/xapi-project/xen-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/xapi-project/xen-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/xapi-project/xen-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/xapi-project/xen-api/contents/{+path}","compare_url":"https://api.github.com/repos/xapi-project/xen-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xapi-project/xen-api/merges","archive_url":"https://api.github.com/repos/xapi-project/xen-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xapi-project/xen-api/downloads","issues_url":"https://api.github.com/repos/xapi-project/xen-api/issues{/number}","pulls_url":"https://api.github.com/repos/xapi-project/xen-api/pulls{/number}","milestones_url":"https://api.github.com/repos/xapi-project/xen-api/milestones{/number}","notifications_url":"https://api.github.com/repos/xapi-project/xen-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xapi-project/xen-api/labels{/name}","releases_url":"https://api.github.com/repos/xapi-project/xen-api/releases{/id}","deployments_url":"https://api.github.com/repos/xapi-project/xen-api/deployments","created_at":"2010-10-04T10:52:57Z","updated_at":"2016-10-29T04:15:39Z","pushed_at":"2016-11-30T15:58:27Z","git_url":"git://github.com/xapi-project/xen-api.git","ssh_url":"git@github.com:xapi-project/xen-api.git","clone_url":"https://github.com/xapi-project/xen-api.git","svn_url":"https://github.com/xapi-project/xen-api","homepage":"http://xenproject.org/developers/teams/xapi.html","size":41709,"stargazers_count":222,"watchers_count":222,"language":"OCaml","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":159,"mirror_url":null,"open_issues_count":20,"forks":159,"open_issues":20,"watchers":222,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/2854"},"html":{"href":"https://github.com/xapi-project/xen-api/pull/2854"},"issue":{"href":"https://api.github.com/repos/xapi-project/xen-api/issues/2854"},"comments":{"href":"https://api.github.com/repos/xapi-project/xen-api/issues/2854/comments"},"review_comments":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/2854/comments"},"review_comment":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/2854/commits"},"statuses":{"href":"https://api.github.com/repos/xapi-project/xen-api/statuses/dde52f9fa1d181cd86765a6f3ba1bb1a8ba9adbe"}}}}
{"actor":{"display_login":"lindig"}}