{"action":"created","comment":{"url":"https://api.github.com/repos/libstorage/libstoragemgmt/pulls/comments/59748767","id":59748767,"diff_hunk":"@@ -104,6 +104,56 @@ int LSM_DLL_EXPORT lsm_local_disk_vpd83_get(const char *sd_path,\n int LSM_DLL_EXPORT lsm_local_disk_rpm_get(const char *disk_path, int32_t *rpm,\n                                           lsm_error **lsm_err);\n \n+/**\n+ * Query the disk link type of given disk path.\n+ * For SATA disks connected to SAS SES enclosure, will return\n+ * LSM_SCSI_LINK_TYPE_ATA.\n+ * Require permission to open /dev/sdX(root user or disk group).\n+ * New in version 1.3.\n+ * @param[in]  disk_path    String. The path of disk, example \"/dev/sdb\".\n+ * @param[out] link_type    Output pointer of lsm_disk_link_type.\n+ *                          LSM_DISK_LINK_TYPE_UNKNOWN when error.\n+ *                          Possible values are:\n+ *                              LSM_DISK_LINK_TYPE_UNKNOWN\n+ *                                  Unknown\n+ *                              LSM_DISK_LINK_TYPE_FC\n+ *                                  Fibre Channel\n+ *                              LSM_DISK_LINK_TYPE_SSA\n+ *                                  Serial Storage Architecture, Old IBM tech.\n+ *                              LSM_DISK_LINK_TYPE_SBP = 3,\n+ *                                  Serial Bus Protocol, used by IEEE 1394.\n+ *                              LSM_DISK_LINK_TYPE_SRP = 4,\n+ *                                  SCSI RDMA Protocol\n+ *                              LSM_DISK_LINK_TYPE_ISCSI = 5,\n+ *                                  Internet Small Computer System Interface\n+ *                              LSM_DISK_LINK_TYPE_SAS = 6,\n+ *                                  Serial Attached SCSI\n+ *                              LSM_DISK_LINK_TYPE_ADT = 7,\n+ *                                  Automation/Drive Interface Transport\n+ *                                  Protocol, often used by Tape.\n+ *                              LSM_DISK_LINK_TYPE_ATA = 8,\n+ *                                  PATA/IDE or SATA.\n+ *                              LSM_DISK_LINK_TYPE_USB = 9,\n+ *                                  USB disk\n+ *                              LSM_DISK_LINK_TYPE_SOP = 0xa,\n+ *                                  SCSI over PCI-E\n+ *                              LSM_DISK_LINK_TYPE_PCIE = 0xb,\n+ *                                  PCI-E, e.g. NVMe\n+ *\n+ * @param[out] lsm_err  Output pointer of lsm_error. Error message could be\n+ *                      retrieved via lsm_error_message_get(). Memory should\n+ *                      be freed by lsm_error_free().\n+ * @return LSM_ERR_OK                   On success.\n+ *         LSM_ERR_INVALID_ARGUMENT     When any argument is NULL or\n+ *                                      illegal sd_path or no enough permission.\n+ *         LSM_ERR_LIB_BUG              When something unexpected happens.\n+ *         LSM_ERR_NOT_FOUND_DISK       When provided disk path not found.\n+ *         LSM_ERR_PERMISSION_DENIED    No sufficient permission to access","path":"c_binding/include/libstoragemgmt/libstoragemgmt_local_disk.h","position":79,"original_position":48,"commit_id":"8b1a8d414fe33d4eb74546a81a58153b78cbee1a","original_commit_id":"fcd1a81f4fdc99fe0280be721a704364c14609ed","user":{"login":"tasleson","id":2520480,"avatar_url":"https://avatars.githubusercontent.com/u/2520480?v=3","gravatar_id":"","url":"https://api.github.com/users/tasleson","html_url":"https://github.com/tasleson","followers_url":"https://api.github.com/users/tasleson/followers","following_url":"https://api.github.com/users/tasleson/following{/other_user}","gists_url":"https://api.github.com/users/tasleson/gists{/gist_id}","starred_url":"https://api.github.com/users/tasleson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tasleson/subscriptions","organizations_url":"https://api.github.com/users/tasleson/orgs","repos_url":"https://api.github.com/users/tasleson/repos","events_url":"https://api.github.com/users/tasleson/events{/privacy}","received_events_url":"https://api.github.com/users/tasleson/received_events","type":"User","site_admin":false},"body":"Insufficient permission to access","created_at":"2016-04-14T16:32:22Z","updated_at":"2016-04-14T16:32:22Z","html_url":"https://github.com/libstorage/libstoragemgmt/pull/85#discussion_r59748767","pull_request_url":"https://api.github.com/repos/libstorage/libstoragemgmt/pulls/85","_links":{"self":{"href":"https://api.github.com/repos/libstorage/libstoragemgmt/pulls/comments/59748767"},"html":{"href":"https://github.com/libstorage/libstoragemgmt/pull/85#discussion_r59748767"},"pull_request":{"href":"https://api.github.com/repos/libstorage/libstoragemgmt/pulls/85"}}},"pull_request":{"url":"https://api.github.com/repos/libstorage/libstoragemgmt/pulls/85","id":55895242,"html_url":"https://github.com/libstorage/libstoragemgmt/pull/85","diff_url":"https://github.com/libstorage/libstoragemgmt/pull/85.diff","patch_url":"https://github.com/libstorage/libstoragemgmt/pull/85.patch","issue_url":"https://api.github.com/repos/libstorage/libstoragemgmt/issues/85","number":85,"state":"open","locked":false,"title":"[PATCH V4 0/17] Querying disk rotation speed and link type","user":{"login":"cathay4t","id":934948,"avatar_url":"https://avatars.githubusercontent.com/u/934948?v=3","gravatar_id":"","url":"https://api.github.com/users/cathay4t","html_url":"https://github.com/cathay4t","followers_url":"https://api.github.com/users/cathay4t/followers","following_url":"https://api.github.com/users/cathay4t/following{/other_user}","gists_url":"https://api.github.com/users/cathay4t/gists{/gist_id}","starred_url":"https://api.github.com/users/cathay4t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cathay4t/subscriptions","organizations_url":"https://api.github.com/users/cathay4t/orgs","repos_url":"https://api.github.com/users/cathay4t/repos","events_url":"https://api.github.com/users/cathay4t/events{/privacy}","received_events_url":"https://api.github.com/users/cathay4t/received_events","type":"User","site_admin":false},"body":"Hightlights:\r\n\r\n * ~~Query local disk rotation speed -- `lsm_scsi_rpm_of_disk_path()`.~~\r\n * Query local disk rotation speed -- `lsm_local_disk_rpm_get()`.\r\n * ~~Query local disk link type -- `lsm_scsi_link_type_of_disk_path()`.~~\r\n * Query local disk link type -- `lsm_local_disk_link_type_get()`.\r\n * ~~Use macro _wrapper() to remove duplicate code in `_scsi_clib.c`.~~ Already in master.\r\n * ~~New lsmcli command -- `lsmcli lsd` to list all local scsi disks.~~\r\n * New lsmcli command -- `lsmcli ldl` to list all local scsi disks.\r\n\r\nFAQ:\r\n * Why not use udev for RPM which does not need root privilege?\r\n\r\n   Udev does not support SAS disk RPM query yet.\r\n   Should we create a patch to udev or use this SCSI standard way?\r\n\r\n * Why need root privilege?\r\n\r\n   Required by SGIO IOCTL. \r\n   If kernel could expose more VPD pages (like 0xb1and 0x00) via sysfs like they do for VPD 0x83, \r\n   we don't need to do SGIO any more.\r\n\r\n * Why create your own SGIO function instead of using libsgutils2?\r\n\r\n    IMHO, libsgutils2 is too heavy for our simple use here and SGIO is not that complex.","created_at":"2016-01-13T13:10:54Z","updated_at":"2016-04-14T16:32:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b36925b7af4ca7b9010d83f291492c1c8721941","assignee":null,"milestone":{"url":"https://api.github.com/repos/libstorage/libstoragemgmt/milestones/1","html_url":"https://github.com/libstorage/libstoragemgmt/milestones/1.3","labels_url":"https://api.github.com/repos/libstorage/libstoragemgmt/milestones/1/labels","id":1137995,"number":1,"title":"1.3","description":"Planed new features:\r\n * blink LED(ident and fault) of local disk via SES.\r\n * Cache setting query(including battery status).\r\n * Local disk link type, RPM query.","creator":{"login":"cathay4t","id":934948,"avatar_url":"https://avatars.githubusercontent.com/u/934948?v=3","gravatar_id":"","url":"https://api.github.com/users/cathay4t","html_url":"https://github.com/cathay4t","followers_url":"https://api.github.com/users/cathay4t/followers","following_url":"https://api.github.com/users/cathay4t/following{/other_user}","gists_url":"https://api.github.com/users/cathay4t/gists{/gist_id}","starred_url":"https://api.github.com/users/cathay4t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cathay4t/subscriptions","organizations_url":"https://api.github.com/users/cathay4t/orgs","repos_url":"https://api.github.com/users/cathay4t/repos","events_url":"https://api.github.com/users/cathay4t/events{/privacy}","received_events_url":"https://api.github.com/users/cathay4t/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":1,"state":"open","created_at":"2015-05-28T13:45:18Z","updated_at":"2016-04-13T21:28:27Z","due_on":"2016-04-30T16:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/libstorage/libstoragemgmt/pulls/85/commits","review_comments_url":"https://api.github.com/repos/libstorage/libstoragemgmt/pulls/85/comments","review_comment_url":"https://api.github.com/repos/libstorage/libstoragemgmt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/libstorage/libstoragemgmt/issues/85/comments","statuses_url":"https://api.github.com/repos/libstorage/libstoragemgmt/statuses/8b1a8d414fe33d4eb74546a81a58153b78cbee1a","head":{"label":"cathay4t:scsi_dis_hwinfo","ref":"scsi_dis_hwinfo","sha":"8b1a8d414fe33d4eb74546a81a58153b78cbee1a","user":{"login":"cathay4t","id":934948,"avatar_url":"https://avatars.githubusercontent.com/u/934948?v=3","gravatar_id":"","url":"https://api.github.com/users/cathay4t","html_url":"https://github.com/cathay4t","followers_url":"https://api.github.com/users/cathay4t/followers","following_url":"https://api.github.com/users/cathay4t/following{/other_user}","gists_url":"https://api.github.com/users/cathay4t/gists{/gist_id}","starred_url":"https://api.github.com/users/cathay4t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cathay4t/subscriptions","organizations_url":"https://api.github.com/users/cathay4t/orgs","repos_url":"https://api.github.com/users/cathay4t/repos","events_url":"https://api.github.com/users/cathay4t/events{/privacy}","received_events_url":"https://api.github.com/users/cathay4t/received_events","type":"User","site_admin":false},"repo":{"id":32376788,"name":"libstoragemgmt","full_name":"cathay4t/libstoragemgmt","owner":{"login":"cathay4t","id":934948,"avatar_url":"https://avatars.githubusercontent.com/u/934948?v=3","gravatar_id":"","url":"https://api.github.com/users/cathay4t","html_url":"https://github.com/cathay4t","followers_url":"https://api.github.com/users/cathay4t/followers","following_url":"https://api.github.com/users/cathay4t/following{/other_user}","gists_url":"https://api.github.com/users/cathay4t/gists{/gist_id}","starred_url":"https://api.github.com/users/cathay4t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cathay4t/subscriptions","organizations_url":"https://api.github.com/users/cathay4t/orgs","repos_url":"https://api.github.com/users/cathay4t/repos","events_url":"https://api.github.com/users/cathay4t/events{/privacy}","received_events_url":"https://api.github.com/users/cathay4t/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cathay4t/libstoragemgmt","description":"A library for storage management","fork":true,"url":"https://api.github.com/repos/cathay4t/libstoragemgmt","forks_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/forks","keys_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/teams","hooks_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/hooks","issue_events_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/issues/events{/number}","events_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/events","assignees_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/assignees{/user}","branches_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/branches{/branch}","tags_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/tags","blobs_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/git/refs{/sha}","trees_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/statuses/{sha}","languages_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/languages","stargazers_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/stargazers","contributors_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/contributors","subscribers_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/subscribers","subscription_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/subscription","commits_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/commits{/sha}","git_commits_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/git/commits{/sha}","comments_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/comments{/number}","issue_comment_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/issues/comments{/number}","contents_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/contents/{+path}","compare_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/merges","archive_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/downloads","issues_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/issues{/number}","pulls_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/pulls{/number}","milestones_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/milestones{/number}","notifications_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/labels{/name}","releases_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/releases{/id}","deployments_url":"https://api.github.com/repos/cathay4t/libstoragemgmt/deployments","created_at":"2015-03-17T06:57:15Z","updated_at":"2016-01-13T05:41:50Z","pushed_at":"2016-04-14T09:43:09Z","git_url":"git://github.com/cathay4t/libstoragemgmt.git","ssh_url":"git@github.com:cathay4t/libstoragemgmt.git","clone_url":"https://github.com/cathay4t/libstoragemgmt.git","svn_url":"https://github.com/cathay4t/libstoragemgmt","homepage":"","size":3318,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"libstorage:master","ref":"master","sha":"4f3c5813cb1f0cc08cfb8e7f1d3f66f4bfd0ca11","user":{"login":"libstorage","id":11510731,"avatar_url":"https://avatars.githubusercontent.com/u/11510731?v=3","gravatar_id":"","url":"https://api.github.com/users/libstorage","html_url":"https://github.com/libstorage","followers_url":"https://api.github.com/users/libstorage/followers","following_url":"https://api.github.com/users/libstorage/following{/other_user}","gists_url":"https://api.github.com/users/libstorage/gists{/gist_id}","starred_url":"https://api.github.com/users/libstorage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libstorage/subscriptions","organizations_url":"https://api.github.com/users/libstorage/orgs","repos_url":"https://api.github.com/users/libstorage/repos","events_url":"https://api.github.com/users/libstorage/events{/privacy}","received_events_url":"https://api.github.com/users/libstorage/received_events","type":"Organization","site_admin":false},"repo":{"id":32356658,"name":"libstoragemgmt","full_name":"libstorage/libstoragemgmt","owner":{"login":"libstorage","id":11510731,"avatar_url":"https://avatars.githubusercontent.com/u/11510731?v=3","gravatar_id":"","url":"https://api.github.com/users/libstorage","html_url":"https://github.com/libstorage","followers_url":"https://api.github.com/users/libstorage/followers","following_url":"https://api.github.com/users/libstorage/following{/other_user}","gists_url":"https://api.github.com/users/libstorage/gists{/gist_id}","starred_url":"https://api.github.com/users/libstorage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libstorage/subscriptions","organizations_url":"https://api.github.com/users/libstorage/orgs","repos_url":"https://api.github.com/users/libstorage/repos","events_url":"https://api.github.com/users/libstorage/events{/privacy}","received_events_url":"https://api.github.com/users/libstorage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/libstorage/libstoragemgmt","description":"A library for storage management","fork":false,"url":"https://api.github.com/repos/libstorage/libstoragemgmt","forks_url":"https://api.github.com/repos/libstorage/libstoragemgmt/forks","keys_url":"https://api.github.com/repos/libstorage/libstoragemgmt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libstorage/libstoragemgmt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libstorage/libstoragemgmt/teams","hooks_url":"https://api.github.com/repos/libstorage/libstoragemgmt/hooks","issue_events_url":"https://api.github.com/repos/libstorage/libstoragemgmt/issues/events{/number}","events_url":"https://api.github.com/repos/libstorage/libstoragemgmt/events","assignees_url":"https://api.github.com/repos/libstorage/libstoragemgmt/assignees{/user}","branches_url":"https://api.github.com/repos/libstorage/libstoragemgmt/branches{/branch}","tags_url":"https://api.github.com/repos/libstorage/libstoragemgmt/tags","blobs_url":"https://api.github.com/repos/libstorage/libstoragemgmt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libstorage/libstoragemgmt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libstorage/libstoragemgmt/git/refs{/sha}","trees_url":"https://api.github.com/repos/libstorage/libstoragemgmt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libstorage/libstoragemgmt/statuses/{sha}","languages_url":"https://api.github.com/repos/libstorage/libstoragemgmt/languages","stargazers_url":"https://api.github.com/repos/libstorage/libstoragemgmt/stargazers","contributors_url":"https://api.github.com/repos/libstorage/libstoragemgmt/contributors","subscribers_url":"https://api.github.com/repos/libstorage/libstoragemgmt/subscribers","subscription_url":"https://api.github.com/repos/libstorage/libstoragemgmt/subscription","commits_url":"https://api.github.com/repos/libstorage/libstoragemgmt/commits{/sha}","git_commits_url":"https://api.github.com/repos/libstorage/libstoragemgmt/git/commits{/sha}","comments_url":"https://api.github.com/repos/libstorage/libstoragemgmt/comments{/number}","issue_comment_url":"https://api.github.com/repos/libstorage/libstoragemgmt/issues/comments{/number}","contents_url":"https://api.github.com/repos/libstorage/libstoragemgmt/contents/{+path}","compare_url":"https://api.github.com/repos/libstorage/libstoragemgmt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libstorage/libstoragemgmt/merges","archive_url":"https://api.github.com/repos/libstorage/libstoragemgmt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libstorage/libstoragemgmt/downloads","issues_url":"https://api.github.com/repos/libstorage/libstoragemgmt/issues{/number}","pulls_url":"https://api.github.com/repos/libstorage/libstoragemgmt/pulls{/number}","milestones_url":"https://api.github.com/repos/libstorage/libstoragemgmt/milestones{/number}","notifications_url":"https://api.github.com/repos/libstorage/libstoragemgmt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libstorage/libstoragemgmt/labels{/name}","releases_url":"https://api.github.com/repos/libstorage/libstoragemgmt/releases{/id}","deployments_url":"https://api.github.com/repos/libstorage/libstoragemgmt/deployments","created_at":"2015-03-16T22:25:25Z","updated_at":"2016-03-16T07:55:29Z","pushed_at":"2016-04-14T09:43:09Z","git_url":"git://github.com/libstorage/libstoragemgmt.git","ssh_url":"git@github.com:libstorage/libstoragemgmt.git","clone_url":"https://github.com/libstorage/libstoragemgmt.git","svn_url":"https://github.com/libstorage/libstoragemgmt","homepage":"","size":3570,"stargazers_count":16,"watchers_count":16,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":20,"forks":10,"open_issues":20,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/libstorage/libstoragemgmt/pulls/85"},"html":{"href":"https://github.com/libstorage/libstoragemgmt/pull/85"},"issue":{"href":"https://api.github.com/repos/libstorage/libstoragemgmt/issues/85"},"comments":{"href":"https://api.github.com/repos/libstorage/libstoragemgmt/issues/85/comments"},"review_comments":{"href":"https://api.github.com/repos/libstorage/libstoragemgmt/pulls/85/comments"},"review_comment":{"href":"https://api.github.com/repos/libstorage/libstoragemgmt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/libstorage/libstoragemgmt/pulls/85/commits"},"statuses":{"href":"https://api.github.com/repos/libstorage/libstoragemgmt/statuses/8b1a8d414fe33d4eb74546a81a58153b78cbee1a"}}}}