{"action":"created","comment":{"url":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/comments/151920663","pull_request_review_id":77702579,"id":151920663,"diff_hunk":"@@ -2370,6 +2370,64 @@ def get_qemu_best_cpu_model(params):\n     return params.get(\"default_cpu_model\", None)\n \n \n+def get_qemu_version(params):\n+    \"\"\"\n+    Get the qemu-kvm(-rhev) version info.\n+\n+    :param params: Passed to get_qemu_binary, can set to {} if not needed.\n+    :return: A dict contain qemu versoins info as {'major': int, 'minor': int,\n+    'update': int, 'is_rhev': bool}\n+    \"\"\"\n+    version = {'major': None, 'minor': None, 'update': None, 'is_rhev': False}\n+    regex = r'\\s*[Ee]mulator [Vv]ersion\\s*(\\d+)\\.(\\d+)\\.(\\d+)'\n+\n+    qemu_binary = get_qemu_binary(params)\n+    version_raw = commands.getoutput(\"%s -version\" % qemu_binary).splitlines()\n+    for line in version_raw:\n+        search_result = re.search(regex, line)\n+        if search_result:\n+            version['major'] = int(search_result.group(1))\n+            version['minor'] = int(search_result.group(2))\n+            version['update'] = int(search_result.group(3))\n+        if \"rhev\" in str(line).lower():\n+            version['is_rhev'] = True\n+    for key, value in version.iteritems():\n+        if value is None:","path":"virttest/utils_misc.py","position":null,"original_position":26,"commit_id":"ddc069b410de9ffe8902da3dfa5ce82ddb15de4f","original_commit_id":"1413e95f79096de6e453039af40bcfcca0460551","user":{"login":"lento-sun","id":18416722,"avatar_url":"https://avatars1.githubusercontent.com/u/18416722?v=4","gravatar_id":"","url":"https://api.github.com/users/lento-sun","html_url":"https://github.com/lento-sun","followers_url":"https://api.github.com/users/lento-sun/followers","following_url":"https://api.github.com/users/lento-sun/following{/other_user}","gists_url":"https://api.github.com/users/lento-sun/gists{/gist_id}","starred_url":"https://api.github.com/users/lento-sun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lento-sun/subscriptions","organizations_url":"https://api.github.com/users/lento-sun/orgs","repos_url":"https://api.github.com/users/lento-sun/repos","events_url":"https://api.github.com/users/lento-sun/events{/privacy}","received_events_url":"https://api.github.com/users/lento-sun/received_events","type":"User","site_admin":false},"body":"fixed","created_at":"2017-11-20T07:57:56Z","updated_at":"2017-11-20T07:57:56Z","html_url":"https://github.com/avocado-framework/avocado-vt/pull/1219#discussion_r151920663","pull_request_url":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/1219","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/comments/151920663"},"html":{"href":"https://github.com/avocado-framework/avocado-vt/pull/1219#discussion_r151920663"},"pull_request":{"href":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/1219"}},"in_reply_to_id":151324511},"pull_request":{"url":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/1219","id":151580179,"html_url":"https://github.com/avocado-framework/avocado-vt/pull/1219","diff_url":"https://github.com/avocado-framework/avocado-vt/pull/1219.diff","patch_url":"https://github.com/avocado-framework/avocado-vt/pull/1219.patch","issue_url":"https://api.github.com/repos/avocado-framework/avocado-vt/issues/1219","number":1219,"state":"open","locked":false,"title":"Add qemu version methods in virttest/utils_misc","user":{"login":"lento-sun","id":18416722,"avatar_url":"https://avatars1.githubusercontent.com/u/18416722?v=4","gravatar_id":"","url":"https://api.github.com/users/lento-sun","html_url":"https://github.com/lento-sun","followers_url":"https://api.github.com/users/lento-sun/followers","following_url":"https://api.github.com/users/lento-sun/following{/other_user}","gists_url":"https://api.github.com/users/lento-sun/gists{/gist_id}","starred_url":"https://api.github.com/users/lento-sun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lento-sun/subscriptions","organizations_url":"https://api.github.com/users/lento-sun/orgs","repos_url":"https://api.github.com/users/lento-sun/repos","events_url":"https://api.github.com/users/lento-sun/events{/privacy}","received_events_url":"https://api.github.com/users/lento-sun/received_events","type":"User","site_admin":false},"body":"Different qemu versions may have different cmd params, we'll need\r\nto get qemu versions' info. This commit add get_qemu_version and\r\ncompare_qemu_version, and use them in get_image_info and\r\nget_image_snapshot to avoid qemu lock introduced by rfe bz1378241.\r\n\r\nSigned-off-by: Yi Sun <yisun@redhat.com>","created_at":"2017-11-09T07:36:20Z","updated_at":"2017-11-20T07:57:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1755279b33359312c3b2bd78f7307bc563951686","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/1219/commits","review_comments_url":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/1219/comments","review_comment_url":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/avocado-framework/avocado-vt/issues/1219/comments","statuses_url":"https://api.github.com/repos/avocado-framework/avocado-vt/statuses/ddc069b410de9ffe8902da3dfa5ce82ddb15de4f","head":{"label":"lento-sun:qemu_version","ref":"qemu_version","sha":"ddc069b410de9ffe8902da3dfa5ce82ddb15de4f","user":{"login":"lento-sun","id":18416722,"avatar_url":"https://avatars1.githubusercontent.com/u/18416722?v=4","gravatar_id":"","url":"https://api.github.com/users/lento-sun","html_url":"https://github.com/lento-sun","followers_url":"https://api.github.com/users/lento-sun/followers","following_url":"https://api.github.com/users/lento-sun/following{/other_user}","gists_url":"https://api.github.com/users/lento-sun/gists{/gist_id}","starred_url":"https://api.github.com/users/lento-sun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lento-sun/subscriptions","organizations_url":"https://api.github.com/users/lento-sun/orgs","repos_url":"https://api.github.com/users/lento-sun/repos","events_url":"https://api.github.com/users/lento-sun/events{/privacy}","received_events_url":"https://api.github.com/users/lento-sun/received_events","type":"User","site_admin":false},"repo":{"id":58434105,"name":"avocado-vt","full_name":"lento-sun/avocado-vt","owner":{"login":"lento-sun","id":18416722,"avatar_url":"https://avatars1.githubusercontent.com/u/18416722?v=4","gravatar_id":"","url":"https://api.github.com/users/lento-sun","html_url":"https://github.com/lento-sun","followers_url":"https://api.github.com/users/lento-sun/followers","following_url":"https://api.github.com/users/lento-sun/following{/other_user}","gists_url":"https://api.github.com/users/lento-sun/gists{/gist_id}","starred_url":"https://api.github.com/users/lento-sun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lento-sun/subscriptions","organizations_url":"https://api.github.com/users/lento-sun/orgs","repos_url":"https://api.github.com/users/lento-sun/repos","events_url":"https://api.github.com/users/lento-sun/events{/privacy}","received_events_url":"https://api.github.com/users/lento-sun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lento-sun/avocado-vt","description":"Avocado VT Plugin","fork":true,"url":"https://api.github.com/repos/lento-sun/avocado-vt","forks_url":"https://api.github.com/repos/lento-sun/avocado-vt/forks","keys_url":"https://api.github.com/repos/lento-sun/avocado-vt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lento-sun/avocado-vt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lento-sun/avocado-vt/teams","hooks_url":"https://api.github.com/repos/lento-sun/avocado-vt/hooks","issue_events_url":"https://api.github.com/repos/lento-sun/avocado-vt/issues/events{/number}","events_url":"https://api.github.com/repos/lento-sun/avocado-vt/events","assignees_url":"https://api.github.com/repos/lento-sun/avocado-vt/assignees{/user}","branches_url":"https://api.github.com/repos/lento-sun/avocado-vt/branches{/branch}","tags_url":"https://api.github.com/repos/lento-sun/avocado-vt/tags","blobs_url":"https://api.github.com/repos/lento-sun/avocado-vt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lento-sun/avocado-vt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lento-sun/avocado-vt/git/refs{/sha}","trees_url":"https://api.github.com/repos/lento-sun/avocado-vt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lento-sun/avocado-vt/statuses/{sha}","languages_url":"https://api.github.com/repos/lento-sun/avocado-vt/languages","stargazers_url":"https://api.github.com/repos/lento-sun/avocado-vt/stargazers","contributors_url":"https://api.github.com/repos/lento-sun/avocado-vt/contributors","subscribers_url":"https://api.github.com/repos/lento-sun/avocado-vt/subscribers","subscription_url":"https://api.github.com/repos/lento-sun/avocado-vt/subscription","commits_url":"https://api.github.com/repos/lento-sun/avocado-vt/commits{/sha}","git_commits_url":"https://api.github.com/repos/lento-sun/avocado-vt/git/commits{/sha}","comments_url":"https://api.github.com/repos/lento-sun/avocado-vt/comments{/number}","issue_comment_url":"https://api.github.com/repos/lento-sun/avocado-vt/issues/comments{/number}","contents_url":"https://api.github.com/repos/lento-sun/avocado-vt/contents/{+path}","compare_url":"https://api.github.com/repos/lento-sun/avocado-vt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lento-sun/avocado-vt/merges","archive_url":"https://api.github.com/repos/lento-sun/avocado-vt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lento-sun/avocado-vt/downloads","issues_url":"https://api.github.com/repos/lento-sun/avocado-vt/issues{/number}","pulls_url":"https://api.github.com/repos/lento-sun/avocado-vt/pulls{/number}","milestones_url":"https://api.github.com/repos/lento-sun/avocado-vt/milestones{/number}","notifications_url":"https://api.github.com/repos/lento-sun/avocado-vt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lento-sun/avocado-vt/labels{/name}","releases_url":"https://api.github.com/repos/lento-sun/avocado-vt/releases{/id}","deployments_url":"https://api.github.com/repos/lento-sun/avocado-vt/deployments","created_at":"2016-05-10T06:05:27Z","updated_at":"2016-05-10T06:05:29Z","pushed_at":"2017-11-16T07:48:40Z","git_url":"git://github.com/lento-sun/avocado-vt.git","ssh_url":"git@github.com:lento-sun/avocado-vt.git","clone_url":"https://github.com/lento-sun/avocado-vt.git","svn_url":"https://github.com/lento-sun/avocado-vt","homepage":"http://avocado-vt.readthedocs.org/","size":26620,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"avocado-framework:master","ref":"master","sha":"3f596bb512a0764b8dc176e58ba60ec0cd423e29","user":{"login":"avocado-framework","id":7245719,"avatar_url":"https://avatars3.githubusercontent.com/u/7245719?v=4","gravatar_id":"","url":"https://api.github.com/users/avocado-framework","html_url":"https://github.com/avocado-framework","followers_url":"https://api.github.com/users/avocado-framework/followers","following_url":"https://api.github.com/users/avocado-framework/following{/other_user}","gists_url":"https://api.github.com/users/avocado-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/avocado-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avocado-framework/subscriptions","organizations_url":"https://api.github.com/users/avocado-framework/orgs","repos_url":"https://api.github.com/users/avocado-framework/repos","events_url":"https://api.github.com/users/avocado-framework/events{/privacy}","received_events_url":"https://api.github.com/users/avocado-framework/received_events","type":"Organization","site_admin":false},"repo":{"id":36371959,"name":"avocado-vt","full_name":"avocado-framework/avocado-vt","owner":{"login":"avocado-framework","id":7245719,"avatar_url":"https://avatars3.githubusercontent.com/u/7245719?v=4","gravatar_id":"","url":"https://api.github.com/users/avocado-framework","html_url":"https://github.com/avocado-framework","followers_url":"https://api.github.com/users/avocado-framework/followers","following_url":"https://api.github.com/users/avocado-framework/following{/other_user}","gists_url":"https://api.github.com/users/avocado-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/avocado-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avocado-framework/subscriptions","organizations_url":"https://api.github.com/users/avocado-framework/orgs","repos_url":"https://api.github.com/users/avocado-framework/repos","events_url":"https://api.github.com/users/avocado-framework/events{/privacy}","received_events_url":"https://api.github.com/users/avocado-framework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/avocado-framework/avocado-vt","description":"Avocado VT Plugin","fork":false,"url":"https://api.github.com/repos/avocado-framework/avocado-vt","forks_url":"https://api.github.com/repos/avocado-framework/avocado-vt/forks","keys_url":"https://api.github.com/repos/avocado-framework/avocado-vt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avocado-framework/avocado-vt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avocado-framework/avocado-vt/teams","hooks_url":"https://api.github.com/repos/avocado-framework/avocado-vt/hooks","issue_events_url":"https://api.github.com/repos/avocado-framework/avocado-vt/issues/events{/number}","events_url":"https://api.github.com/repos/avocado-framework/avocado-vt/events","assignees_url":"https://api.github.com/repos/avocado-framework/avocado-vt/assignees{/user}","branches_url":"https://api.github.com/repos/avocado-framework/avocado-vt/branches{/branch}","tags_url":"https://api.github.com/repos/avocado-framework/avocado-vt/tags","blobs_url":"https://api.github.com/repos/avocado-framework/avocado-vt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avocado-framework/avocado-vt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avocado-framework/avocado-vt/git/refs{/sha}","trees_url":"https://api.github.com/repos/avocado-framework/avocado-vt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avocado-framework/avocado-vt/statuses/{sha}","languages_url":"https://api.github.com/repos/avocado-framework/avocado-vt/languages","stargazers_url":"https://api.github.com/repos/avocado-framework/avocado-vt/stargazers","contributors_url":"https://api.github.com/repos/avocado-framework/avocado-vt/contributors","subscribers_url":"https://api.github.com/repos/avocado-framework/avocado-vt/subscribers","subscription_url":"https://api.github.com/repos/avocado-framework/avocado-vt/subscription","commits_url":"https://api.github.com/repos/avocado-framework/avocado-vt/commits{/sha}","git_commits_url":"https://api.github.com/repos/avocado-framework/avocado-vt/git/commits{/sha}","comments_url":"https://api.github.com/repos/avocado-framework/avocado-vt/comments{/number}","issue_comment_url":"https://api.github.com/repos/avocado-framework/avocado-vt/issues/comments{/number}","contents_url":"https://api.github.com/repos/avocado-framework/avocado-vt/contents/{+path}","compare_url":"https://api.github.com/repos/avocado-framework/avocado-vt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avocado-framework/avocado-vt/merges","archive_url":"https://api.github.com/repos/avocado-framework/avocado-vt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avocado-framework/avocado-vt/downloads","issues_url":"https://api.github.com/repos/avocado-framework/avocado-vt/issues{/number}","pulls_url":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls{/number}","milestones_url":"https://api.github.com/repos/avocado-framework/avocado-vt/milestones{/number}","notifications_url":"https://api.github.com/repos/avocado-framework/avocado-vt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avocado-framework/avocado-vt/labels{/name}","releases_url":"https://api.github.com/repos/avocado-framework/avocado-vt/releases{/id}","deployments_url":"https://api.github.com/repos/avocado-framework/avocado-vt/deployments","created_at":"2015-05-27T14:22:13Z","updated_at":"2017-11-10T06:17:01Z","pushed_at":"2017-11-20T06:50:49Z","git_url":"git://github.com/avocado-framework/avocado-vt.git","ssh_url":"git@github.com:avocado-framework/avocado-vt.git","clone_url":"https://github.com/avocado-framework/avocado-vt.git","svn_url":"https://github.com/avocado-framework/avocado-vt","homepage":"http://avocado-vt.readthedocs.org/","size":26667,"stargazers_count":28,"watchers_count":28,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":120,"mirror_url":null,"archived":false,"open_issues_count":100,"forks":120,"open_issues":100,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/1219"},"html":{"href":"https://github.com/avocado-framework/avocado-vt/pull/1219"},"issue":{"href":"https://api.github.com/repos/avocado-framework/avocado-vt/issues/1219"},"comments":{"href":"https://api.github.com/repos/avocado-framework/avocado-vt/issues/1219/comments"},"review_comments":{"href":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/1219/comments"},"review_comment":{"href":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/1219/commits"},"statuses":{"href":"https://api.github.com/repos/avocado-framework/avocado-vt/statuses/ddc069b410de9ffe8902da3dfa5ce82ddb15de4f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"lento-sun"}}