{"action":"created","comment":{"url":"https://api.github.com/repos/vmware/docker-volume-vsphere/pulls/comments/65306205","id":65306205,"diff_hunk":"@@ -0,0 +1,87 @@\n+// Copyright 2016 VMware, Inc. All Rights Reserved.\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//    http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+// Errors on vmci command communication channel\n+\n+#ifndef _CONNECTION_ERRORS_H_\n+#define _CONNECTION_ERRORS_H_\n+\n+typedef enum VMCI_ConnectionError {\n+   CONN_SUCCESS = 0,\n+\n+   // Misc. protocol errors. When changing, also update info[] below\n+   CONN_FAILED_VMCI_ADDRESS_FAMILY_GET,\n+   CONN_FAILED_VMCI_ADDRESS_FAMILY_MISSING,\n+   CONN_FAILED_VSOCKET_OPEN,\n+   CONN_FAILED_VSOCKET_BIND,\n+   CONN_FAILED_VSOCKET_LISTEN,\n+   CONN_FAILED_VSOCKET_ACCEPT,\n+   CONN_FAILED_TO_CONNECT,\n+   CONN_FAILED_SOCKADDR_GET,\n+   CONN_FAILED_MAGIC_SEND,\n+   CONN_FAILED_LEN_SEND,\n+   CONN_FAILED_CONTENT_SEND,\n+   CONN_FAILED_MAGIC_RECIEVE,\n+   CONN_FAILED_LEN_RECEIVE,\n+   CONN_FAILED_CONTENT_RECIEVE,\n+   CONN_LEN_MISMATCH,\n+   CONN_MALLOC_FAILED,\n+   CONN_BUF_TOO_SMALL,\n+   CONN_FAILED_LEN_MISMATCH,\n+\n+   // Bad communication back end name (internal usage only)\n+   CONN_BAD_BE_NAME\n+} VMCI_ConnectionError;\n+\n+// gets error string for a connection error\n+static const char*\n+VMCI_ErrorStr(VMCI_ConnectionError id)\n+{\n+   int i;\n+   struct {\n+      VMCI_ConnectionError id;\n+      const char *msg;\n+   } info[] = {\n+      { CONN_FAILED_VMCI_ADDRESS_FAMILY_GET, \"failed to get VMCI Address Family\"},\n+      { CONN_FAILED_VMCI_ADDRESS_FAMILY_MISSING, \"missing VMCI AF (internal error)\"},\n+      { CONN_FAILED_VSOCKET_OPEN, \"failed to open vSocket\"},\n+      { CONN_FAILED_VSOCKET_BIND, \"failed to bind vSocket\"},\n+      { CONN_FAILED_VSOCKET_LISTEN, \"failed to listen on vSocket\"},\n+      { CONN_FAILED_VSOCKET_ACCEPT, \"failed on accept on vSocket\"},\n+      { CONN_FAILED_TO_CONNECT, \"failed to connect to vSocket\"},\n+      { CONN_FAILED_SOCKADDR_GET, \"failed sockadr get\"},\n+      { CONN_FAILED_MAGIC_SEND, \"failed MAGIC send\"},\n+      { CONN_FAILED_LEN_SEND, \"failed LEN send\"},\n+      { CONN_FAILED_CONTENT_SEND, \"failed content send\"},\n+      { CONN_FAILED_MAGIC_RECIEVE, \"failed MAGIC receive\"},\n+      { CONN_FAILED_LEN_RECEIVE, \"failed LEN receive\"},\n+      { CONN_FAILED_CONTENT_RECIEVE, \"failed to receive content\"},\n+      { CONN_MALLOC_FAILED, \"failed malloc\"},\n+      { CONN_BUF_TOO_SMALL, \"request buffer is too small\"},\n+      { CONN_LEN_MISMATCH, \"message length mismatch\"},\n+      { CONN_BAD_BE_NAME, \"bad back end name\"},\n+","path":"esx_service/vmci/connection_errors.h","position":74,"original_position":74,"commit_id":"2d260f047727ff6f04706489fec3f2e828f1b660","original_commit_id":"2d260f047727ff6f04706489fec3f2e828f1b660","user":{"login":"govint","id":15854712,"avatar_url":"https://avatars.githubusercontent.com/u/15854712?v=3","gravatar_id":"","url":"https://api.github.com/users/govint","html_url":"https://github.com/govint","followers_url":"https://api.github.com/users/govint/followers","following_url":"https://api.github.com/users/govint/following{/other_user}","gists_url":"https://api.github.com/users/govint/gists{/gist_id}","starred_url":"https://api.github.com/users/govint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/govint/subscriptions","organizations_url":"https://api.github.com/users/govint/orgs","repos_url":"https://api.github.com/users/govint/repos","events_url":"https://api.github.com/users/govint/events{/privacy}","received_events_url":"https://api.github.com/users/govint/received_events","type":"User","site_admin":false},"body":"For the above three error should be CONN_FAILED_......., to match the error list.","created_at":"2016-06-01T06:02:35Z","updated_at":"2016-06-01T06:02:35Z","html_url":"https://github.com/vmware/docker-volume-vsphere/pull/432#discussion_r65306205","pull_request_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/pulls/432","_links":{"self":{"href":"https://api.github.com/repos/vmware/docker-volume-vsphere/pulls/comments/65306205"},"html":{"href":"https://github.com/vmware/docker-volume-vsphere/pull/432#discussion_r65306205"},"pull_request":{"href":"https://api.github.com/repos/vmware/docker-volume-vsphere/pulls/432"}}},"pull_request":{"url":"https://api.github.com/repos/vmware/docker-volume-vsphere/pulls/432","id":72115772,"html_url":"https://github.com/vmware/docker-volume-vsphere/pull/432","diff_url":"https://github.com/vmware/docker-volume-vsphere/pull/432.diff","patch_url":"https://github.com/vmware/docker-volume-vsphere/pull/432.patch","issue_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/issues/432","number":432,"state":"open","locked":false,"title":"Moved VMCI code to one place and added distinct error return codes","user":{"login":"msterin","id":4379889,"avatar_url":"https://avatars.githubusercontent.com/u/4379889?v=3","gravatar_id":"","url":"https://api.github.com/users/msterin","html_url":"https://github.com/msterin","followers_url":"https://api.github.com/users/msterin/followers","following_url":"https://api.github.com/users/msterin/following{/other_user}","gists_url":"https://api.github.com/users/msterin/gists{/gist_id}","starred_url":"https://api.github.com/users/msterin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msterin/subscriptions","organizations_url":"https://api.github.com/users/msterin/orgs","repos_url":"https://api.github.com/users/msterin/repos","events_url":"https://api.github.com/users/msterin/events{/privacy}","received_events_url":"https://api.github.com/users/msterin/received_events","type":"User","site_admin":false},"body":"First pass on vmci errors clean up:\r\n* all vmci C code is now in esx_service/vmci , so no duplicate .h files (was leftover from prototyping)\r\n* distinct code is returned instead of -1\r\n* client log and Dockert command line are getting proper message\r\n\r\nTBD in next PR:\r\n* proper error messages log on the server\r\n* bubble up errno and extra details (currently fprintf(stderr) - not really visible in service logs)\r\n\r\nTested: \r\nmanual : stopped esx service and checked Docker prints proper message\r\nCI\r\n\r\n```\r\nmsterin-m01:docker-volume-vsphere msterin$ ssh root@$VM docker volume ls\r\nDRIVER              VOLUME NAME\r\nlist vmdk: VolumeDriver.List: Failed to communicate with ESX (failed to connect to vSocket)\r\nmsterin-m01:docker-volume-vsphere msterin$ \r\n```","created_at":"2016-06-01T02:52:55Z","updated_at":"2016-06-01T06:02:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c8d815b8ac5671380fea042e4e01cd161a50727","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/pulls/432/commits","review_comments_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/pulls/432/comments","review_comment_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/issues/432/comments","statuses_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/statuses/2d260f047727ff6f04706489fec3f2e828f1b660","head":{"label":"vmware:vmci-err.msterin","ref":"vmci-err.msterin","sha":"2d260f047727ff6f04706489fec3f2e828f1b660","user":{"login":"vmware","id":473334,"avatar_url":"https://avatars.githubusercontent.com/u/473334?v=3","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"repo":{"id":49599693,"name":"docker-volume-vsphere","full_name":"vmware/docker-volume-vsphere","owner":{"login":"vmware","id":473334,"avatar_url":"https://avatars.githubusercontent.com/u/473334?v=3","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vmware/docker-volume-vsphere","description":"Docker Volume Driver for vSphere.","fork":false,"url":"https://api.github.com/repos/vmware/docker-volume-vsphere","forks_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/forks","keys_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/teams","hooks_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/hooks","issue_events_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/issues/events{/number}","events_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/events","assignees_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/assignees{/user}","branches_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/branches{/branch}","tags_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/tags","blobs_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/git/refs{/sha}","trees_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/statuses/{sha}","languages_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/languages","stargazers_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/stargazers","contributors_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/contributors","subscribers_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/subscribers","subscription_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/subscription","commits_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/commits{/sha}","git_commits_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/git/commits{/sha}","comments_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/comments{/number}","issue_comment_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/issues/comments{/number}","contents_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/contents/{+path}","compare_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/merges","archive_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/downloads","issues_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/issues{/number}","pulls_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/pulls{/number}","milestones_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/milestones{/number}","notifications_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/labels{/name}","releases_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/releases{/id}","deployments_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/deployments","created_at":"2016-01-13T20:25:36Z","updated_at":"2016-06-01T05:54:01Z","pushed_at":"2016-06-01T02:52:55Z","git_url":"git://github.com/vmware/docker-volume-vsphere.git","ssh_url":"git@github.com:vmware/docker-volume-vsphere.git","clone_url":"https://github.com/vmware/docker-volume-vsphere.git","svn_url":"https://github.com/vmware/docker-volume-vsphere","homepage":"","size":6759,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":88,"forks":0,"open_issues":88,"watchers":12,"default_branch":"master"}},"base":{"label":"vmware:master","ref":"master","sha":"de31950ef745721f362dbc64946de9f7f9b7b299","user":{"login":"vmware","id":473334,"avatar_url":"https://avatars.githubusercontent.com/u/473334?v=3","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"repo":{"id":49599693,"name":"docker-volume-vsphere","full_name":"vmware/docker-volume-vsphere","owner":{"login":"vmware","id":473334,"avatar_url":"https://avatars.githubusercontent.com/u/473334?v=3","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vmware/docker-volume-vsphere","description":"Docker Volume Driver for vSphere.","fork":false,"url":"https://api.github.com/repos/vmware/docker-volume-vsphere","forks_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/forks","keys_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/teams","hooks_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/hooks","issue_events_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/issues/events{/number}","events_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/events","assignees_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/assignees{/user}","branches_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/branches{/branch}","tags_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/tags","blobs_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/git/refs{/sha}","trees_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/statuses/{sha}","languages_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/languages","stargazers_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/stargazers","contributors_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/contributors","subscribers_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/subscribers","subscription_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/subscription","commits_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/commits{/sha}","git_commits_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/git/commits{/sha}","comments_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/comments{/number}","issue_comment_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/issues/comments{/number}","contents_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/contents/{+path}","compare_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/merges","archive_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/downloads","issues_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/issues{/number}","pulls_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/pulls{/number}","milestones_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/milestones{/number}","notifications_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/labels{/name}","releases_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/releases{/id}","deployments_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/deployments","created_at":"2016-01-13T20:25:36Z","updated_at":"2016-06-01T05:54:01Z","pushed_at":"2016-06-01T02:52:55Z","git_url":"git://github.com/vmware/docker-volume-vsphere.git","ssh_url":"git@github.com:vmware/docker-volume-vsphere.git","clone_url":"https://github.com/vmware/docker-volume-vsphere.git","svn_url":"https://github.com/vmware/docker-volume-vsphere","homepage":"","size":6759,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":88,"forks":0,"open_issues":88,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vmware/docker-volume-vsphere/pulls/432"},"html":{"href":"https://github.com/vmware/docker-volume-vsphere/pull/432"},"issue":{"href":"https://api.github.com/repos/vmware/docker-volume-vsphere/issues/432"},"comments":{"href":"https://api.github.com/repos/vmware/docker-volume-vsphere/issues/432/comments"},"review_comments":{"href":"https://api.github.com/repos/vmware/docker-volume-vsphere/pulls/432/comments"},"review_comment":{"href":"https://api.github.com/repos/vmware/docker-volume-vsphere/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vmware/docker-volume-vsphere/pulls/432/commits"},"statuses":{"href":"https://api.github.com/repos/vmware/docker-volume-vsphere/statuses/2d260f047727ff6f04706489fec3f2e828f1b660"}}}}
{"actor":{"display_login":"govint"}}