GitHub PullRequestReviewCommentEvent at 2014-12-01 07:24:58
Repository: virt-test
Actor: chuanchang
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/autotest/virt-test/pulls/comments/21073456","id":21073456,"diff_hunk":"@@ -1815,3 +1815,30 @@ def get_all_vol_paths():\n         for path in pv.list_volumes().values():\n             vol_path.append(path)\n     return set(vol_path)\n+\n+\n+def update_vm_disk_source(vm_name, disk_source_path, source_type=\"file\"):\n+    \"\"\"\n+    Update disk source path of the VM\n+\n+    :param source_type: it may be 'dev' or 'file' type, which is default\n+    \"\"\"\n+    # Prepare to update VM first disk source file\n+    vmxml = vm_xml.VMXML.new_from_dumpxml(vm_name)\n+    devices = vmxml.devices\n+    disk_index = devices.index(devices.by_device_tag('disk')[0])\n+    disks = devices[disk_index]\n+    disk_source = disks.source.get_attrs().get(source_type)\n+    logging.debug(\"The disk source file of the VM: %s\", disk_source)\n+\n+    vm_name_with_format = os.path.basename(disk_source)\n+    new_disk_source = os.path.join(disk_source_path, vm_name_with_format)","path":"virttest/utils_test/libvirt.py","position":21,"original_position":21,"commit_id":"bac50409e789735aa5d992944deff9d51177331a","original_commit_id":"bac50409e789735aa5d992944deff9d51177331a","user":{"login":"chuanchang","id":1122023,"avatar_url":"https://avatars.githubusercontent.com/u/1122023?v=3","gravatar_id":"","url":"https://api.github.com/users/chuanchang","html_url":"https://github.com/chuanchang","followers_url":"https://api.github.com/users/chuanchang/followers","following_url":"https://api.github.com/users/chuanchang/following{/other_user}","gists_url":"https://api.github.com/users/chuanchang/gists{/gist_id}","starred_url":"https://api.github.com/users/chuanchang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuanchang/subscriptions","organizations_url":"https://api.github.com/users/chuanchang/orgs","repos_url":"https://api.github.com/users/chuanchang/repos","events_url":"https://api.github.com/users/chuanchang/events{/privacy}","received_events_url":"https://api.github.com/users/chuanchang/received_events","type":"User","site_admin":false},"body":"@yumingfei, yes, to avoid the caller do this each time.","created_at":"2014-12-01T07:24:58Z","updated_at":"2014-12-01T07:24:58Z","html_url":"https://github.com/autotest/virt-test/pull/1884#discussion_r21073456","pull_request_url":"https://api.github.com/repos/autotest/virt-test/pulls/1884","_links":{"self":{"href":"https://api.github.com/repos/autotest/virt-test/pulls/comments/21073456"},"html":{"href":"https://github.com/autotest/virt-test/pull/1884#discussion_r21073456"},"pull_request":{"href":"https://api.github.com/repos/autotest/virt-test/pulls/1884"}}},"pull_request":{"url":"https://api.github.com/repos/autotest/virt-test/pulls/1884","id":24424082,"html_url":"https://github.com/autotest/virt-test/pull/1884","diff_url":"https://github.com/autotest/virt-test/pull/1884.diff","patch_url":"https://github.com/autotest/virt-test/pull/1884.patch","issue_url":"https://api.github.com/repos/autotest/virt-test/issues/1884","number":1884,"state":"open","locked":false,"title":"virttest.utils_test.libvirt: update disk source of the VM","user":{"login":"chuanchang","id":1122023,"avatar_url":"https://avatars.githubusercontent.com/u/1122023?v=3","gravatar_id":"","url":"https://api.github.com/users/chuanchang","html_url":"https://github.com/chuanchang","followers_url":"https://api.github.com/users/chuanchang/followers","following_url":"https://api.github.com/users/chuanchang/following{/other_user}","gists_url":"https://api.github.com/users/chuanchang/gists{/gist_id}","starred_url":"https://api.github.com/users/chuanchang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuanchang/subscriptions","organizations_url":"https://api.github.com/users/chuanchang/orgs","repos_url":"https://api.github.com/users/chuanchang/repos","events_url":"https://api.github.com/users/chuanchang/events{/privacy}","received_events_url":"https://api.github.com/users/chuanchang/received_events","type":"User","site_admin":false},"body":"To update disk source path of the VM according to specified direcotry, such as a NFS sharing directory.\r\n\r\nSigned-off-by: Alex Jia <ajia@redhat.com>","created_at":"2014-11-14T06:56:00Z","updated_at":"2014-12-01T07:24:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"91bffeae4589fcc5bb470337c9bc1d4d0979c306","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/autotest/virt-test/pulls/1884/commits","review_comments_url":"https://api.github.com/repos/autotest/virt-test/pulls/1884/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/1884/comments","statuses_url":"https://api.github.com/repos/autotest/virt-test/statuses/bac50409e789735aa5d992944deff9d51177331a","head":{"label":"chuanchang:update_vm_disk_source","ref":"update_vm_disk_source","sha":"bac50409e789735aa5d992944deff9d51177331a","user":{"login":"chuanchang","id":1122023,"avatar_url":"https://avatars.githubusercontent.com/u/1122023?v=3","gravatar_id":"","url":"https://api.github.com/users/chuanchang","html_url":"https://github.com/chuanchang","followers_url":"https://api.github.com/users/chuanchang/followers","following_url":"https://api.github.com/users/chuanchang/following{/other_user}","gists_url":"https://api.github.com/users/chuanchang/gists{/gist_id}","starred_url":"https://api.github.com/users/chuanchang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuanchang/subscriptions","organizations_url":"https://api.github.com/users/chuanchang/orgs","repos_url":"https://api.github.com/users/chuanchang/repos","events_url":"https://api.github.com/users/chuanchang/events{/privacy}","received_events_url":"https://api.github.com/users/chuanchang/received_events","type":"User","site_admin":false},"repo":{"id":10025388,"name":"virt-test","full_name":"chuanchang/virt-test","owner":{"login":"chuanchang","id":1122023,"avatar_url":"https://avatars.githubusercontent.com/u/1122023?v=3","gravatar_id":"","url":"https://api.github.com/users/chuanchang","html_url":"https://github.com/chuanchang","followers_url":"https://api.github.com/users/chuanchang/followers","following_url":"https://api.github.com/users/chuanchang/following{/other_user}","gists_url":"https://api.github.com/users/chuanchang/gists{/gist_id}","starred_url":"https://api.github.com/users/chuanchang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuanchang/subscriptions","organizations_url":"https://api.github.com/users/chuanchang/orgs","repos_url":"https://api.github.com/users/chuanchang/repos","events_url":"https://api.github.com/users/chuanchang/events{/privacy}","received_events_url":"https://api.github.com/users/chuanchang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chuanchang/virt-test","description":"Linux Virtualization Tests","fork":true,"url":"https://api.github.com/repos/chuanchang/virt-test","forks_url":"https://api.github.com/repos/chuanchang/virt-test/forks","keys_url":"https://api.github.com/repos/chuanchang/virt-test/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chuanchang/virt-test/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chuanchang/virt-test/teams","hooks_url":"https://api.github.com/repos/chuanchang/virt-test/hooks","issue_events_url":"https://api.github.com/repos/chuanchang/virt-test/issues/events{/number}","events_url":"https://api.github.com/repos/chuanchang/virt-test/events","assignees_url":"https://api.github.com/repos/chuanchang/virt-test/assignees{/user}","branches_url":"https://api.github.com/repos/chuanchang/virt-test/branches{/branch}","tags_url":"https://api.github.com/repos/chuanchang/virt-test/tags","blobs_url":"https://api.github.com/repos/chuanchang/virt-test/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chuanchang/virt-test/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chuanchang/virt-test/git/refs{/sha}","trees_url":"https://api.github.com/repos/chuanchang/virt-test/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chuanchang/virt-test/statuses/{sha}","languages_url":"https://api.github.com/repos/chuanchang/virt-test/languages","stargazers_url":"https://api.github.com/repos/chuanchang/virt-test/stargazers","contributors_url":"https://api.github.com/repos/chuanchang/virt-test/contributors","subscribers_url":"https://api.github.com/repos/chuanchang/virt-test/subscribers","subscription_url":"https://api.github.com/repos/chuanchang/virt-test/subscription","commits_url":"https://api.github.com/repos/chuanchang/virt-test/commits{/sha}","git_commits_url":"https://api.github.com/repos/chuanchang/virt-test/git/commits{/sha}","comments_url":"https://api.github.com/repos/chuanchang/virt-test/comments{/number}","issue_comment_url":"https://api.github.com/repos/chuanchang/virt-test/issues/comments/{number}","contents_url":"https://api.github.com/repos/chuanchang/virt-test/contents/{+path}","compare_url":"https://api.github.com/repos/chuanchang/virt-test/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chuanchang/virt-test/merges","archive_url":"https://api.github.com/repos/chuanchang/virt-test/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chuanchang/virt-test/downloads","issues_url":"https://api.github.com/repos/chuanchang/virt-test/issues{/number}","pulls_url":"https://api.github.com/repos/chuanchang/virt-test/pulls{/number}","milestones_url":"https://api.github.com/repos/chuanchang/virt-test/milestones{/number}","notifications_url":"https://api.github.com/repos/chuanchang/virt-test/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chuanchang/virt-test/labels{/name}","releases_url":"https://api.github.com/repos/chuanchang/virt-test/releases{/id}","created_at":"2013-05-13T06:10:13Z","updated_at":"2014-08-11T08:50:55Z","pushed_at":"2014-11-19T05:47:46Z","git_url":"git://github.com/chuanchang/virt-test.git","ssh_url":"git@github.com:chuanchang/virt-test.git","clone_url":"https://github.com/chuanchang/virt-test.git","svn_url":"https://github.com/chuanchang/virt-test","homepage":null,"size":17735,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"autotest:master","ref":"master","sha":"629af17b36f07e527f2b4c42ee455eb3a54017af","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":"2014-12-01T06:36:04Z","pushed_at":"2014-12-01T06:36:02Z","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":50796,"stargazers_count":69,"watchers_count":69,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":111,"mirror_url":null,"open_issues_count":53,"forks":111,"open_issues":53,"watchers":69,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/autotest/virt-test/pulls/1884"},"html":{"href":"https://github.com/autotest/virt-test/pull/1884"},"issue":{"href":"https://api.github.com/repos/autotest/virt-test/issues/1884"},"comments":{"href":"https://api.github.com/repos/autotest/virt-test/issues/1884/comments"},"review_comments":{"href":"https://api.github.com/repos/autotest/virt-test/pulls/1884/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/1884/commits"},"statuses":{"href":"https://api.github.com/repos/autotest/virt-test/statuses/bac50409e789735aa5d992944deff9d51177331a"}}}}