{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/78525507","id":78525507,"diff_hunk":"@@ -1227,6 +1227,49 @@ void md_config_t::diff(\n   }\n }\n \n+void md_config_t::diff_setting(const md_config_t *other, \n+            map<string, pair<string, string>> *diff, \n+            const string& ceph_setting, bool show_unchanged)\n+{\n+  Mutex::Locker l(lock);\n+\n+  char local_buf[4096];\n+  char other_buf[4096];\n+  for (int i = 0; i < NUM_CONFIG_OPTIONS; i++) {\n+    config_option *opt = &config_optionsp[i];\n+    std::string ceph_setting_name(opt->name);\n+    if (ceph_setting == ceph_setting_name) {\n+      memset(local_buf, 0, sizeof(local_buf));\n+      memset(other_buf, 0, sizeof(other_buf));\n+\n+      char *other_val = other_buf;\n+      int err = other->get_val(opt->name, &other_val, sizeof(other_buf));\n+      if (err < 0) {\n+        continue;\n+      } \n+\n+      char *local_val = local_buf;\n+      err = _get_val(opt->name, &local_val, sizeof(local_buf));\n+      if (err != 0) {\n+        continue;\n+      } \n+      if (strcmp(local_val, other_val)) {\n+        diff->insert(make_pair(opt->name, make_pair(local_val, other_val)));\n+      }   \n+      else {\n+        if (show_unchanged) {\n+          diff->insert(make_pair(opt->name, make_pair(local_val, other_val)));\n+        }\n+      } \n+      //-- If we already found it, we are done.\n+      break;  \n+    } //-- if (ceph_setting == ceph_setting_name)\n+  } //-- for (int i = 0; i < NUM_CONFIG_OPTIONS; i++)\n+} /* void md_config_t::diff_setting(const md_config_t *other, ","path":"src/common/config.cc","position":42,"original_position":42,"commit_id":"bd555427f38654f1254b7a012d18d4c19bbc93ad","original_commit_id":"bd555427f38654f1254b7a012d18d4c19bbc93ad","user":{"login":"tchaikov","id":59071,"avatar_url":"https://avatars.githubusercontent.com/u/59071?v=3","gravatar_id":"","url":"https://api.github.com/users/tchaikov","html_url":"https://github.com/tchaikov","followers_url":"https://api.github.com/users/tchaikov/followers","following_url":"https://api.github.com/users/tchaikov/following{/other_user}","gists_url":"https://api.github.com/users/tchaikov/gists{/gist_id}","starred_url":"https://api.github.com/users/tchaikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchaikov/subscriptions","organizations_url":"https://api.github.com/users/tchaikov/orgs","repos_url":"https://api.github.com/users/tchaikov/repos","events_url":"https://api.github.com/users/tchaikov/events{/privacy}","received_events_url":"https://api.github.com/users/tchaikov/received_events","type":"User","site_admin":false},"body":"could you remove the comments?","created_at":"2016-09-13T09:30:15Z","updated_at":"2016-09-13T09:30:15Z","html_url":"https://github.com/ceph/ceph/pull/10736#discussion_r78525507","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/10736","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/78525507"},"html":{"href":"https://github.com/ceph/ceph/pull/10736#discussion_r78525507"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/10736"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/10736","id":81389857,"html_url":"https://github.com/ceph/ceph/pull/10736","diff_url":"https://github.com/ceph/ceph/pull/10736.diff","patch_url":"https://github.com/ceph/ceph/pull/10736.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/10736","number":10736,"state":"open","locked":false,"title":"common/ceph_context: 'config diff get' option added","user":{"login":"oliveiradan","id":3721708,"avatar_url":"https://avatars.githubusercontent.com/u/3721708?v=3","gravatar_id":"","url":"https://api.github.com/users/oliveiradan","html_url":"https://github.com/oliveiradan","followers_url":"https://api.github.com/users/oliveiradan/followers","following_url":"https://api.github.com/users/oliveiradan/following{/other_user}","gists_url":"https://api.github.com/users/oliveiradan/gists{/gist_id}","starred_url":"https://api.github.com/users/oliveiradan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliveiradan/subscriptions","organizations_url":"https://api.github.com/users/oliveiradan/orgs","repos_url":"https://api.github.com/users/oliveiradan/repos","events_url":"https://api.github.com/users/oliveiradan/events{/privacy}","received_events_url":"https://api.github.com/users/oliveiradan/received_events","type":"User","site_admin":false},"body":"This is a feature request from Sebastien (on our ceph-devel list) so we can get the 'diff (current and default) of an config option': # config diff get mon_data_avail_warn \r\n(1):\r\n./ceph --admin-daemon out/osd.1.asok config diff get mon_data_avail_crit \r\n{\r\n    \"diff\": {\r\n        \"current\": {\r\n            \"mon_data_avail_crit\": \"1\"\r\n        },\r\n        \"defaults\": {\r\n            \"mon_data_avail_crit\": \"5\"\r\n        }\r\n    },\r\n    \"unknown\": []\r\n}\r\n\r\n(2):\r\n./ceph --admin-daemon out/osd.1.asok config diff get mon_data_avail_warn\r\n{\r\n    \"diff\": {\r\n        \"current\": {\r\n            \"mon_data_avail_warn\": \"10\"\r\n        },\r\n        \"defaults\": {\r\n            \"mon_data_avail_warn\": \"30\"\r\n        }\r\n    },\r\n    \"unknown\": []\r\n}\r\n\r\n(3): \r\n ./ceph --admin-daemon out/osd.1.asok config diff get num_client\r\n{\r\n    \"diff\": {\r\n        \"current\": {\r\n            \"num_client\": \"1\"\r\n        },\r\n        \"defaults\": {\r\n            \"num_client\": \"1\"\r\n        }\r\n    },\r\n    \"unknown\": []\r\n}\r\n","created_at":"2016-08-15T23:00:01Z","updated_at":"2016-09-13T09:30:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76065051e628013ee128a6f160c436602f02712f","assignee":{"login":"tchaikov","id":59071,"avatar_url":"https://avatars.githubusercontent.com/u/59071?v=3","gravatar_id":"","url":"https://api.github.com/users/tchaikov","html_url":"https://github.com/tchaikov","followers_url":"https://api.github.com/users/tchaikov/followers","following_url":"https://api.github.com/users/tchaikov/following{/other_user}","gists_url":"https://api.github.com/users/tchaikov/gists{/gist_id}","starred_url":"https://api.github.com/users/tchaikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchaikov/subscriptions","organizations_url":"https://api.github.com/users/tchaikov/orgs","repos_url":"https://api.github.com/users/tchaikov/repos","events_url":"https://api.github.com/users/tchaikov/events{/privacy}","received_events_url":"https://api.github.com/users/tchaikov/received_events","type":"User","site_admin":false},"assignees":[{"login":"tchaikov","id":59071,"avatar_url":"https://avatars.githubusercontent.com/u/59071?v=3","gravatar_id":"","url":"https://api.github.com/users/tchaikov","html_url":"https://github.com/tchaikov","followers_url":"https://api.github.com/users/tchaikov/followers","following_url":"https://api.github.com/users/tchaikov/following{/other_user}","gists_url":"https://api.github.com/users/tchaikov/gists{/gist_id}","starred_url":"https://api.github.com/users/tchaikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchaikov/subscriptions","organizations_url":"https://api.github.com/users/tchaikov/orgs","repos_url":"https://api.github.com/users/tchaikov/repos","events_url":"https://api.github.com/users/tchaikov/events{/privacy}","received_events_url":"https://api.github.com/users/tchaikov/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/10736/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/10736/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/10736/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/bd555427f38654f1254b7a012d18d4c19bbc93ad","head":{"label":"oliveiradan:SebastienHan_config_diff_get_fr","ref":"SebastienHan_config_diff_get_fr","sha":"bd555427f38654f1254b7a012d18d4c19bbc93ad","user":{"login":"oliveiradan","id":3721708,"avatar_url":"https://avatars.githubusercontent.com/u/3721708?v=3","gravatar_id":"","url":"https://api.github.com/users/oliveiradan","html_url":"https://github.com/oliveiradan","followers_url":"https://api.github.com/users/oliveiradan/followers","following_url":"https://api.github.com/users/oliveiradan/following{/other_user}","gists_url":"https://api.github.com/users/oliveiradan/gists{/gist_id}","starred_url":"https://api.github.com/users/oliveiradan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliveiradan/subscriptions","organizations_url":"https://api.github.com/users/oliveiradan/orgs","repos_url":"https://api.github.com/users/oliveiradan/repos","events_url":"https://api.github.com/users/oliveiradan/events{/privacy}","received_events_url":"https://api.github.com/users/oliveiradan/received_events","type":"User","site_admin":false},"repo":{"id":52079037,"name":"ceph","full_name":"oliveiradan/ceph","owner":{"login":"oliveiradan","id":3721708,"avatar_url":"https://avatars.githubusercontent.com/u/3721708?v=3","gravatar_id":"","url":"https://api.github.com/users/oliveiradan","html_url":"https://github.com/oliveiradan","followers_url":"https://api.github.com/users/oliveiradan/followers","following_url":"https://api.github.com/users/oliveiradan/following{/other_user}","gists_url":"https://api.github.com/users/oliveiradan/gists{/gist_id}","starred_url":"https://api.github.com/users/oliveiradan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliveiradan/subscriptions","organizations_url":"https://api.github.com/users/oliveiradan/orgs","repos_url":"https://api.github.com/users/oliveiradan/repos","events_url":"https://api.github.com/users/oliveiradan/events{/privacy}","received_events_url":"https://api.github.com/users/oliveiradan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oliveiradan/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/oliveiradan/ceph","forks_url":"https://api.github.com/repos/oliveiradan/ceph/forks","keys_url":"https://api.github.com/repos/oliveiradan/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oliveiradan/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oliveiradan/ceph/teams","hooks_url":"https://api.github.com/repos/oliveiradan/ceph/hooks","issue_events_url":"https://api.github.com/repos/oliveiradan/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/oliveiradan/ceph/events","assignees_url":"https://api.github.com/repos/oliveiradan/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/oliveiradan/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/oliveiradan/ceph/tags","blobs_url":"https://api.github.com/repos/oliveiradan/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oliveiradan/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oliveiradan/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/oliveiradan/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oliveiradan/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/oliveiradan/ceph/languages","stargazers_url":"https://api.github.com/repos/oliveiradan/ceph/stargazers","contributors_url":"https://api.github.com/repos/oliveiradan/ceph/contributors","subscribers_url":"https://api.github.com/repos/oliveiradan/ceph/subscribers","subscription_url":"https://api.github.com/repos/oliveiradan/ceph/subscription","commits_url":"https://api.github.com/repos/oliveiradan/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/oliveiradan/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/oliveiradan/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/oliveiradan/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/oliveiradan/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/oliveiradan/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oliveiradan/ceph/merges","archive_url":"https://api.github.com/repos/oliveiradan/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oliveiradan/ceph/downloads","issues_url":"https://api.github.com/repos/oliveiradan/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/oliveiradan/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/oliveiradan/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/oliveiradan/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oliveiradan/ceph/labels{/name}","releases_url":"https://api.github.com/repos/oliveiradan/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/oliveiradan/ceph/deployments","created_at":"2016-02-19T10:03:52Z","updated_at":"2016-02-19T10:04:09Z","pushed_at":"2016-09-08T05:55:12Z","git_url":"git://github.com/oliveiradan/ceph.git","ssh_url":"git@github.com:oliveiradan/ceph.git","clone_url":"https://github.com/oliveiradan/ceph.git","svn_url":"https://github.com/oliveiradan/ceph","homepage":"http://ceph.com","size":174195,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"ceph:master","ref":"master","sha":"f8abb628a440951833b7d81d834a6aef5a651920","user":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"repo":{"id":2310495,"name":"ceph","full_name":"ceph/ceph","owner":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ceph/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":false,"url":"https://api.github.com/repos/ceph/ceph","forks_url":"https://api.github.com/repos/ceph/ceph/forks","keys_url":"https://api.github.com/repos/ceph/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/ceph/teams","hooks_url":"https://api.github.com/repos/ceph/ceph/hooks","issue_events_url":"https://api.github.com/repos/ceph/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/ceph/events","assignees_url":"https://api.github.com/repos/ceph/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/ceph/tags","blobs_url":"https://api.github.com/repos/ceph/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/ceph/languages","stargazers_url":"https://api.github.com/repos/ceph/ceph/stargazers","contributors_url":"https://api.github.com/repos/ceph/ceph/contributors","subscribers_url":"https://api.github.com/repos/ceph/ceph/subscribers","subscription_url":"https://api.github.com/repos/ceph/ceph/subscription","commits_url":"https://api.github.com/repos/ceph/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceph/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/ceph/merges","archive_url":"https://api.github.com/repos/ceph/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/ceph/downloads","issues_url":"https://api.github.com/repos/ceph/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/ceph/labels{/name}","releases_url":"https://api.github.com/repos/ceph/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/ceph/ceph/deployments","created_at":"2011-09-01T21:41:26Z","updated_at":"2016-09-13T08:36:11Z","pushed_at":"2016-09-13T08:46:29Z","git_url":"git://github.com/ceph/ceph.git","ssh_url":"git@github.com:ceph/ceph.git","clone_url":"https://github.com/ceph/ceph.git","svn_url":"https://github.com/ceph/ceph","homepage":"http://ceph.com","size":240051,"stargazers_count":2470,"watchers_count":2470,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1454,"mirror_url":null,"open_issues_count":441,"forks":1454,"open_issues":441,"watchers":2470,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/10736"},"html":{"href":"https://github.com/ceph/ceph/pull/10736"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/10736"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/10736/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/10736/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/10736/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/bd555427f38654f1254b7a012d18d4c19bbc93ad"}}}}
{"actor":{"display_login":"tchaikov"}}