{"action":"created","comment":{"url":"https://api.github.com/repos/autotest/virt-test/pulls/comments/24720086","id":24720086,"diff_hunk":"@@ -1668,6 +1669,55 @@ def create_nwfilter_xml(params):\n         raise error.TestFail(\"Fail to create nwfilter XML: %s\" % detail)\n \n \n+def create_channel_xml(params, alias=False, address=False):\n+    \"\"\"\n+    Create a XML contains channel information.\n+\n+    :param params: the params for Channel slot\n+    :param alias: allow to add 'alias' slot\n+    :param address: allow to add 'address' slot\n+    \"\"\"\n+    # Create attributes dict for channel's element\n+    channel_source = {}\n+    channel_target = {}\n+    channel_alias = {}\n+    channel_address = {}\n+    channel_params = {}\n+\n+    channel_type_name = params.get(\"channel_type_name\", None)\n+    source_mode = params.get(\"source_mode\", None)\n+    source_path = params.get(\"source_path\", None)\n+    target_type = params.get(\"target_type\", None)\n+    target_name = params.get(\"target_name\", None)\n+","path":"virttest/utils_test/libvirt.py","position":32,"original_position":32,"commit_id":"2978385b7465c6f5a58b9982bb3ae186b5f145b0","original_commit_id":"2978385b7465c6f5a58b9982bb3ae186b5f145b0","user":{"login":"will-Do","id":1916899,"avatar_url":"https://avatars.githubusercontent.com/u/1916899?v=3","gravatar_id":"","url":"https://api.github.com/users/will-Do","html_url":"https://github.com/will-Do","followers_url":"https://api.github.com/users/will-Do/followers","following_url":"https://api.github.com/users/will-Do/following{/other_user}","gists_url":"https://api.github.com/users/will-Do/gists{/gist_id}","starred_url":"https://api.github.com/users/will-Do/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/will-Do/subscriptions","organizations_url":"https://api.github.com/users/will-Do/orgs","repos_url":"https://api.github.com/users/will-Do/repos","events_url":"https://api.github.com/users/will-Do/events{/privacy}","received_events_url":"https://api.github.com/users/will-Do/received_events","type":"User","site_admin":false},"body":"The default ```None``` value could be omitted, any way, it's okay for me.\r\nACKed.","created_at":"2015-02-15T06:22:39Z","updated_at":"2015-02-15T06:22:39Z","html_url":"https://github.com/autotest/virt-test/pull/2000#discussion_r24720086","pull_request_url":"https://api.github.com/repos/autotest/virt-test/pulls/2000","_links":{"self":{"href":"https://api.github.com/repos/autotest/virt-test/pulls/comments/24720086"},"html":{"href":"https://github.com/autotest/virt-test/pull/2000#discussion_r24720086"},"pull_request":{"href":"https://api.github.com/repos/autotest/virt-test/pulls/2000"}}},"pull_request":{"url":"https://api.github.com/repos/autotest/virt-test/pulls/2000","id":28786726,"html_url":"https://github.com/autotest/virt-test/pull/2000","diff_url":"https://github.com/autotest/virt-test/pull/2000.diff","patch_url":"https://github.com/autotest/virt-test/pull/2000.patch","issue_url":"https://api.github.com/repos/autotest/virt-test/issues/2000","number":2000,"state":"open","locked":false,"title":"utils_test.libvirt: add function create_channel_xml","user":{"login":"PandaWei","id":5038445,"avatar_url":"https://avatars.githubusercontent.com/u/5038445?v=3","gravatar_id":"","url":"https://api.github.com/users/PandaWei","html_url":"https://github.com/PandaWei","followers_url":"https://api.github.com/users/PandaWei/followers","following_url":"https://api.github.com/users/PandaWei/following{/other_user}","gists_url":"https://api.github.com/users/PandaWei/gists{/gist_id}","starred_url":"https://api.github.com/users/PandaWei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PandaWei/subscriptions","organizations_url":"https://api.github.com/users/PandaWei/orgs","repos_url":"https://api.github.com/users/PandaWei/repos","events_url":"https://api.github.com/users/PandaWei/events{/privacy}","received_events_url":"https://api.github.com/users/PandaWei/received_events","type":"User","site_admin":false},"body":"Extract the common that used to create channel xml file\r\nin tp-libvirt, and regard it as a common funciton","created_at":"2015-02-06T05:49:29Z","updated_at":"2015-02-15T06:22:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2af9797f5a52a864416cd6d6a45160fec6167fdd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/autotest/virt-test/pulls/2000/commits","review_comments_url":"https://api.github.com/repos/autotest/virt-test/pulls/2000/comments","review_comment_url":"https://api.github.com/repos/autotest/virt-test/pulls/comments/{number}","comments_url":"https://api.github.com/repos/autotest/virt-test/issues/2000/comments","statuses_url":"https://api.github.com/repos/autotest/virt-test/statuses/2978385b7465c6f5a58b9982bb3ae186b5f145b0","head":{"label":"PandaWei:channel","ref":"channel","sha":"2978385b7465c6f5a58b9982bb3ae186b5f145b0","user":{"login":"PandaWei","id":5038445,"avatar_url":"https://avatars.githubusercontent.com/u/5038445?v=3","gravatar_id":"","url":"https://api.github.com/users/PandaWei","html_url":"https://github.com/PandaWei","followers_url":"https://api.github.com/users/PandaWei/followers","following_url":"https://api.github.com/users/PandaWei/following{/other_user}","gists_url":"https://api.github.com/users/PandaWei/gists{/gist_id}","starred_url":"https://api.github.com/users/PandaWei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PandaWei/subscriptions","organizations_url":"https://api.github.com/users/PandaWei/orgs","repos_url":"https://api.github.com/users/PandaWei/repos","events_url":"https://api.github.com/users/PandaWei/events{/privacy}","received_events_url":"https://api.github.com/users/PandaWei/received_events","type":"User","site_admin":false},"repo":{"id":24629774,"name":"virt-test","full_name":"PandaWei/virt-test","owner":{"login":"PandaWei","id":5038445,"avatar_url":"https://avatars.githubusercontent.com/u/5038445?v=3","gravatar_id":"","url":"https://api.github.com/users/PandaWei","html_url":"https://github.com/PandaWei","followers_url":"https://api.github.com/users/PandaWei/followers","following_url":"https://api.github.com/users/PandaWei/following{/other_user}","gists_url":"https://api.github.com/users/PandaWei/gists{/gist_id}","starred_url":"https://api.github.com/users/PandaWei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PandaWei/subscriptions","organizations_url":"https://api.github.com/users/PandaWei/orgs","repos_url":"https://api.github.com/users/PandaWei/repos","events_url":"https://api.github.com/users/PandaWei/events{/privacy}","received_events_url":"https://api.github.com/users/PandaWei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PandaWei/virt-test","description":"Linux Virtualization Tests","fork":true,"url":"https://api.github.com/repos/PandaWei/virt-test","forks_url":"https://api.github.com/repos/PandaWei/virt-test/forks","keys_url":"https://api.github.com/repos/PandaWei/virt-test/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PandaWei/virt-test/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PandaWei/virt-test/teams","hooks_url":"https://api.github.com/repos/PandaWei/virt-test/hooks","issue_events_url":"https://api.github.com/repos/PandaWei/virt-test/issues/events{/number}","events_url":"https://api.github.com/repos/PandaWei/virt-test/events","assignees_url":"https://api.github.com/repos/PandaWei/virt-test/assignees{/user}","branches_url":"https://api.github.com/repos/PandaWei/virt-test/branches{/branch}","tags_url":"https://api.github.com/repos/PandaWei/virt-test/tags","blobs_url":"https://api.github.com/repos/PandaWei/virt-test/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PandaWei/virt-test/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PandaWei/virt-test/git/refs{/sha}","trees_url":"https://api.github.com/repos/PandaWei/virt-test/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PandaWei/virt-test/statuses/{sha}","languages_url":"https://api.github.com/repos/PandaWei/virt-test/languages","stargazers_url":"https://api.github.com/repos/PandaWei/virt-test/stargazers","contributors_url":"https://api.github.com/repos/PandaWei/virt-test/contributors","subscribers_url":"https://api.github.com/repos/PandaWei/virt-test/subscribers","subscription_url":"https://api.github.com/repos/PandaWei/virt-test/subscription","commits_url":"https://api.github.com/repos/PandaWei/virt-test/commits{/sha}","git_commits_url":"https://api.github.com/repos/PandaWei/virt-test/git/commits{/sha}","comments_url":"https://api.github.com/repos/PandaWei/virt-test/comments{/number}","issue_comment_url":"https://api.github.com/repos/PandaWei/virt-test/issues/comments/{number}","contents_url":"https://api.github.com/repos/PandaWei/virt-test/contents/{+path}","compare_url":"https://api.github.com/repos/PandaWei/virt-test/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PandaWei/virt-test/merges","archive_url":"https://api.github.com/repos/PandaWei/virt-test/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PandaWei/virt-test/downloads","issues_url":"https://api.github.com/repos/PandaWei/virt-test/issues{/number}","pulls_url":"https://api.github.com/repos/PandaWei/virt-test/pulls{/number}","milestones_url":"https://api.github.com/repos/PandaWei/virt-test/milestones{/number}","notifications_url":"https://api.github.com/repos/PandaWei/virt-test/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PandaWei/virt-test/labels{/name}","releases_url":"https://api.github.com/repos/PandaWei/virt-test/releases{/id}","created_at":"2014-09-30T08:05:30Z","updated_at":"2014-10-10T09:05:59Z","pushed_at":"2015-02-15T06:14:20Z","git_url":"git://github.com/PandaWei/virt-test.git","ssh_url":"git@github.com:PandaWei/virt-test.git","clone_url":"https://github.com/PandaWei/virt-test.git","svn_url":"https://github.com/PandaWei/virt-test","homepage":"http://virt-test.readthedocs.org/en/latest/","size":17848,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"autotest:master","ref":"master","sha":"8876804936350832435eef86a52b74060cd8f747","user":{"login":"autotest","id":472856,"avatar_url":"https://avatars.githubusercontent.com/u/472856?v=3","gravatar_id":"","url":"https://api.github.com/users/autotest","html_url":"https://github.com/autotest","followers_url":"https://api.github.com/users/autotest/followers","following_url":"https://api.github.com/users/autotest/following{/other_user}","gists_url":"https://api.github.com/users/autotest/gists{/gist_id}","starred_url":"https://api.github.com/users/autotest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autotest/subscriptions","organizations_url":"https://api.github.com/users/autotest/orgs","repos_url":"https://api.github.com/users/autotest/repos","events_url":"https://api.github.com/users/autotest/events{/privacy}","received_events_url":"https://api.github.com/users/autotest/received_events","type":"Organization","site_admin":false},"repo":{"id":5952670,"name":"virt-test","full_name":"autotest/virt-test","owner":{"login":"autotest","id":472856,"avatar_url":"https://avatars.githubusercontent.com/u/472856?v=3","gravatar_id":"","url":"https://api.github.com/users/autotest","html_url":"https://github.com/autotest","followers_url":"https://api.github.com/users/autotest/followers","following_url":"https://api.github.com/users/autotest/following{/other_user}","gists_url":"https://api.github.com/users/autotest/gists{/gist_id}","starred_url":"https://api.github.com/users/autotest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autotest/subscriptions","organizations_url":"https://api.github.com/users/autotest/orgs","repos_url":"https://api.github.com/users/autotest/repos","events_url":"https://api.github.com/users/autotest/events{/privacy}","received_events_url":"https://api.github.com/users/autotest/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/autotest/virt-test","description":"Linux Virtualization Tests","fork":false,"url":"https://api.github.com/repos/autotest/virt-test","forks_url":"https://api.github.com/repos/autotest/virt-test/forks","keys_url":"https://api.github.com/repos/autotest/virt-test/keys{/key_id}","collaborators_url":"https://api.github.com/repos/autotest/virt-test/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/autotest/virt-test/teams","hooks_url":"https://api.github.com/repos/autotest/virt-test/hooks","issue_events_url":"https://api.github.com/repos/autotest/virt-test/issues/events{/number}","events_url":"https://api.github.com/repos/autotest/virt-test/events","assignees_url":"https://api.github.com/repos/autotest/virt-test/assignees{/user}","branches_url":"https://api.github.com/repos/autotest/virt-test/branches{/branch}","tags_url":"https://api.github.com/repos/autotest/virt-test/tags","blobs_url":"https://api.github.com/repos/autotest/virt-test/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/autotest/virt-test/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/autotest/virt-test/git/refs{/sha}","trees_url":"https://api.github.com/repos/autotest/virt-test/git/trees{/sha}","statuses_url":"https://api.github.com/repos/autotest/virt-test/statuses/{sha}","languages_url":"https://api.github.com/repos/autotest/virt-test/languages","stargazers_url":"https://api.github.com/repos/autotest/virt-test/stargazers","contributors_url":"https://api.github.com/repos/autotest/virt-test/contributors","subscribers_url":"https://api.github.com/repos/autotest/virt-test/subscribers","subscription_url":"https://api.github.com/repos/autotest/virt-test/subscription","commits_url":"https://api.github.com/repos/autotest/virt-test/commits{/sha}","git_commits_url":"https://api.github.com/repos/autotest/virt-test/git/commits{/sha}","comments_url":"https://api.github.com/repos/autotest/virt-test/comments{/number}","issue_comment_url":"https://api.github.com/repos/autotest/virt-test/issues/comments/{number}","contents_url":"https://api.github.com/repos/autotest/virt-test/contents/{+path}","compare_url":"https://api.github.com/repos/autotest/virt-test/compare/{base}...{head}","merges_url":"https://api.github.com/repos/autotest/virt-test/merges","archive_url":"https://api.github.com/repos/autotest/virt-test/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/autotest/virt-test/downloads","issues_url":"https://api.github.com/repos/autotest/virt-test/issues{/number}","pulls_url":"https://api.github.com/repos/autotest/virt-test/pulls{/number}","milestones_url":"https://api.github.com/repos/autotest/virt-test/milestones{/number}","notifications_url":"https://api.github.com/repos/autotest/virt-test/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/autotest/virt-test/labels{/name}","releases_url":"https://api.github.com/repos/autotest/virt-test/releases{/id}","created_at":"2012-09-25T16:10:43Z","updated_at":"2015-02-13T09:31:46Z","pushed_at":"2015-02-13T09:31:46Z","git_url":"git://github.com/autotest/virt-test.git","ssh_url":"git@github.com:autotest/virt-test.git","clone_url":"https://github.com/autotest/virt-test.git","svn_url":"https://github.com/autotest/virt-test","homepage":"http://virt-test.readthedocs.org/en/latest/","size":41796,"stargazers_count":72,"watchers_count":72,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":116,"mirror_url":null,"open_issues_count":59,"forks":116,"open_issues":59,"watchers":72,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/autotest/virt-test/pulls/2000"},"html":{"href":"https://github.com/autotest/virt-test/pull/2000"},"issue":{"href":"https://api.github.com/repos/autotest/virt-test/issues/2000"},"comments":{"href":"https://api.github.com/repos/autotest/virt-test/issues/2000/comments"},"review_comments":{"href":"https://api.github.com/repos/autotest/virt-test/pulls/2000/comments"},"review_comment":{"href":"https://api.github.com/repos/autotest/virt-test/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/autotest/virt-test/pulls/2000/commits"},"statuses":{"href":"https://api.github.com/repos/autotest/virt-test/statuses/2978385b7465c6f5a58b9982bb3ae186b5f145b0"}}}}