{"action":"created","comment":{"url":"https://api.github.com/repos/autotest/tp-qemu/pulls/comments/59495097","id":59495097,"diff_hunk":"@@ -0,0 +1,168 @@\n+import logging\n+import re\n+import time\n+\n+from virttest import data_dir\n+from virttest import storage\n+from virttest import error_context\n+from virttest import utils_test\n+from virttest.qemu_devices import qdevices\n+\n+from avocado.core import exceptions\n+\n+\n+@error_context.context_aware\n+def run(test, params, env):\n+    \"\"\"\n+    Test hotplug of block devices.\n+\n+    1) Boot up guest with/without block device(s).\n+    2) Hoplug block device and verify\n+    3) Do read/write data on hotplug block.\n+    4) Unplug block device and verify\n+\n+    :param test:   QEMU test object.\n+    :param params: Dictionary with the test parameters.\n+    :param env:    Dictionary with test environment.\n+    \"\"\"\n+    def find_image(image_name):\n+        \"\"\"\n+        Find the path of the iamge.\n+        \"\"\"\n+        image_params = params.object_params(image_name)\n+        o = storage.get_image_filename(image_params, data_dir.get_data_dir())\n+        return o\n+\n+    def find_disk(session, cmd):\n+        \"\"\"\n+        Find all disks in guest.\n+        \"\"\"\n+        if params.get(\"os_type\") == \"linux\":","path":"qemu/tests/block_hotplug.py","position":40,"original_position":40,"commit_id":"5bead94056fc22c6f5acc37b7f33d33a5f2655ea","original_commit_id":"6df85f9737d9a53fcabbf65a721e0ff17e89d4db","user":{"login":"xutian","id":1871732,"avatar_url":"https://avatars.githubusercontent.com/u/1871732?v=3","gravatar_id":"","url":"https://api.github.com/users/xutian","html_url":"https://github.com/xutian","followers_url":"https://api.github.com/users/xutian/followers","following_url":"https://api.github.com/users/xutian/following{/other_user}","gists_url":"https://api.github.com/users/xutian/gists{/gist_id}","starred_url":"https://api.github.com/users/xutian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xutian/subscriptions","organizations_url":"https://api.github.com/users/xutian/orgs","repos_url":"https://api.github.com/users/xutian/repos","events_url":"https://api.github.com/users/xutian/events{/privacy}","received_events_url":"https://api.github.com/users/xutian/received_events","type":"User","site_admin":false},"body":"ok, see it.","created_at":"2016-04-13T05:44:44Z","updated_at":"2016-04-13T05:44:44Z","html_url":"https://github.com/autotest/tp-qemu/pull/563#discussion_r59495097","pull_request_url":"https://api.github.com/repos/autotest/tp-qemu/pulls/563","_links":{"self":{"href":"https://api.github.com/repos/autotest/tp-qemu/pulls/comments/59495097"},"html":{"href":"https://github.com/autotest/tp-qemu/pull/563#discussion_r59495097"},"pull_request":{"href":"https://api.github.com/repos/autotest/tp-qemu/pulls/563"}}},"pull_request":{"url":"https://api.github.com/repos/autotest/tp-qemu/pulls/563","id":63164835,"html_url":"https://github.com/autotest/tp-qemu/pull/563","diff_url":"https://github.com/autotest/tp-qemu/pull/563.diff","patch_url":"https://github.com/autotest/tp-qemu/pull/563.patch","issue_url":"https://api.github.com/repos/autotest/tp-qemu/issues/563","number":563,"state":"open","locked":false,"title":"qemu/tests/: Add new case for block hotplug","user":{"login":"spcui","id":4134463,"avatar_url":"https://avatars.githubusercontent.com/u/4134463?v=3","gravatar_id":"","url":"https://api.github.com/users/spcui","html_url":"https://github.com/spcui","followers_url":"https://api.github.com/users/spcui/followers","following_url":"https://api.github.com/users/spcui/following{/other_user}","gists_url":"https://api.github.com/users/spcui/gists{/gist_id}","starred_url":"https://api.github.com/users/spcui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spcui/subscriptions","organizations_url":"https://api.github.com/users/spcui/orgs","repos_url":"https://api.github.com/users/spcui/repos","events_url":"https://api.github.com/users/spcui/events{/privacy}","received_events_url":"https://api.github.com/users/spcui/received_events","type":"User","site_admin":false},"body":"Signed-off-by: Shuping Cui <scui@redhat.com>\r\n\r\nID: 1081682 1081684","created_at":"2016-03-17T02:26:10Z","updated_at":"2016-04-13T05:44:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1533c00b50c1aa04a2f0d6614a19f91db11e501","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/autotest/tp-qemu/pulls/563/commits","review_comments_url":"https://api.github.com/repos/autotest/tp-qemu/pulls/563/comments","review_comment_url":"https://api.github.com/repos/autotest/tp-qemu/pulls/comments{/number}","comments_url":"https://api.github.com/repos/autotest/tp-qemu/issues/563/comments","statuses_url":"https://api.github.com/repos/autotest/tp-qemu/statuses/5bead94056fc22c6f5acc37b7f33d33a5f2655ea","head":{"label":"spcui:block_hotplug","ref":"block_hotplug","sha":"5bead94056fc22c6f5acc37b7f33d33a5f2655ea","user":{"login":"spcui","id":4134463,"avatar_url":"https://avatars.githubusercontent.com/u/4134463?v=3","gravatar_id":"","url":"https://api.github.com/users/spcui","html_url":"https://github.com/spcui","followers_url":"https://api.github.com/users/spcui/followers","following_url":"https://api.github.com/users/spcui/following{/other_user}","gists_url":"https://api.github.com/users/spcui/gists{/gist_id}","starred_url":"https://api.github.com/users/spcui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spcui/subscriptions","organizations_url":"https://api.github.com/users/spcui/orgs","repos_url":"https://api.github.com/users/spcui/repos","events_url":"https://api.github.com/users/spcui/events{/privacy}","received_events_url":"https://api.github.com/users/spcui/received_events","type":"User","site_admin":false},"repo":{"id":16301994,"name":"tp-qemu","full_name":"spcui/tp-qemu","owner":{"login":"spcui","id":4134463,"avatar_url":"https://avatars.githubusercontent.com/u/4134463?v=3","gravatar_id":"","url":"https://api.github.com/users/spcui","html_url":"https://github.com/spcui","followers_url":"https://api.github.com/users/spcui/followers","following_url":"https://api.github.com/users/spcui/following{/other_user}","gists_url":"https://api.github.com/users/spcui/gists{/gist_id}","starred_url":"https://api.github.com/users/spcui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spcui/subscriptions","organizations_url":"https://api.github.com/users/spcui/orgs","repos_url":"https://api.github.com/users/spcui/repos","events_url":"https://api.github.com/users/spcui/events{/privacy}","received_events_url":"https://api.github.com/users/spcui/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/spcui/tp-qemu","description":"Virt Test Provider for qemu and other related virtualization backends","fork":true,"url":"https://api.github.com/repos/spcui/tp-qemu","forks_url":"https://api.github.com/repos/spcui/tp-qemu/forks","keys_url":"https://api.github.com/repos/spcui/tp-qemu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spcui/tp-qemu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spcui/tp-qemu/teams","hooks_url":"https://api.github.com/repos/spcui/tp-qemu/hooks","issue_events_url":"https://api.github.com/repos/spcui/tp-qemu/issues/events{/number}","events_url":"https://api.github.com/repos/spcui/tp-qemu/events","assignees_url":"https://api.github.com/repos/spcui/tp-qemu/assignees{/user}","branches_url":"https://api.github.com/repos/spcui/tp-qemu/branches{/branch}","tags_url":"https://api.github.com/repos/spcui/tp-qemu/tags","blobs_url":"https://api.github.com/repos/spcui/tp-qemu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spcui/tp-qemu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spcui/tp-qemu/git/refs{/sha}","trees_url":"https://api.github.com/repos/spcui/tp-qemu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spcui/tp-qemu/statuses/{sha}","languages_url":"https://api.github.com/repos/spcui/tp-qemu/languages","stargazers_url":"https://api.github.com/repos/spcui/tp-qemu/stargazers","contributors_url":"https://api.github.com/repos/spcui/tp-qemu/contributors","subscribers_url":"https://api.github.com/repos/spcui/tp-qemu/subscribers","subscription_url":"https://api.github.com/repos/spcui/tp-qemu/subscription","commits_url":"https://api.github.com/repos/spcui/tp-qemu/commits{/sha}","git_commits_url":"https://api.github.com/repos/spcui/tp-qemu/git/commits{/sha}","comments_url":"https://api.github.com/repos/spcui/tp-qemu/comments{/number}","issue_comment_url":"https://api.github.com/repos/spcui/tp-qemu/issues/comments{/number}","contents_url":"https://api.github.com/repos/spcui/tp-qemu/contents/{+path}","compare_url":"https://api.github.com/repos/spcui/tp-qemu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spcui/tp-qemu/merges","archive_url":"https://api.github.com/repos/spcui/tp-qemu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spcui/tp-qemu/downloads","issues_url":"https://api.github.com/repos/spcui/tp-qemu/issues{/number}","pulls_url":"https://api.github.com/repos/spcui/tp-qemu/pulls{/number}","milestones_url":"https://api.github.com/repos/spcui/tp-qemu/milestones{/number}","notifications_url":"https://api.github.com/repos/spcui/tp-qemu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spcui/tp-qemu/labels{/name}","releases_url":"https://api.github.com/repos/spcui/tp-qemu/releases{/id}","deployments_url":"https://api.github.com/repos/spcui/tp-qemu/deployments","created_at":"2014-01-28T04:21:03Z","updated_at":"2014-06-19T07:35:28Z","pushed_at":"2016-04-13T05:22:28Z","git_url":"git://github.com/spcui/tp-qemu.git","ssh_url":"git@github.com:spcui/tp-qemu.git","clone_url":"https://github.com/spcui/tp-qemu.git","svn_url":"https://github.com/spcui/tp-qemu","homepage":null,"size":11111,"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":"autotest:master","ref":"master","sha":"adea4e187d0637aeff060f28d9cd5823ce9837e2","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":16180304,"name":"tp-qemu","full_name":"autotest/tp-qemu","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/tp-qemu","description":"Virt Test Provider for qemu and other related virtualization backends","fork":false,"url":"https://api.github.com/repos/autotest/tp-qemu","forks_url":"https://api.github.com/repos/autotest/tp-qemu/forks","keys_url":"https://api.github.com/repos/autotest/tp-qemu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/autotest/tp-qemu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/autotest/tp-qemu/teams","hooks_url":"https://api.github.com/repos/autotest/tp-qemu/hooks","issue_events_url":"https://api.github.com/repos/autotest/tp-qemu/issues/events{/number}","events_url":"https://api.github.com/repos/autotest/tp-qemu/events","assignees_url":"https://api.github.com/repos/autotest/tp-qemu/assignees{/user}","branches_url":"https://api.github.com/repos/autotest/tp-qemu/branches{/branch}","tags_url":"https://api.github.com/repos/autotest/tp-qemu/tags","blobs_url":"https://api.github.com/repos/autotest/tp-qemu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/autotest/tp-qemu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/autotest/tp-qemu/git/refs{/sha}","trees_url":"https://api.github.com/repos/autotest/tp-qemu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/autotest/tp-qemu/statuses/{sha}","languages_url":"https://api.github.com/repos/autotest/tp-qemu/languages","stargazers_url":"https://api.github.com/repos/autotest/tp-qemu/stargazers","contributors_url":"https://api.github.com/repos/autotest/tp-qemu/contributors","subscribers_url":"https://api.github.com/repos/autotest/tp-qemu/subscribers","subscription_url":"https://api.github.com/repos/autotest/tp-qemu/subscription","commits_url":"https://api.github.com/repos/autotest/tp-qemu/commits{/sha}","git_commits_url":"https://api.github.com/repos/autotest/tp-qemu/git/commits{/sha}","comments_url":"https://api.github.com/repos/autotest/tp-qemu/comments{/number}","issue_comment_url":"https://api.github.com/repos/autotest/tp-qemu/issues/comments{/number}","contents_url":"https://api.github.com/repos/autotest/tp-qemu/contents/{+path}","compare_url":"https://api.github.com/repos/autotest/tp-qemu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/autotest/tp-qemu/merges","archive_url":"https://api.github.com/repos/autotest/tp-qemu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/autotest/tp-qemu/downloads","issues_url":"https://api.github.com/repos/autotest/tp-qemu/issues{/number}","pulls_url":"https://api.github.com/repos/autotest/tp-qemu/pulls{/number}","milestones_url":"https://api.github.com/repos/autotest/tp-qemu/milestones{/number}","notifications_url":"https://api.github.com/repos/autotest/tp-qemu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/autotest/tp-qemu/labels{/name}","releases_url":"https://api.github.com/repos/autotest/tp-qemu/releases{/id}","deployments_url":"https://api.github.com/repos/autotest/tp-qemu/deployments","created_at":"2014-01-23T17:51:34Z","updated_at":"2016-01-15T05:11:32Z","pushed_at":"2016-04-13T05:22:29Z","git_url":"git://github.com/autotest/tp-qemu.git","ssh_url":"git@github.com:autotest/tp-qemu.git","clone_url":"https://github.com/autotest/tp-qemu.git","svn_url":"https://github.com/autotest/tp-qemu","homepage":null,"size":11528,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":21,"forks":63,"open_issues":21,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/autotest/tp-qemu/pulls/563"},"html":{"href":"https://github.com/autotest/tp-qemu/pull/563"},"issue":{"href":"https://api.github.com/repos/autotest/tp-qemu/issues/563"},"comments":{"href":"https://api.github.com/repos/autotest/tp-qemu/issues/563/comments"},"review_comments":{"href":"https://api.github.com/repos/autotest/tp-qemu/pulls/563/comments"},"review_comment":{"href":"https://api.github.com/repos/autotest/tp-qemu/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/autotest/tp-qemu/pulls/563/commits"},"statuses":{"href":"https://api.github.com/repos/autotest/tp-qemu/statuses/5bead94056fc22c6f5acc37b7f33d33a5f2655ea"}}}}