{"action":"created","comment":{"url":"https://api.github.com/repos/openSUSE/snapper/pulls/comments/40078074","id":40078074,"diff_hunk":"@@ -0,0 +1,420 @@\n+/*\n+ * Copyright (c) [2015] SUSE LLC\n+ *\n+ * All Rights Reserved.\n+ *\n+ * This program is free software; you can redistribute it and/or modify it\n+ * under the terms of version 2 of the GNU General Public License as published\n+ * by the Free Software Foundation.\n+ *\n+ * This program is distributed in the hope that it will be useful, but WITHOUT\n+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\n+ * more details.\n+ *\n+ * You should have received a copy of the GNU General Public License along\n+ * with this program; if not, contact Novell, Inc.\n+ *\n+ * To contact Novell about this file by physical or electronic mail, you may\n+ * find current contact information at www.novell.com.\n+ */\n+\n+\n+#include <string.h>\n+#include <unistd.h>\n+#include <sys/types.h>\n+#include <sys/stat.h>\n+#include <ext2fs/ext2_fs.h>\n+#include <fcntl.h>\n+#include <sys/ioctl.h>\n+\n+#include <iostream>\n+#include <boost/algorithm/string.hpp>\n+\n+#include \"snapper/BtrfsUtils.h\"\n+#include \"snapper/AppUtil.h\"\n+#include \"snapper/MntTable.h\"\n+#include \"utils/GetOpts.h\"\n+\n+\n+using namespace snapper;\n+using namespace BtrfsUtils;\n+\n+\n+string target;\n+\n+bool set_nocow = false;\n+bool verbose = false;\n+\n+\n+void\n+do_tmp_mount(const libmnt_fs* fs, const char* tmp_mountpoint, const string& subvol_option)\n+{\n+    if (verbose)\n+\tcout << \"do-tmp-mount\" << endl;\n+\n+    libmnt_fs* x = mnt_copy_fs(NULL, fs);\n+    if (!x)\n+\tthrow runtime_error(\"mnt_copy_fs failed\");\n+\n+    struct libmnt_context* cxt = mnt_new_context();\n+    mnt_context_set_fs(cxt, x);\n+    mnt_context_set_target(cxt, tmp_mountpoint);\n+    if (!subvol_option.empty())\n+\tmnt_context_set_options(cxt, (\"subvol=\" + subvol_option).c_str());\n+    else\n+\tmnt_context_set_options(cxt, \"subvolid=5\");","path":"client/mksubvolume.cc","position":66,"original_position":66,"commit_id":"2013387501bbc5c0ddec5a72a576e52393e2fd56","original_commit_id":"2013387501bbc5c0ddec5a72a576e52393e2fd56","user":{"login":"aschnell","id":908062,"avatar_url":"https://avatars.githubusercontent.com/u/908062?v=3","gravatar_id":"","url":"https://api.github.com/users/aschnell","html_url":"https://github.com/aschnell","followers_url":"https://api.github.com/users/aschnell/followers","following_url":"https://api.github.com/users/aschnell/following{/other_user}","gists_url":"https://api.github.com/users/aschnell/gists{/gist_id}","starred_url":"https://api.github.com/users/aschnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aschnell/subscriptions","organizations_url":"https://api.github.com/users/aschnell/orgs","repos_url":"https://api.github.com/users/aschnell/repos","events_url":"https://api.github.com/users/aschnell/events{/privacy}","received_events_url":"https://api.github.com/users/aschnell/received_events","type":"User","site_admin":false},"body":"Yes, that is the initially top-level subvolume with btrfs.","created_at":"2015-09-22T12:07:39Z","updated_at":"2015-09-22T12:07:39Z","html_url":"https://github.com/openSUSE/snapper/pull/198#discussion_r40078074","pull_request_url":"https://api.github.com/repos/openSUSE/snapper/pulls/198","_links":{"self":{"href":"https://api.github.com/repos/openSUSE/snapper/pulls/comments/40078074"},"html":{"href":"https://github.com/openSUSE/snapper/pull/198#discussion_r40078074"},"pull_request":{"href":"https://api.github.com/repos/openSUSE/snapper/pulls/198"}}},"pull_request":{"url":"https://api.github.com/repos/openSUSE/snapper/pulls/198","id":45647551,"html_url":"https://github.com/openSUSE/snapper/pull/198","diff_url":"https://github.com/openSUSE/snapper/pull/198.diff","patch_url":"https://github.com/openSUSE/snapper/pull/198.patch","issue_url":"https://api.github.com/repos/openSUSE/snapper/issues/198","number":198,"state":"open","locked":false,"title":"- added program to create a subvolume","user":{"login":"aschnell","id":908062,"avatar_url":"https://avatars.githubusercontent.com/u/908062?v=3","gravatar_id":"","url":"https://api.github.com/users/aschnell","html_url":"https://github.com/aschnell","followers_url":"https://api.github.com/users/aschnell/followers","following_url":"https://api.github.com/users/aschnell/following{/other_user}","gists_url":"https://api.github.com/users/aschnell/gists{/gist_id}","starred_url":"https://api.github.com/users/aschnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aschnell/subscriptions","organizations_url":"https://api.github.com/users/aschnell/orgs","repos_url":"https://api.github.com/users/aschnell/repos","events_url":"https://api.github.com/users/aschnell/events{/privacy}","received_events_url":"https://api.github.com/users/aschnell/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-22T10:28:37Z","updated_at":"2015-09-22T12:07:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a02349996cb069ac6836ec015a9391b2c2b3bce8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openSUSE/snapper/pulls/198/commits","review_comments_url":"https://api.github.com/repos/openSUSE/snapper/pulls/198/comments","review_comment_url":"https://api.github.com/repos/openSUSE/snapper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openSUSE/snapper/issues/198/comments","statuses_url":"https://api.github.com/repos/openSUSE/snapper/statuses/2013387501bbc5c0ddec5a72a576e52393e2fd56","head":{"label":"aschnell:master","ref":"master","sha":"2013387501bbc5c0ddec5a72a576e52393e2fd56","user":{"login":"aschnell","id":908062,"avatar_url":"https://avatars.githubusercontent.com/u/908062?v=3","gravatar_id":"","url":"https://api.github.com/users/aschnell","html_url":"https://github.com/aschnell","followers_url":"https://api.github.com/users/aschnell/followers","following_url":"https://api.github.com/users/aschnell/following{/other_user}","gists_url":"https://api.github.com/users/aschnell/gists{/gist_id}","starred_url":"https://api.github.com/users/aschnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aschnell/subscriptions","organizations_url":"https://api.github.com/users/aschnell/orgs","repos_url":"https://api.github.com/users/aschnell/repos","events_url":"https://api.github.com/users/aschnell/events{/privacy}","received_events_url":"https://api.github.com/users/aschnell/received_events","type":"User","site_admin":false},"repo":{"id":34064484,"name":"snapper","full_name":"aschnell/snapper","owner":{"login":"aschnell","id":908062,"avatar_url":"https://avatars.githubusercontent.com/u/908062?v=3","gravatar_id":"","url":"https://api.github.com/users/aschnell","html_url":"https://github.com/aschnell","followers_url":"https://api.github.com/users/aschnell/followers","following_url":"https://api.github.com/users/aschnell/following{/other_user}","gists_url":"https://api.github.com/users/aschnell/gists{/gist_id}","starred_url":"https://api.github.com/users/aschnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aschnell/subscriptions","organizations_url":"https://api.github.com/users/aschnell/orgs","repos_url":"https://api.github.com/users/aschnell/repos","events_url":"https://api.github.com/users/aschnell/events{/privacy}","received_events_url":"https://api.github.com/users/aschnell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aschnell/snapper","description":"Manage filesystem snapshots and allow undo of system modifications","fork":true,"url":"https://api.github.com/repos/aschnell/snapper","forks_url":"https://api.github.com/repos/aschnell/snapper/forks","keys_url":"https://api.github.com/repos/aschnell/snapper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aschnell/snapper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aschnell/snapper/teams","hooks_url":"https://api.github.com/repos/aschnell/snapper/hooks","issue_events_url":"https://api.github.com/repos/aschnell/snapper/issues/events{/number}","events_url":"https://api.github.com/repos/aschnell/snapper/events","assignees_url":"https://api.github.com/repos/aschnell/snapper/assignees{/user}","branches_url":"https://api.github.com/repos/aschnell/snapper/branches{/branch}","tags_url":"https://api.github.com/repos/aschnell/snapper/tags","blobs_url":"https://api.github.com/repos/aschnell/snapper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aschnell/snapper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aschnell/snapper/git/refs{/sha}","trees_url":"https://api.github.com/repos/aschnell/snapper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aschnell/snapper/statuses/{sha}","languages_url":"https://api.github.com/repos/aschnell/snapper/languages","stargazers_url":"https://api.github.com/repos/aschnell/snapper/stargazers","contributors_url":"https://api.github.com/repos/aschnell/snapper/contributors","subscribers_url":"https://api.github.com/repos/aschnell/snapper/subscribers","subscription_url":"https://api.github.com/repos/aschnell/snapper/subscription","commits_url":"https://api.github.com/repos/aschnell/snapper/commits{/sha}","git_commits_url":"https://api.github.com/repos/aschnell/snapper/git/commits{/sha}","comments_url":"https://api.github.com/repos/aschnell/snapper/comments{/number}","issue_comment_url":"https://api.github.com/repos/aschnell/snapper/issues/comments{/number}","contents_url":"https://api.github.com/repos/aschnell/snapper/contents/{+path}","compare_url":"https://api.github.com/repos/aschnell/snapper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aschnell/snapper/merges","archive_url":"https://api.github.com/repos/aschnell/snapper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aschnell/snapper/downloads","issues_url":"https://api.github.com/repos/aschnell/snapper/issues{/number}","pulls_url":"https://api.github.com/repos/aschnell/snapper/pulls{/number}","milestones_url":"https://api.github.com/repos/aschnell/snapper/milestones{/number}","notifications_url":"https://api.github.com/repos/aschnell/snapper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aschnell/snapper/labels{/name}","releases_url":"https://api.github.com/repos/aschnell/snapper/releases{/id}","created_at":"2015-04-16T15:36:32Z","updated_at":"2015-05-05T13:34:48Z","pushed_at":"2015-09-22T10:22:55Z","git_url":"git://github.com/aschnell/snapper.git","ssh_url":"git@github.com:aschnell/snapper.git","clone_url":"https://github.com/aschnell/snapper.git","svn_url":"https://github.com/aschnell/snapper","homepage":"http://snapper.io/","size":3339,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openSUSE:master","ref":"master","sha":"1f64deb4a1a6743501ea0275ccf79f63d2cecf95","user":{"login":"openSUSE","id":623819,"avatar_url":"https://avatars.githubusercontent.com/u/623819?v=3","gravatar_id":"","url":"https://api.github.com/users/openSUSE","html_url":"https://github.com/openSUSE","followers_url":"https://api.github.com/users/openSUSE/followers","following_url":"https://api.github.com/users/openSUSE/following{/other_user}","gists_url":"https://api.github.com/users/openSUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/openSUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openSUSE/subscriptions","organizations_url":"https://api.github.com/users/openSUSE/orgs","repos_url":"https://api.github.com/users/openSUSE/repos","events_url":"https://api.github.com/users/openSUSE/events{/privacy}","received_events_url":"https://api.github.com/users/openSUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":4086360,"name":"snapper","full_name":"openSUSE/snapper","owner":{"login":"openSUSE","id":623819,"avatar_url":"https://avatars.githubusercontent.com/u/623819?v=3","gravatar_id":"","url":"https://api.github.com/users/openSUSE","html_url":"https://github.com/openSUSE","followers_url":"https://api.github.com/users/openSUSE/followers","following_url":"https://api.github.com/users/openSUSE/following{/other_user}","gists_url":"https://api.github.com/users/openSUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/openSUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openSUSE/subscriptions","organizations_url":"https://api.github.com/users/openSUSE/orgs","repos_url":"https://api.github.com/users/openSUSE/repos","events_url":"https://api.github.com/users/openSUSE/events{/privacy}","received_events_url":"https://api.github.com/users/openSUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openSUSE/snapper","description":"Manage filesystem snapshots and allow undo of system modifications","fork":false,"url":"https://api.github.com/repos/openSUSE/snapper","forks_url":"https://api.github.com/repos/openSUSE/snapper/forks","keys_url":"https://api.github.com/repos/openSUSE/snapper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openSUSE/snapper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openSUSE/snapper/teams","hooks_url":"https://api.github.com/repos/openSUSE/snapper/hooks","issue_events_url":"https://api.github.com/repos/openSUSE/snapper/issues/events{/number}","events_url":"https://api.github.com/repos/openSUSE/snapper/events","assignees_url":"https://api.github.com/repos/openSUSE/snapper/assignees{/user}","branches_url":"https://api.github.com/repos/openSUSE/snapper/branches{/branch}","tags_url":"https://api.github.com/repos/openSUSE/snapper/tags","blobs_url":"https://api.github.com/repos/openSUSE/snapper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openSUSE/snapper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openSUSE/snapper/git/refs{/sha}","trees_url":"https://api.github.com/repos/openSUSE/snapper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openSUSE/snapper/statuses/{sha}","languages_url":"https://api.github.com/repos/openSUSE/snapper/languages","stargazers_url":"https://api.github.com/repos/openSUSE/snapper/stargazers","contributors_url":"https://api.github.com/repos/openSUSE/snapper/contributors","subscribers_url":"https://api.github.com/repos/openSUSE/snapper/subscribers","subscription_url":"https://api.github.com/repos/openSUSE/snapper/subscription","commits_url":"https://api.github.com/repos/openSUSE/snapper/commits{/sha}","git_commits_url":"https://api.github.com/repos/openSUSE/snapper/git/commits{/sha}","comments_url":"https://api.github.com/repos/openSUSE/snapper/comments{/number}","issue_comment_url":"https://api.github.com/repos/openSUSE/snapper/issues/comments{/number}","contents_url":"https://api.github.com/repos/openSUSE/snapper/contents/{+path}","compare_url":"https://api.github.com/repos/openSUSE/snapper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openSUSE/snapper/merges","archive_url":"https://api.github.com/repos/openSUSE/snapper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openSUSE/snapper/downloads","issues_url":"https://api.github.com/repos/openSUSE/snapper/issues{/number}","pulls_url":"https://api.github.com/repos/openSUSE/snapper/pulls{/number}","milestones_url":"https://api.github.com/repos/openSUSE/snapper/milestones{/number}","notifications_url":"https://api.github.com/repos/openSUSE/snapper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openSUSE/snapper/labels{/name}","releases_url":"https://api.github.com/repos/openSUSE/snapper/releases{/id}","created_at":"2012-04-20T12:40:55Z","updated_at":"2015-09-18T19:54:59Z","pushed_at":"2015-09-22T10:28:38Z","git_url":"git://github.com/openSUSE/snapper.git","ssh_url":"git@github.com:openSUSE/snapper.git","clone_url":"https://github.com/openSUSE/snapper.git","svn_url":"https://github.com/openSUSE/snapper","homepage":"http://snapper.io/","size":5035,"stargazers_count":134,"watchers_count":134,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":22,"mirror_url":null,"open_issues_count":29,"forks":22,"open_issues":29,"watchers":134,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openSUSE/snapper/pulls/198"},"html":{"href":"https://github.com/openSUSE/snapper/pull/198"},"issue":{"href":"https://api.github.com/repos/openSUSE/snapper/issues/198"},"comments":{"href":"https://api.github.com/repos/openSUSE/snapper/issues/198/comments"},"review_comments":{"href":"https://api.github.com/repos/openSUSE/snapper/pulls/198/comments"},"review_comment":{"href":"https://api.github.com/repos/openSUSE/snapper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openSUSE/snapper/pulls/198/commits"},"statuses":{"href":"https://api.github.com/repos/openSUSE/snapper/statuses/2013387501bbc5c0ddec5a72a576e52393e2fd56"}}}}