{"action":"created","comment":{"url":"https://api.github.com/repos/autotest/tp-qemu/pulls/comments/190784783","pull_request_review_id":123235492,"id":190784783,"diff_hunk":"@@ -2059,6 +2061,51 @@ def memory_move():\n         else:\n             return (out)\n \n+    def cfs_bandwidth():\n+        \"\"\"\n+        CFS bandwidth limit\n+        \"\"\"\n+        def stress_thread():\n+            session.cmd(\"stress -c 1 -t 100\", 120)\n+\n+        logging.info(\"Setup test\")\n+        modules = CgroupModules()\n+        if (modules.init(['cpu']) != 1):\n+            raise exceptions.TestFail(\"Can't mount cpu cgroup modules\")\n+        cgroup = Cgroup('cpu', '')\n+        cgroup.initialize(modules)\n+\n+        # Create VM with smp=1\n+        params['smp'] = 1\n+        params[\"vcpu_sockets\"] = 1\n+        vm_name = params[\"main_vm\"]\n+        params[\"start_vm\"] = \"yes\"\n+        env_process.preprocess_vm(test, params, env, vm_name)\n+        vm = env.get_vm(params[\"main_vm\"])\n+        login_timeout = int(params.get(\"login_timeout\", 360))\n+        session = vm.wait_for_login(timeout=login_timeout)\n+\n+        cgroup.mk_cgroup()\n+        cgroup.set_property(\"cpu.cfs_period_us\", 100000, 0)\n+        cgroup.set_property(\"cpu.cfs_quota_us\", 50000, 0)\n+        assign_vm_into_cgroup(vm, cgroup, 0)\n+\n+        logging.info(\"Test\")\n+        stress_t = threading.Thread(target=stress_thread)\n+        stress_t.start()\n+        count = 0\n+        while count < 6:\n+            time.sleep(10)\n+            o = process.system_output(\"top -b -p %s -n 3 | tail -1\" % vm.get_pid(),","path":"qemu/tests/cgroup.py","position":55,"original_position":55,"commit_id":"942fcbb6a870c9763d0b44e5cc50fb696a20a5b2","original_commit_id":"942fcbb6a870c9763d0b44e5cc50fb696a20a5b2","user":{"login":"hereischen","id":5623129,"avatar_url":"https://avatars1.githubusercontent.com/u/5623129?v=4","gravatar_id":"","url":"https://api.github.com/users/hereischen","html_url":"https://github.com/hereischen","followers_url":"https://api.github.com/users/hereischen/followers","following_url":"https://api.github.com/users/hereischen/following{/other_user}","gists_url":"https://api.github.com/users/hereischen/gists{/gist_id}","starred_url":"https://api.github.com/users/hereischen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hereischen/subscriptions","organizations_url":"https://api.github.com/users/hereischen/orgs","repos_url":"https://api.github.com/users/hereischen/repos","events_url":"https://api.github.com/users/hereischen/events{/privacy}","received_events_url":"https://api.github.com/users/hereischen/received_events","type":"User","site_admin":false},"body":"Although it is number actually needed, so you may not have problem on Python 3, it is better decode() the `bytes` output to `str`.","created_at":"2018-05-25T03:50:13Z","updated_at":"2018-05-25T03:50:18Z","html_url":"https://github.com/autotest/tp-qemu/pull/1385#discussion_r190784783","pull_request_url":"https://api.github.com/repos/autotest/tp-qemu/pulls/1385","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/autotest/tp-qemu/pulls/comments/190784783"},"html":{"href":"https://github.com/autotest/tp-qemu/pull/1385#discussion_r190784783"},"pull_request":{"href":"https://api.github.com/repos/autotest/tp-qemu/pulls/1385"}}},"pull_request":{"url":"https://api.github.com/repos/autotest/tp-qemu/pulls/1385","id":188667521,"html_url":"https://github.com/autotest/tp-qemu/pull/1385","diff_url":"https://github.com/autotest/tp-qemu/pull/1385.diff","patch_url":"https://github.com/autotest/tp-qemu/pull/1385.patch","issue_url":"https://api.github.com/repos/autotest/tp-qemu/issues/1385","number":1385,"state":"open","locked":false,"title":"cgroup: add case of CFS bandwidth limit","user":{"login":"YanhuiMa","id":26761478,"avatar_url":"https://avatars3.githubusercontent.com/u/26761478?v=4","gravatar_id":"","url":"https://api.github.com/users/YanhuiMa","html_url":"https://github.com/YanhuiMa","followers_url":"https://api.github.com/users/YanhuiMa/followers","following_url":"https://api.github.com/users/YanhuiMa/following{/other_user}","gists_url":"https://api.github.com/users/YanhuiMa/gists{/gist_id}","starred_url":"https://api.github.com/users/YanhuiMa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YanhuiMa/subscriptions","organizations_url":"https://api.github.com/users/YanhuiMa/orgs","repos_url":"https://api.github.com/users/YanhuiMa/repos","events_url":"https://api.github.com/users/YanhuiMa/events{/privacy}","received_events_url":"https://api.github.com/users/YanhuiMa/received_events","type":"User","site_admin":false},"body":"bug id: 1579244\r\nSigned-off-by: yama <yama@redhat.com>","created_at":"2018-05-17T09:02:08Z","updated_at":"2018-05-25T03:50:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ffe58781a39e68653f155ee10508660b9b2c19e4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/autotest/tp-qemu/pulls/1385/commits","review_comments_url":"https://api.github.com/repos/autotest/tp-qemu/pulls/1385/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/1385/comments","statuses_url":"https://api.github.com/repos/autotest/tp-qemu/statuses/942fcbb6a870c9763d0b44e5cc50fb696a20a5b2","head":{"label":"YanhuiMa:cgroup","ref":"cgroup","sha":"942fcbb6a870c9763d0b44e5cc50fb696a20a5b2","user":{"login":"YanhuiMa","id":26761478,"avatar_url":"https://avatars3.githubusercontent.com/u/26761478?v=4","gravatar_id":"","url":"https://api.github.com/users/YanhuiMa","html_url":"https://github.com/YanhuiMa","followers_url":"https://api.github.com/users/YanhuiMa/followers","following_url":"https://api.github.com/users/YanhuiMa/following{/other_user}","gists_url":"https://api.github.com/users/YanhuiMa/gists{/gist_id}","starred_url":"https://api.github.com/users/YanhuiMa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YanhuiMa/subscriptions","organizations_url":"https://api.github.com/users/YanhuiMa/orgs","repos_url":"https://api.github.com/users/YanhuiMa/repos","events_url":"https://api.github.com/users/YanhuiMa/events{/privacy}","received_events_url":"https://api.github.com/users/YanhuiMa/received_events","type":"User","site_admin":false},"repo":{"id":88127970,"name":"tp-qemu","full_name":"YanhuiMa/tp-qemu","owner":{"login":"YanhuiMa","id":26761478,"avatar_url":"https://avatars3.githubusercontent.com/u/26761478?v=4","gravatar_id":"","url":"https://api.github.com/users/YanhuiMa","html_url":"https://github.com/YanhuiMa","followers_url":"https://api.github.com/users/YanhuiMa/followers","following_url":"https://api.github.com/users/YanhuiMa/following{/other_user}","gists_url":"https://api.github.com/users/YanhuiMa/gists{/gist_id}","starred_url":"https://api.github.com/users/YanhuiMa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YanhuiMa/subscriptions","organizations_url":"https://api.github.com/users/YanhuiMa/orgs","repos_url":"https://api.github.com/users/YanhuiMa/repos","events_url":"https://api.github.com/users/YanhuiMa/events{/privacy}","received_events_url":"https://api.github.com/users/YanhuiMa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/YanhuiMa/tp-qemu","description":"Virt Test Provider for qemu and other related virtualization backends","fork":true,"url":"https://api.github.com/repos/YanhuiMa/tp-qemu","forks_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/forks","keys_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/teams","hooks_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/hooks","issue_events_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/issues/events{/number}","events_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/events","assignees_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/assignees{/user}","branches_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/branches{/branch}","tags_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/tags","blobs_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/git/refs{/sha}","trees_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/statuses/{sha}","languages_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/languages","stargazers_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/stargazers","contributors_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/contributors","subscribers_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/subscribers","subscription_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/subscription","commits_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/commits{/sha}","git_commits_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/git/commits{/sha}","comments_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/comments{/number}","issue_comment_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/issues/comments{/number}","contents_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/contents/{+path}","compare_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/merges","archive_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/downloads","issues_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/issues{/number}","pulls_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/pulls{/number}","milestones_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/milestones{/number}","notifications_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/labels{/name}","releases_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/releases{/id}","deployments_url":"https://api.github.com/repos/YanhuiMa/tp-qemu/deployments","created_at":"2017-04-13T05:23:34Z","updated_at":"2018-05-21T06:25:25Z","pushed_at":"2018-05-21T06:25:19Z","git_url":"git://github.com/YanhuiMa/tp-qemu.git","ssh_url":"git@github.com:YanhuiMa/tp-qemu.git","clone_url":"https://github.com/YanhuiMa/tp-qemu.git","svn_url":"https://github.com/YanhuiMa/tp-qemu","homepage":null,"size":16081,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"autotest:master","ref":"master","sha":"66ba607f6ef5d05aac1241ebef8d6ca80086913f","user":{"login":"autotest","id":472856,"avatar_url":"https://avatars1.githubusercontent.com/u/472856?v=4","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://avatars1.githubusercontent.com/u/472856?v=4","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":"2018-05-25T02:51:42Z","pushed_at":"2018-05-25T02:51:28Z","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":15710,"stargazers_count":20,"watchers_count":20,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":116,"mirror_url":null,"archived":false,"open_issues_count":88,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":116,"open_issues":88,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/autotest/tp-qemu/pulls/1385"},"html":{"href":"https://github.com/autotest/tp-qemu/pull/1385"},"issue":{"href":"https://api.github.com/repos/autotest/tp-qemu/issues/1385"},"comments":{"href":"https://api.github.com/repos/autotest/tp-qemu/issues/1385/comments"},"review_comments":{"href":"https://api.github.com/repos/autotest/tp-qemu/pulls/1385/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/1385/commits"},"statuses":{"href":"https://api.github.com/repos/autotest/tp-qemu/statuses/942fcbb6a870c9763d0b44e5cc50fb696a20a5b2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"hereischen"}}