{"action":"created","comment":{"url":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/comments/178222963","pull_request_review_id":108252586,"id":178222963,"diff_hunk":"@@ -4473,7 +4529,33 @@ def change_media(self, device, target):\n         :param device: Device ID;\n         :param target: new media file;\n         \"\"\"\n-        return self.monitor.change_media(device, target)\n+        status_before = status_after = self.check_device_tray_opened(device)\n+\n+        qmp_monitors = [m for m in self.monitors if m.protocol == \"qmp\"]\n+        for m in qmp_monitors:\n+            m.clear_events()\n+\n+        out = self.monitor.change_media(device, target)\n+\n+        for m in qmp_monitors:\n+            events = utils_misc.wait_for(m.get_events(), timeout=120)\n+            logging.info(\"Event list:\\n%s\" % str(events))\n+            count = 0\n+            for event in events:\n+                if event[\"event\"] == u\"DEVICE_TRAY_MOVED\":\n+                    count += 1\n+                    status_after = bool(event[\"data\"][\"tray-open\"])","path":"virttest/qemu_vm.py","position":57,"original_position":92,"commit_id":"5d27238dde6893738e49763735e12614eb71877e","original_commit_id":"5d27238dde6893738e49763735e12614eb71877e","user":{"login":"CongLi","id":5235330,"avatar_url":"https://avatars2.githubusercontent.com/u/5235330?v=4","gravatar_id":"","url":"https://api.github.com/users/CongLi","html_url":"https://github.com/CongLi","followers_url":"https://api.github.com/users/CongLi/followers","following_url":"https://api.github.com/users/CongLi/following{/other_user}","gists_url":"https://api.github.com/users/CongLi/gists{/gist_id}","starred_url":"https://api.github.com/users/CongLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CongLi/subscriptions","organizations_url":"https://api.github.com/users/CongLi/orgs","repos_url":"https://api.github.com/users/CongLi/repos","events_url":"https://api.github.com/users/CongLi/events{/privacy}","received_events_url":"https://api.github.com/users/CongLi/received_events","type":"User","site_admin":false},"body":"why not call check_device_tray_opened() again here?","created_at":"2018-03-30T02:31:57Z","updated_at":"2018-03-30T02:31:57Z","html_url":"https://github.com/avocado-framework/avocado-vt/pull/1431#discussion_r178222963","pull_request_url":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/1431","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/comments/178222963"},"html":{"href":"https://github.com/avocado-framework/avocado-vt/pull/1431#discussion_r178222963"},"pull_request":{"href":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/1431"}}},"pull_request":{"url":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/1431","id":175482596,"html_url":"https://github.com/avocado-framework/avocado-vt/pull/1431","diff_url":"https://github.com/avocado-framework/avocado-vt/pull/1431.diff","patch_url":"https://github.com/avocado-framework/avocado-vt/pull/1431.patch","issue_url":"https://api.github.com/repos/avocado-framework/avocado-vt/issues/1431","number":1431,"state":"open","locked":false,"title":"qemu_vm.py: add DEVICE_TRAY_MOVED check in eject_cdrom&change_media","user":{"login":"lolyu","id":35479537,"avatar_url":"https://avatars3.githubusercontent.com/u/35479537?v=4","gravatar_id":"","url":"https://api.github.com/users/lolyu","html_url":"https://github.com/lolyu","followers_url":"https://api.github.com/users/lolyu/followers","following_url":"https://api.github.com/users/lolyu/following{/other_user}","gists_url":"https://api.github.com/users/lolyu/gists{/gist_id}","starred_url":"https://api.github.com/users/lolyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lolyu/subscriptions","organizations_url":"https://api.github.com/users/lolyu/orgs","repos_url":"https://api.github.com/users/lolyu/repos","events_url":"https://api.github.com/users/lolyu/events{/privacy}","received_events_url":"https://api.github.com/users/lolyu/received_events","type":"User","site_admin":false},"body":"id: 1347198\r\n\r\nin qemu_vm.py, add 'DEVICE_TRAY_MOVED' check for eject_cdrom and\r\nchange_media. in utils_test.qemu, add decorator that could fail\r\ntest on the error raised in the check added above.\r\n\r\nSigned-off-by: lolyu <lolyu@redhat.com>","created_at":"2018-03-16T09:43:11Z","updated_at":"2018-03-30T02:31:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e164ee95ff637f63dbf2c4355006215a13b9aae","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/1431/commits","review_comments_url":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/1431/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/1431/comments","statuses_url":"https://api.github.com/repos/avocado-framework/avocado-vt/statuses/5d27238dde6893738e49763735e12614eb71877e","head":{"label":"lolyu:dev","ref":"dev","sha":"5d27238dde6893738e49763735e12614eb71877e","user":{"login":"lolyu","id":35479537,"avatar_url":"https://avatars3.githubusercontent.com/u/35479537?v=4","gravatar_id":"","url":"https://api.github.com/users/lolyu","html_url":"https://github.com/lolyu","followers_url":"https://api.github.com/users/lolyu/followers","following_url":"https://api.github.com/users/lolyu/following{/other_user}","gists_url":"https://api.github.com/users/lolyu/gists{/gist_id}","starred_url":"https://api.github.com/users/lolyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lolyu/subscriptions","organizations_url":"https://api.github.com/users/lolyu/orgs","repos_url":"https://api.github.com/users/lolyu/repos","events_url":"https://api.github.com/users/lolyu/events{/privacy}","received_events_url":"https://api.github.com/users/lolyu/received_events","type":"User","site_admin":false},"repo":{"id":124513643,"name":"avocado-vt","full_name":"lolyu/avocado-vt","owner":{"login":"lolyu","id":35479537,"avatar_url":"https://avatars3.githubusercontent.com/u/35479537?v=4","gravatar_id":"","url":"https://api.github.com/users/lolyu","html_url":"https://github.com/lolyu","followers_url":"https://api.github.com/users/lolyu/followers","following_url":"https://api.github.com/users/lolyu/following{/other_user}","gists_url":"https://api.github.com/users/lolyu/gists{/gist_id}","starred_url":"https://api.github.com/users/lolyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lolyu/subscriptions","organizations_url":"https://api.github.com/users/lolyu/orgs","repos_url":"https://api.github.com/users/lolyu/repos","events_url":"https://api.github.com/users/lolyu/events{/privacy}","received_events_url":"https://api.github.com/users/lolyu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lolyu/avocado-vt","description":"Avocado VT Plugin","fork":true,"url":"https://api.github.com/repos/lolyu/avocado-vt","forks_url":"https://api.github.com/repos/lolyu/avocado-vt/forks","keys_url":"https://api.github.com/repos/lolyu/avocado-vt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lolyu/avocado-vt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lolyu/avocado-vt/teams","hooks_url":"https://api.github.com/repos/lolyu/avocado-vt/hooks","issue_events_url":"https://api.github.com/repos/lolyu/avocado-vt/issues/events{/number}","events_url":"https://api.github.com/repos/lolyu/avocado-vt/events","assignees_url":"https://api.github.com/repos/lolyu/avocado-vt/assignees{/user}","branches_url":"https://api.github.com/repos/lolyu/avocado-vt/branches{/branch}","tags_url":"https://api.github.com/repos/lolyu/avocado-vt/tags","blobs_url":"https://api.github.com/repos/lolyu/avocado-vt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lolyu/avocado-vt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lolyu/avocado-vt/git/refs{/sha}","trees_url":"https://api.github.com/repos/lolyu/avocado-vt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lolyu/avocado-vt/statuses/{sha}","languages_url":"https://api.github.com/repos/lolyu/avocado-vt/languages","stargazers_url":"https://api.github.com/repos/lolyu/avocado-vt/stargazers","contributors_url":"https://api.github.com/repos/lolyu/avocado-vt/contributors","subscribers_url":"https://api.github.com/repos/lolyu/avocado-vt/subscribers","subscription_url":"https://api.github.com/repos/lolyu/avocado-vt/subscription","commits_url":"https://api.github.com/repos/lolyu/avocado-vt/commits{/sha}","git_commits_url":"https://api.github.com/repos/lolyu/avocado-vt/git/commits{/sha}","comments_url":"https://api.github.com/repos/lolyu/avocado-vt/comments{/number}","issue_comment_url":"https://api.github.com/repos/lolyu/avocado-vt/issues/comments{/number}","contents_url":"https://api.github.com/repos/lolyu/avocado-vt/contents/{+path}","compare_url":"https://api.github.com/repos/lolyu/avocado-vt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lolyu/avocado-vt/merges","archive_url":"https://api.github.com/repos/lolyu/avocado-vt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lolyu/avocado-vt/downloads","issues_url":"https://api.github.com/repos/lolyu/avocado-vt/issues{/number}","pulls_url":"https://api.github.com/repos/lolyu/avocado-vt/pulls{/number}","milestones_url":"https://api.github.com/repos/lolyu/avocado-vt/milestones{/number}","notifications_url":"https://api.github.com/repos/lolyu/avocado-vt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lolyu/avocado-vt/labels{/name}","releases_url":"https://api.github.com/repos/lolyu/avocado-vt/releases{/id}","deployments_url":"https://api.github.com/repos/lolyu/avocado-vt/deployments","created_at":"2018-03-09T08:47:06Z","updated_at":"2018-03-20T06:58:00Z","pushed_at":"2018-03-29T09:11:17Z","git_url":"git://github.com/lolyu/avocado-vt.git","ssh_url":"git@github.com:lolyu/avocado-vt.git","clone_url":"https://github.com/lolyu/avocado-vt.git","svn_url":"https://github.com/lolyu/avocado-vt","homepage":"http://avocado-vt.readthedocs.org/","size":27359,"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,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"avocado-framework:master","ref":"master","sha":"23bcefc82911508978f450bc7b556527478bc0c1","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":"2018-03-29T10:18:19Z","pushed_at":"2018-03-30T02:28:24Z","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":27426,"stargazers_count":31,"watchers_count":31,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":135,"mirror_url":null,"archived":false,"open_issues_count":123,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":135,"open_issues":123,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/1431"},"html":{"href":"https://github.com/avocado-framework/avocado-vt/pull/1431"},"issue":{"href":"https://api.github.com/repos/avocado-framework/avocado-vt/issues/1431"},"comments":{"href":"https://api.github.com/repos/avocado-framework/avocado-vt/issues/1431/comments"},"review_comments":{"href":"https://api.github.com/repos/avocado-framework/avocado-vt/pulls/1431/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/1431/commits"},"statuses":{"href":"https://api.github.com/repos/avocado-framework/avocado-vt/statuses/5d27238dde6893738e49763735e12614eb71877e"}},"author_association":"NONE"}}
{"actor":{"display_login":"CongLi"}}