)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"efcf9af320cab424c9e81191f8f1a232069d95ac","unresolved":false,"context_lines":[{"line_number":10,"context_line":"It contains the following data for vGPU types:"},{"line_number":11,"context_line":"* total amount:"},{"line_number":12,"context_line":"  The capacity of the vGPUs which will be used to create"},{"line_number":13,"context_line":"  inventory date for ResourceClass.VGPU."},{"line_number":14,"context_line":"* max_heads:"},{"line_number":15,"context_line":"  The maximal display heads which will be used to create"},{"line_number":16,"context_line":"  inventory data for ResourceClass.VGPU_DISPLAY_HEAD."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3f4b6375_655b0f87","line":13,"range":{"start_line":13,"start_character":12,"end_line":13,"end_character":16},"updated":"2017-10-31 22:26:33.000000000","message":"data","commit_id":"3e24746a16d446706fe1aa45959e98038282868a"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"9ff79da2f0b58cce5c947b05d8f97e8529d09898","unresolved":false,"context_lines":[{"line_number":10,"context_line":"It contains the following data for vGPU types:"},{"line_number":11,"context_line":"* total amount:"},{"line_number":12,"context_line":"  The capacity of the vGPUs which will be used to create"},{"line_number":13,"context_line":"  inventory date for ResourceClass.VGPU."},{"line_number":14,"context_line":"* max_heads:"},{"line_number":15,"context_line":"  The maximal display heads which will be used to create"},{"line_number":16,"context_line":"  inventory data for ResourceClass.VGPU_DISPLAY_HEAD."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3f4b6375_966d189a","line":13,"range":{"start_line":13,"start_character":12,"end_line":13,"end_character":16},"in_reply_to":"3f4b6375_655b0f87","updated":"2017-11-01 06:32:04.000000000","message":"ack:-)","commit_id":"3e24746a16d446706fe1aa45959e98038282868a"}],"nova/compute/resource_tracker.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"a122bc19b1f443022e8515ea801cc24438af6ec0","unresolved":false,"context_lines":[{"line_number":756,"context_line":"                   \u0027free_disk\u0027: free_disk_gb,"},{"line_number":757,"context_line":"                   \u0027free_vcpus\u0027: free_vcpus,"},{"line_number":758,"context_line":"                   \u0027pci_devices\u0027: pci_devices,"},{"line_number":759,"context_line":"                   \u0027vgpu_stats\u0027: str(vgpu_stats)})"},{"line_number":760,"context_line":""},{"line_number":761,"context_line":"    def _report_final_resource_view(self, nodename):"},{"line_number":762,"context_line":"        \"\"\"Report final calculate of physical memory, used virtual memory,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_4d3f7886","line":759,"range":{"start_line":759,"start_character":33,"end_line":759,"end_character":37},"updated":"2017-10-27 12:30:27.000000000","message":"Why does this need a str()?  Isn\u0027t this in a similar format to the pci_devices?","commit_id":"53b5d18595c82d43b0aef72b04edea4ce6f91b8f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"a81de9a9fb5c65555f32cd9a7218fcd92e675d6d","unresolved":false,"context_lines":[{"line_number":756,"context_line":"                   \u0027free_disk\u0027: free_disk_gb,"},{"line_number":757,"context_line":"                   \u0027free_vcpus\u0027: free_vcpus,"},{"line_number":758,"context_line":"                   \u0027pci_devices\u0027: pci_devices,"},{"line_number":759,"context_line":"                   \u0027vgpu_stats\u0027: str(vgpu_stats)})"},{"line_number":760,"context_line":""},{"line_number":761,"context_line":"    def _report_final_resource_view(self, nodename):"},{"line_number":762,"context_line":"        \"\"\"Report final calculate of physical memory, used virtual memory,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_16f5fa83","line":759,"range":{"start_line":759,"start_character":33,"end_line":759,"end_character":37},"in_reply_to":"3f4b6375_4d3f7886","updated":"2017-10-28 09:41:42.000000000","message":"Not really need it. The dict will be print as string with the formatting \"%(...)s\".","commit_id":"53b5d18595c82d43b0aef72b04edea4ce6f91b8f"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"efcf9af320cab424c9e81191f8f1a232069d95ac","unresolved":false,"context_lines":[{"line_number":742,"context_line":""},{"line_number":743,"context_line":"        pci_devices \u003d resources.get(\u0027pci_passthrough_devices\u0027)"},{"line_number":744,"context_line":""},{"line_number":745,"context_line":"        vgpu_stats \u003d resources.get(\u0027vgpu_stats\u0027)"},{"line_number":746,"context_line":""},{"line_number":747,"context_line":"        LOG.debug(\"Hypervisor/Node resource view: \""},{"line_number":748,"context_line":"                  \"name\u003d%(node)s \""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_e5fc9f3f","line":745,"range":{"start_line":745,"start_character":8,"end_line":745,"end_character":18},"updated":"2017-10-31 22:26:33.000000000","message":"erm, no, this won\u0027t work :) vgpu_stats is in a XenAPI-specific format. I\u0027d prefer we keep the vGPU stats LOG messages within the virt drivers themselves, please.","commit_id":"3e24746a16d446706fe1aa45959e98038282868a"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"9ff79da2f0b58cce5c947b05d8f97e8529d09898","unresolved":false,"context_lines":[{"line_number":742,"context_line":""},{"line_number":743,"context_line":"        pci_devices \u003d resources.get(\u0027pci_passthrough_devices\u0027)"},{"line_number":744,"context_line":""},{"line_number":745,"context_line":"        vgpu_stats \u003d resources.get(\u0027vgpu_stats\u0027)"},{"line_number":746,"context_line":""},{"line_number":747,"context_line":"        LOG.debug(\"Hypervisor/Node resource view: \""},{"line_number":748,"context_line":"                  \"name\u003d%(node)s \""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_39d3fed7","line":745,"range":{"start_line":745,"start_character":8,"end_line":745,"end_character":18},"in_reply_to":"3f4b6375_e5fc9f3f","updated":"2017-11-01 06:32:04.000000000","message":"Got the point. Agreed. I will move the log for vGPU stats to XenAPI.","commit_id":"3e24746a16d446706fe1aa45959e98038282868a"}],"nova/tests/unit/virt/xenapi/test_driver.py":[{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"1632c28cf0a037417d147847d99214d24c28c018","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                         \u0027total\u0027: 7,"},{"line_number":75,"context_line":"                         \u0027max_heads\u0027: 1,"},{"line_number":76,"context_line":"                         \u0027type_name\u0027: \u0027Intel GVT-g\u0027,"},{"line_number":77,"context_line":"                         },"},{"line_number":78,"context_line":"                     }}"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def test_available_resource(self):"}],"source_content_type":"text/x-python","patch_set":28,"id":"ff82abbf_95f076ff","line":77,"updated":"2017-11-24 05:55:42.000000000","message":"Hi, Jianghua, why do you removed below fake data from patch27?\n                    \u00276e54af62-9bb3-4477-9ff4-6d15f3a8e097\u0027:\n                        {\u0027uuid\u0027: \u00275a6f1959-c6a5-4642-b4b1-ce126483c73e\u0027,\n                         \u0027total\u0027: 4,\n                         \u0027max_heads\u0027: 4,\n                         \u0027type_name\u0027: \u0027GRID K180Q\u0027,\n                         },","commit_id":"6856199cad4a14de7e1173131ca7870cda08efbe"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"cef867be21ff71a314188d3e0546540927f2cbc5","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                         \u0027total\u0027: 7,"},{"line_number":75,"context_line":"                         \u0027max_heads\u0027: 1,"},{"line_number":76,"context_line":"                         \u0027type_name\u0027: \u0027Intel GVT-g\u0027,"},{"line_number":77,"context_line":"                         },"},{"line_number":78,"context_line":"                     }}"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def test_available_resource(self):"}],"source_content_type":"text/x-python","patch_set":28,"id":"ff82abbf_6d171e47","line":77,"in_reply_to":"ff82abbf_95f076ff","updated":"2017-11-24 14:55:56.000000000","message":"As now we added restriction that only one vGPU type can be enabled in one compute node:-)","commit_id":"6856199cad4a14de7e1173131ca7870cda08efbe"}],"nova/tests/unit/virt/xenapi/test_vgpu.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"a122bc19b1f443022e8515ea801cc24438af6ec0","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"def fake_call_xenapi(fun_name, *args):"},{"line_number":22,"context_line":"    if fun_name \u003d\u003d \u0027GPU_group.get_by_uuid\u0027:"},{"line_number":23,"context_line":"        return \u0027grp_ref\u0027"},{"line_number":24,"context_line":"    elif fun_name \u003d\u003d \u0027GPU_group.get_enabled_VGPU_types\u0027:"},{"line_number":25,"context_line":"        return [\u0027type_ref_1\u0027, \u0027type_ref_2\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_0d24e05c","line":22,"updated":"2017-10-27 12:30:27.000000000","message":"Might be worth having a simple dictionary pre-defined, e.g.:\nvgpu_types \u003d {\u0027type_ref_1\u0027: {\u0027model_name\u0027: \u0027type_name_1\u0027, {\u0027uuid\u0027: \u0027type_uuid_1\u0027, \u0027max_heads\u0027: 4}}\nThen you could have:\nif fun_name.starts_with(VGPU_type.get_):\n  return vgpu_types[args[0]][fun_name[len(VGPU_type.get_):]]","commit_id":"53b5d18595c82d43b0aef72b04edea4ce6f91b8f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"a81de9a9fb5c65555f32cd9a7218fcd92e675d6d","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"def fake_call_xenapi(fun_name, *args):"},{"line_number":22,"context_line":"    if fun_name \u003d\u003d \u0027GPU_group.get_by_uuid\u0027:"},{"line_number":23,"context_line":"        return \u0027grp_ref\u0027"},{"line_number":24,"context_line":"    elif fun_name \u003d\u003d \u0027GPU_group.get_enabled_VGPU_types\u0027:"},{"line_number":25,"context_line":"        return [\u0027type_ref_1\u0027, \u0027type_ref_2\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_f6f13e97","line":22,"in_reply_to":"3f4b6375_0d24e05c","updated":"2017-10-28 09:41:42.000000000","message":"yeah. your advice is much better. thanks.","commit_id":"53b5d18595c82d43b0aef72b04edea4ce6f91b8f"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"a122bc19b1f443022e8515ea801cc24438af6ec0","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                       return_value\u003d7)"},{"line_number":66,"context_line":"    def test_get_vgpu_stats_in_group(self, mock_get, mock_update):"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        self.flags(enabled_vgpu_types\u003d[\u0027type_name_1\u0027], group\u003d\u0027devices\u0027)"},{"line_number":69,"context_line":"        session \u003d mock.Mock()"},{"line_number":70,"context_line":"        session.call_xenapi.side_effect \u003d fake_call_xenapi"},{"line_number":71,"context_line":"        host_obj \u003d host.HostState(session)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_6dc11454","line":68,"range":{"start_line":68,"start_character":40,"end_line":68,"end_character":51},"updated":"2017-10-27 12:30:27.000000000","message":"Might be a better test to look for type_name_2 so it\u0027s not the first one?","commit_id":"53b5d18595c82d43b0aef72b04edea4ce6f91b8f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"a81de9a9fb5c65555f32cd9a7218fcd92e675d6d","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                       return_value\u003d7)"},{"line_number":66,"context_line":"    def test_get_vgpu_stats_in_group(self, mock_get, mock_update):"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        self.flags(enabled_vgpu_types\u003d[\u0027type_name_1\u0027], group\u003d\u0027devices\u0027)"},{"line_number":69,"context_line":"        session \u003d mock.Mock()"},{"line_number":70,"context_line":"        session.call_xenapi.side_effect \u003d fake_call_xenapi"},{"line_number":71,"context_line":"        host_obj \u003d host.HostState(session)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_b62986f3","line":68,"range":{"start_line":68,"start_character":40,"end_line":68,"end_character":51},"in_reply_to":"3f4b6375_6dc11454","updated":"2017-10-28 09:41:42.000000000","message":"++","commit_id":"53b5d18595c82d43b0aef72b04edea4ce6f91b8f"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"a122bc19b1f443022e8515ea801cc24438af6ec0","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                        \u0027total\u0027: 7,"},{"line_number":88,"context_line":"                        }"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        self.assertEqual(expect_calls, session.call_xenapi.call_args_list)"},{"line_number":91,"context_line":"        mock_get.assert_called_once()"},{"line_number":92,"context_line":"        self.assertEqual(expect_stats, stats)"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_0de980e4","line":90,"updated":"2017-10-27 12:30:27.000000000","message":"This is quite fragile - e.g. depends on the exact calling sequence. Do we need it?","commit_id":"53b5d18595c82d43b0aef72b04edea4ce6f91b8f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"a81de9a9fb5c65555f32cd9a7218fcd92e675d6d","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                        \u0027total\u0027: 7,"},{"line_number":88,"context_line":"                        }"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        self.assertEqual(expect_calls, session.call_xenapi.call_args_list)"},{"line_number":91,"context_line":"        mock_get.assert_called_once()"},{"line_number":92,"context_line":"        self.assertEqual(expect_stats, stats)"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_76330e64","line":90,"in_reply_to":"3f4b6375_0de980e4","updated":"2017-10-28 09:41:42.000000000","message":"I thought we should ensure the calling sequence similar as some existing tests.","commit_id":"53b5d18595c82d43b0aef72b04edea4ce6f91b8f"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"a122bc19b1f443022e8515ea801cc24438af6ec0","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                                                    mock_update):"},{"line_number":150,"context_line":"        # Test when the enable_vgpu_types in configure is not in"},{"line_number":151,"context_line":"        # the GPU group. It will return None."},{"line_number":152,"context_line":"        self.flags(enabled_vgpu_types\u003d[\u0027type_name_9\u0027], group\u003d\u0027devices\u0027)"},{"line_number":153,"context_line":"        session \u003d mock.Mock()"},{"line_number":154,"context_line":"        session.call_xenapi.side_effect \u003d fake_call_xenapi"},{"line_number":155,"context_line":"        host_obj \u003d host.HostState(session)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_adc26c51","line":152,"range":{"start_line":152,"start_character":40,"end_line":152,"end_character":51},"updated":"2017-10-27 12:30:27.000000000","message":"bad_type_name?","commit_id":"53b5d18595c82d43b0aef72b04edea4ce6f91b8f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"a81de9a9fb5c65555f32cd9a7218fcd92e675d6d","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                                                    mock_update):"},{"line_number":150,"context_line":"        # Test when the enable_vgpu_types in configure is not in"},{"line_number":151,"context_line":"        # the GPU group. It will return None."},{"line_number":152,"context_line":"        self.flags(enabled_vgpu_types\u003d[\u0027type_name_9\u0027], group\u003d\u0027devices\u0027)"},{"line_number":153,"context_line":"        session \u003d mock.Mock()"},{"line_number":154,"context_line":"        session.call_xenapi.side_effect \u003d fake_call_xenapi"},{"line_number":155,"context_line":"        host_obj \u003d host.HostState(session)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_5638123c","line":152,"range":{"start_line":152,"start_character":40,"end_line":152,"end_character":51},"in_reply_to":"3f4b6375_adc26c51","updated":"2017-10-28 09:41:42.000000000","message":"++","commit_id":"53b5d18595c82d43b0aef72b04edea4ce6f91b8f"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"582770b40a12975269cef28d60de554ffde715fd","unresolved":false,"context_lines":[{"line_number":27,"context_line":"            \u0027max_heads\u0027: 4,"},{"line_number":28,"context_line":"        },"},{"line_number":29,"context_line":"        \u0027type_ref_2\u0027: {"},{"line_number":30,"context_line":"                \u0027uuid\u0027: \u0027type_uuid_2\u0027,"},{"line_number":31,"context_line":"                \u0027model_name\u0027: \u0027type_name_2\u0027,"},{"line_number":32,"context_line":"                \u0027max_heads\u0027: 1,"},{"line_number":33,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_f165b646","line":30,"updated":"2017-11-01 16:31:15.000000000","message":"Formatting","commit_id":"3e24746a16d446706fe1aa45959e98038282868a"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"abfe76a9e63854f04ef78a9048af374408c9325d","unresolved":false,"context_lines":[{"line_number":27,"context_line":"            \u0027max_heads\u0027: 4,"},{"line_number":28,"context_line":"        },"},{"line_number":29,"context_line":"        \u0027type_ref_2\u0027: {"},{"line_number":30,"context_line":"                \u0027uuid\u0027: \u0027type_uuid_2\u0027,"},{"line_number":31,"context_line":"                \u0027model_name\u0027: \u0027type_name_2\u0027,"},{"line_number":32,"context_line":"                \u0027max_heads\u0027: 1,"},{"line_number":33,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_2e4a7254","line":30,"in_reply_to":"3f4b6375_f165b646","updated":"2017-11-02 03:29:58.000000000","message":"yes:-(","commit_id":"3e24746a16d446706fe1aa45959e98038282868a"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"582770b40a12975269cef28d60de554ffde715fd","unresolved":false,"context_lines":[{"line_number":153,"context_line":"                                                    mock_update):"},{"line_number":154,"context_line":"        # Test when the enable_vgpu_types in configure is not in"},{"line_number":155,"context_line":"        # the GPU group. It will return None."},{"line_number":156,"context_line":"        self.flags(enabled_vgpu_types\u003d[\u0027type_name_9\u0027], group\u003d\u0027devices\u0027)"},{"line_number":157,"context_line":"        session \u003d mock.Mock()"},{"line_number":158,"context_line":"        session.call_xenapi.side_effect \u003d fake_call_xenapi"},{"line_number":159,"context_line":"        host_obj \u003d host.HostState(session)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_514ecac1","line":156,"range":{"start_line":156,"start_character":40,"end_line":156,"end_character":51},"updated":"2017-11-01 16:31:15.000000000","message":"I meant instead of type_name_9 why not use bad_type_name?","commit_id":"3e24746a16d446706fe1aa45959e98038282868a"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"abfe76a9e63854f04ef78a9048af374408c9325d","unresolved":false,"context_lines":[{"line_number":153,"context_line":"                                                    mock_update):"},{"line_number":154,"context_line":"        # Test when the enable_vgpu_types in configure is not in"},{"line_number":155,"context_line":"        # the GPU group. It will return None."},{"line_number":156,"context_line":"        self.flags(enabled_vgpu_types\u003d[\u0027type_name_9\u0027], group\u003d\u0027devices\u0027)"},{"line_number":157,"context_line":"        session \u003d mock.Mock()"},{"line_number":158,"context_line":"        session.call_xenapi.side_effect \u003d fake_call_xenapi"},{"line_number":159,"context_line":"        host_obj \u003d host.HostState(session)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_6e698abc","line":156,"range":{"start_line":156,"start_character":40,"end_line":156,"end_character":51},"in_reply_to":"3f4b6375_514ecac1","updated":"2017-11-02 03:29:58.000000000","message":"My apology.","commit_id":"3e24746a16d446706fe1aa45959e98038282868a"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"361975d01fee4ac15da278040f841893b7b64ca9","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        self.flags(enabled_vgpu_types\u003d[\u0027type_name_1\u0027], group\u003d\u0027devices\u0027)"},{"line_number":91,"context_line":"        session \u003d mock.Mock()"},{"line_number":92,"context_line":"        session.call_xenapi.side_effect \u003d fake_call_xenapi"},{"line_number":93,"context_line":"        host_obj \u003d host.HostState(session)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        stats \u003d host_obj._get_vgpu_stats_in_group(\u0027grp_ref\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f4b6375_4c61c804","line":92,"range":{"start_line":92,"start_character":42,"end_line":92,"end_character":58},"updated":"2017-11-07 14:45:13.000000000","message":"I\u0027d like to say that I personally feel hiding the returned results in the fake_call_xenapi() function (which has the if/else statements to determine what to return) makes these tests far harder to understand that just doing:\n\n session.call_xenapi.return_value \u003d { ... }\n\nand putting the expected return value directly into each test method.\n\nAs this currently stands, the reviewer needs to somehow backtrack to fake_call_xenapi(), figure out which parameters are being passed to it, and then determine which results are returned from it, and then skip down to the test method again and verify that everything about the test assertions is correct. Which is hard. Much harder than if the return_value of the mock was simply stated in the test method itself.\n\nWould it be possible for you to change these tests to just specify the expected return_value for the XenAPI call directly in each test method please?","commit_id":"4c113018d5674cdcb273f85462785235a715ce8d"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"edab12e5a1b540300033af192fefd0061455d1cf","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class VGPUTestCase(test.NoDBTestCase):"},{"line_number":20,"context_line":"    \"\"\"Unit tests for Driver operations.\"\"\""},{"line_number":21,"context_line":"    def setup(self):"},{"line_number":22,"context_line":"        super(VGPUTestCase, self).setup()"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    @mock.patch.object(host.HostState, \u0027update_status\u0027,"},{"line_number":25,"context_line":"                       return_value\u003d\u0027fake_stats_1\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_9849c5d1","line":22,"range":{"start_line":21,"start_character":0,"end_line":22,"end_character":41},"updated":"2017-11-14 18:39:55.000000000","message":"this can be removed.","commit_id":"0e4c0918b6ddd012621d58e57a7d54132c3d9500"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"45179408757fd71ef5bf957d7e1fe61c992d18b9","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class VGPUTestCase(test.NoDBTestCase):"},{"line_number":20,"context_line":"    \"\"\"Unit tests for Driver operations.\"\"\""},{"line_number":21,"context_line":"    def setup(self):"},{"line_number":22,"context_line":"        super(VGPUTestCase, self).setup()"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    @mock.patch.object(host.HostState, \u0027update_status\u0027,"},{"line_number":25,"context_line":"                       return_value\u003d\u0027fake_stats_1\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_3031b8ed","line":22,"range":{"start_line":21,"start_character":0,"end_line":22,"end_character":41},"in_reply_to":"1f485f77_9849c5d1","updated":"2017-11-15 03:38:04.000000000","message":"Done","commit_id":"0e4c0918b6ddd012621d58e57a7d54132c3d9500"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"edab12e5a1b540300033af192fefd0061455d1cf","unresolved":false,"context_lines":[{"line_number":53,"context_line":"            \u0027type_name_2\u0027,"},{"line_number":54,"context_line":"            \u0027type_uuid_2\u0027,"},{"line_number":55,"context_line":"            \u00274\u0027,"},{"line_number":56,"context_line":"        ]"},{"line_number":57,"context_line":"        host_obj \u003d host.HostState(session)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        stats \u003d host_obj._get_vgpu_stats_in_group(\u0027grp_ref\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_69775da2","line":56,"updated":"2017-11-14 18:39:55.000000000","message":"it would be an understatement to say that the above side_effect setting is hard to comprehend... I know the XenAPI object has an awkward call(stringmethod, ...) interface, so it\u0027s not like you can do a whole lot about the unreadable tests. However, it would be useful for you to put a code comment on each line highlighting what that particular expected call is.\n\nFor instance...\n\n session.call_xenapi.side_effect \u003d [\n     [\u0027type_ref_1\u0027, \u0027type_ref_2\u0027],  # GPU_group.get_enabled_VGPU_types\n     \u0027type_name_1\u0027,  # VGPU_group.get_vgpu_type\n\netc...","commit_id":"0e4c0918b6ddd012621d58e57a7d54132c3d9500"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"45179408757fd71ef5bf957d7e1fe61c992d18b9","unresolved":false,"context_lines":[{"line_number":53,"context_line":"            \u0027type_name_2\u0027,"},{"line_number":54,"context_line":"            \u0027type_uuid_2\u0027,"},{"line_number":55,"context_line":"            \u00274\u0027,"},{"line_number":56,"context_line":"        ]"},{"line_number":57,"context_line":"        host_obj \u003d host.HostState(session)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        stats \u003d host_obj._get_vgpu_stats_in_group(\u0027grp_ref\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_1038fc9d","line":56,"in_reply_to":"1f485f77_69775da2","updated":"2017-11-15 03:38:04.000000000","message":"Jay,\nThanks for the understanding on my way faking calls on call_xenapi. We have a patch to os-xenapi which will expose the VGPU relative objects directly within sessions instead of calling call_xenapi with stringmethod. There will be a refactor work on all of the existing call_xenapi invokes. That will happen after a new os-xenapi released. At the moment, I\u0027ve added the inline comments for each string method to make it easier to comprehend.\n\nJianghua","commit_id":"0e4c0918b6ddd012621d58e57a7d54132c3d9500"}],"nova/tests/unit/virt/xenapi/test_xenapi.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"a122bc19b1f443022e8515ea801cc24438af6ec0","unresolved":false,"context_lines":[{"line_number":2252,"context_line":"            \u0027physical_utilisation\u0027: 0,"},{"line_number":2253,"context_line":"            \u0027virtual_allocation\u0027: 0,"},{"line_number":2254,"context_line":"            }"},{"line_number":2255,"context_line":"        vgpu_stats \u003d {"},{"line_number":2256,"context_line":"            \u0027c8328467-badf-43d8-8e28-0e096b0f88b1\u0027:"},{"line_number":2257,"context_line":"                {\u0027uuid\u0027: \u00276444c6ee-3a49-42f5-bebb-606b52175e67\u0027,"},{"line_number":2258,"context_line":"                 \u0027total\u0027: 7,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_ed7aa421","line":2255,"updated":"2017-10-27 12:30:27.000000000","message":"There\u0027s a fair amount of copy/paste of this block - should we just refer to it once?","commit_id":"53b5d18595c82d43b0aef72b04edea4ce6f91b8f"}],"nova/virt/xenapi/driver.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"008fd05350075d7b68fc3209924b3eb290ac23f4","unresolved":false,"context_lines":[{"line_number":472,"context_line":"               \u0027supported_instances\u0027: host_stats[\u0027supported_instances\u0027],"},{"line_number":473,"context_line":"               \u0027pci_passthrough_devices\u0027: jsonutils.dumps("},{"line_number":474,"context_line":"                   host_stats[\u0027pci_passthrough_devices\u0027]),"},{"line_number":475,"context_line":"               \u0027vgpu_stats\u0027: host_stats[\u0027vgpu_stats\u0027],"},{"line_number":476,"context_line":"               \u0027numa_topology\u0027: None}"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"        return dic"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_e61013ab","line":475,"range":{"start_line":475,"start_character":15,"end_line":475,"end_character":54},"updated":"2017-11-01 14:09:53.000000000","message":"This is passing the XenAPI-internal representation of vGPU statistics out of the virt driver API, which is not good. We need to come up with a standardized representation for this information instead of using the XenAPI-specific representation. For now, can you just leave this line out of this patch and we\u0027ll have the conversation about this on the next patch?","commit_id":"3e479d3c1253188e45889d3b3f10f1e2b3120459"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"dc582642217166cfd22cb8500be5ab80222b5fbb","unresolved":false,"context_lines":[{"line_number":472,"context_line":"               \u0027supported_instances\u0027: host_stats[\u0027supported_instances\u0027],"},{"line_number":473,"context_line":"               \u0027pci_passthrough_devices\u0027: jsonutils.dumps("},{"line_number":474,"context_line":"                   host_stats[\u0027pci_passthrough_devices\u0027]),"},{"line_number":475,"context_line":"               \u0027vgpu_stats\u0027: host_stats[\u0027vgpu_stats\u0027],"},{"line_number":476,"context_line":"               \u0027numa_topology\u0027: None}"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"        return dic"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_dca7260b","line":475,"range":{"start_line":475,"start_character":15,"end_line":475,"end_character":54},"in_reply_to":"3f4b6375_e61013ab","updated":"2017-11-01 15:02:43.000000000","message":"Yeah. Logically this function of get_available_resource should include all of the available resources. But actually we use get_inventory() to report the vGPU resources. So it seems there is no need to report vGPUs here. Right? If we need depends on the stats to correct the allocations mismatching, we may consider to define a standardized definition for vgpu_stats.\n\nAnyway, I agreed with your point that we shouldn\u0027t passing the XenAPI-internal things to upstream. I will delete this line from this patch.","commit_id":"3e479d3c1253188e45889d3b3f10f1e2b3120459"}],"nova/virt/xenapi/host.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"86978d3c83495be692bccb95e11f6a4d0222337a","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        \"\"\""},{"line_number":250,"context_line":"        vgpu_stats \u003d {}"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        gpu_groups \u003d self._session.GPU_group.get_all_records()"},{"line_number":253,"context_line":"        pgpus \u003d self._session.PGPU.get_all_records()"},{"line_number":254,"context_line":"        vgpu_types \u003d self._session.VGPU_type.get_all_records()"},{"line_number":255,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_a02ebca2","line":252,"updated":"2017-10-19 17:02:06.000000000","message":"FYI when there are cases like this without the class mapped in os-xenapi then we can still use something like self._session.call_xenapi(\"GPU_group.get_all_records\")","commit_id":"783a88db5ab37588422547ffbb84617e35003b27"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"a73c80940e9bfe3ed558d2feceab7173fad1c26c","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        \"\"\""},{"line_number":250,"context_line":"        vgpu_stats \u003d {}"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        gpu_groups \u003d self._session.GPU_group.get_all_records()"},{"line_number":253,"context_line":"        pgpus \u003d self._session.PGPU.get_all_records()"},{"line_number":254,"context_line":"        vgpu_types \u003d self._session.VGPU_type.get_all_records()"},{"line_number":255,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_d356b72a","line":252,"in_reply_to":"3f4b6375_a02ebca2","updated":"2017-10-25 03:29:11.000000000","message":"Got an exception \" AttributeError: \u0027XenAPISession\u0027 object has no attribute \u0027GPU_group\u0027\" after applying the patch, we need to release new os-xenapi codes?","commit_id":"783a88db5ab37588422547ffbb84617e35003b27"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"24236e9bac4d8d50cebd95339ddcc56d7efe4113","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        \"\"\""},{"line_number":250,"context_line":"        vgpu_stats \u003d {}"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        gpu_groups \u003d self._session.GPU_group.get_all_records()"},{"line_number":253,"context_line":"        pgpus \u003d self._session.PGPU.get_all_records()"},{"line_number":254,"context_line":"        vgpu_types \u003d self._session.VGPU_type.get_all_records()"},{"line_number":255,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_8eea580c","line":252,"in_reply_to":"3f4b6375_d356b72a","updated":"2017-10-25 03:44:53.000000000","message":"sorry, my mistake, it should be a class of xapi. Check if my xapi version is too old.","commit_id":"783a88db5ab37588422547ffbb84617e35003b27"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"efcf9af320cab424c9e81191f8f1a232069d95ac","unresolved":false,"context_lines":[{"line_number":239,"context_line":"    def _get_vgpu_stats_in_group(self, grp_uuid):"},{"line_number":240,"context_line":"        \"\"\"Invoke XenAPI to get the stats for a GPU group."},{"line_number":241,"context_line":"        NOTE(Jianghuaw): In XenAPI, a GPU group is the minimal unit"},{"line_number":242,"context_line":"        from where to create a vGPU for an instance. So at here it"},{"line_number":243,"context_line":"        reports vGPU resources basing on GPU group. When we use"},{"line_number":244,"context_line":"        nested resource providers to represent the vGPU resources,"},{"line_number":245,"context_line":"        each GPU group will be a child resource provider under the"},{"line_number":246,"context_line":"        compute node."}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_8565eb1f","line":243,"range":{"start_line":242,"start_character":53,"end_line":243,"end_character":51},"updated":"2017-10-31 22:26:33.000000000","message":"\"So here, we report vGPU resources for a particular GPU group.\"","commit_id":"3e24746a16d446706fe1aa45959e98038282868a"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"9ff79da2f0b58cce5c947b05d8f97e8529d09898","unresolved":false,"context_lines":[{"line_number":239,"context_line":"    def _get_vgpu_stats_in_group(self, grp_uuid):"},{"line_number":240,"context_line":"        \"\"\"Invoke XenAPI to get the stats for a GPU group."},{"line_number":241,"context_line":"        NOTE(Jianghuaw): In XenAPI, a GPU group is the minimal unit"},{"line_number":242,"context_line":"        from where to create a vGPU for an instance. So at here it"},{"line_number":243,"context_line":"        reports vGPU resources basing on GPU group. When we use"},{"line_number":244,"context_line":"        nested resource providers to represent the vGPU resources,"},{"line_number":245,"context_line":"        each GPU group will be a child resource provider under the"},{"line_number":246,"context_line":"        compute node."}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_f3b8dee5","line":243,"range":{"start_line":242,"start_character":53,"end_line":243,"end_character":51},"in_reply_to":"3f4b6375_8565eb1f","updated":"2017-11-01 06:32:04.000000000","message":"Agreed.","commit_id":"3e24746a16d446706fe1aa45959e98038282868a"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"9ff79da2f0b58cce5c947b05d8f97e8529d09898","unresolved":false,"context_lines":[{"line_number":239,"context_line":"    def _get_vgpu_stats_in_group(self, grp_uuid):"},{"line_number":240,"context_line":"        \"\"\"Invoke XenAPI to get the stats for a GPU group."},{"line_number":241,"context_line":"        NOTE(Jianghuaw): In XenAPI, a GPU group is the minimal unit"},{"line_number":242,"context_line":"        from where to create a vGPU for an instance. So at here it"},{"line_number":243,"context_line":"        reports vGPU resources basing on GPU group. When we use"},{"line_number":244,"context_line":"        nested resource providers to represent the vGPU resources,"},{"line_number":245,"context_line":"        each GPU group will be a child resource provider under the"},{"line_number":246,"context_line":"        compute node."}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_5660c0a5","line":243,"range":{"start_line":242,"start_character":53,"end_line":243,"end_character":51},"in_reply_to":"3f4b6375_8565eb1f","updated":"2017-11-01 06:32:04.000000000","message":"Done","commit_id":"3e24746a16d446706fe1aa45959e98038282868a"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"efcf9af320cab424c9e81191f8f1a232069d95ac","unresolved":false,"context_lines":[{"line_number":240,"context_line":"        \"\"\"Invoke XenAPI to get the stats for a GPU group."},{"line_number":241,"context_line":"        NOTE(Jianghuaw): In XenAPI, a GPU group is the minimal unit"},{"line_number":242,"context_line":"        from where to create a vGPU for an instance. So at here it"},{"line_number":243,"context_line":"        reports vGPU resources basing on GPU group. When we use"},{"line_number":244,"context_line":"        nested resource providers to represent the vGPU resources,"},{"line_number":245,"context_line":"        each GPU group will be a child resource provider under the"},{"line_number":246,"context_line":"        compute node."},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"        The return value is a dict.For example:"},{"line_number":249,"context_line":"        {\u0027uuid\u0027: \u00276444c6ee-3a49-42f5-bebb-606b52175e67\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_0571fbde","line":246,"range":{"start_line":243,"start_character":52,"end_line":246,"end_character":21},"updated":"2017-10-31 22:26:33.000000000","message":"ack. correct.","commit_id":"3e24746a16d446706fe1aa45959e98038282868a"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"efcf9af320cab424c9e81191f8f1a232069d95ac","unresolved":false,"context_lines":[{"line_number":269,"context_line":"                             for type_ref in type_refs_in_grp}"},{"line_number":270,"context_line":"        # Get the vGPU type enabled both in this GPU group and in the"},{"line_number":271,"context_line":"        # nova conf."},{"line_number":272,"context_line":"        enabled_types \u003d sorted(list(set(cfg_enabled_types) \u0026"},{"line_number":273,"context_line":"                                   set(type_names_in_grp.keys())))"},{"line_number":274,"context_line":"        if not enabled_types:"},{"line_number":275,"context_line":"            return"},{"line_number":276,"context_line":"        chosen_type \u003d enabled_types[0]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_65130f68","line":273,"range":{"start_line":272,"start_character":8,"end_line":273,"end_character":66},"updated":"2017-10-31 22:26:33.000000000","message":"this is tough to read, and there\u0027s actually no need to use list() or keys(). You can do this instead:\n\n enabled_types \u003d sorted(set(cfg_enabled_types) \u0026\n                        set(type_names_in_grp))\n\n \u003e\u003e\u003e s1 \u003d set([\u0027a\u0027, \u0027c\u0027, \u0027b\u0027])\n \u003e\u003e\u003e s2 \u003d set(dict(b\u003d1, a\u003d2))\n \u003e\u003e\u003e sorted(s1 \u0026 s2)\n [\u0027a\u0027, \u0027b\u0027]","commit_id":"3e24746a16d446706fe1aa45959e98038282868a"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"9ff79da2f0b58cce5c947b05d8f97e8529d09898","unresolved":false,"context_lines":[{"line_number":269,"context_line":"                             for type_ref in type_refs_in_grp}"},{"line_number":270,"context_line":"        # Get the vGPU type enabled both in this GPU group and in the"},{"line_number":271,"context_line":"        # nova conf."},{"line_number":272,"context_line":"        enabled_types \u003d sorted(list(set(cfg_enabled_types) \u0026"},{"line_number":273,"context_line":"                                   set(type_names_in_grp.keys())))"},{"line_number":274,"context_line":"        if not enabled_types:"},{"line_number":275,"context_line":"            return"},{"line_number":276,"context_line":"        chosen_type \u003d enabled_types[0]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_59e91a7e","line":273,"range":{"start_line":272,"start_character":8,"end_line":273,"end_character":66},"in_reply_to":"3f4b6375_65130f68","updated":"2017-11-01 06:32:04.000000000","message":"Thanks:-)","commit_id":"3e24746a16d446706fe1aa45959e98038282868a"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"efcf9af320cab424c9e81191f8f1a232069d95ac","unresolved":false,"context_lines":[{"line_number":278,"context_line":"        if len(enabled_types) \u003e 1:"},{"line_number":279,"context_line":"            LOG.warning(\u0027XenAPI only supports one vGPU type per GPU group,\u0027"},{"line_number":280,"context_line":"                        \u0027 but enabled multiple vGPU types: %(types)s.\u0027"},{"line_number":281,"context_line":"                        \u0027 Choose the first one: %(type)s.\u0027,"},{"line_number":282,"context_line":"                       dict(types\u003denabled_types,"},{"line_number":283,"context_line":"                            type\u003dchosen_type))"},{"line_number":284,"context_line":"        type_ref \u003d type_names_in_grp[chosen_type]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_a8755e9a","line":281,"range":{"start_line":281,"start_character":26,"end_line":281,"end_character":32},"updated":"2017-10-31 22:26:33.000000000","message":"Choosing","commit_id":"3e24746a16d446706fe1aa45959e98038282868a"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"9ff79da2f0b58cce5c947b05d8f97e8529d09898","unresolved":false,"context_lines":[{"line_number":278,"context_line":"        if len(enabled_types) \u003e 1:"},{"line_number":279,"context_line":"            LOG.warning(\u0027XenAPI only supports one vGPU type per GPU group,\u0027"},{"line_number":280,"context_line":"                        \u0027 but enabled multiple vGPU types: %(types)s.\u0027"},{"line_number":281,"context_line":"                        \u0027 Choose the first one: %(type)s.\u0027,"},{"line_number":282,"context_line":"                       dict(types\u003denabled_types,"},{"line_number":283,"context_line":"                            type\u003dchosen_type))"},{"line_number":284,"context_line":"        type_ref \u003d type_names_in_grp[chosen_type]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_167ec86a","line":281,"range":{"start_line":281,"start_character":26,"end_line":281,"end_character":32},"in_reply_to":"3f4b6375_a8755e9a","updated":"2017-11-01 06:32:04.000000000","message":"Done","commit_id":"3e24746a16d446706fe1aa45959e98038282868a"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"582770b40a12975269cef28d60de554ffde715fd","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        return passthrough_devices"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def _get_vgpu_stats(self):"},{"line_number":224,"context_line":"        \"\"\"Invoke XenAPI to get the stats for VGPUs."},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"        The return value is a dict which has GPU groups\u0027 uuid as"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f4b6375_c5df4a38","line":223,"updated":"2017-11-01 16:31:15.000000000","message":"This seems to be used by another file - File-level functions can be prefixed by _ but ones used externally should not be.","commit_id":"10066a6c6d34656e5be4a818d79a1deef00987fe"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"abfe76a9e63854f04ef78a9048af374408c9325d","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        return passthrough_devices"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def _get_vgpu_stats(self):"},{"line_number":224,"context_line":"        \"\"\"Invoke XenAPI to get the stats for VGPUs."},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"        The return value is a dict which has GPU groups\u0027 uuid as"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f4b6375_0e1696f2","line":223,"in_reply_to":"3f4b6375_c5df4a38","updated":"2017-11-02 03:29:58.000000000","message":"At least this function is only invoked internally by the function of update_status. The UT is an exception but I assume that\u0027s not a problem?","commit_id":"10066a6c6d34656e5be4a818d79a1deef00987fe"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"582770b40a12975269cef28d60de554ffde715fd","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        \"\"\"Invoke XenAPI to get the stats for VGPUs."},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"        The return value is a dict which has GPU groups\u0027 uuid as"},{"line_number":227,"context_line":"        the keys."},{"line_number":228,"context_line":"        \"\"\""},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"        vgpu_grp_refs \u003d self._session.call_xenapi(\u0027GPU_group.get_all\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f4b6375_651bf61a","line":227,"updated":"2017-11-01 16:31:15.000000000","message":"This implies we should describe the values - or perhaps just refer to _get_vgpu_stats_in_group","commit_id":"10066a6c6d34656e5be4a818d79a1deef00987fe"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"abfe76a9e63854f04ef78a9048af374408c9325d","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        \"\"\"Invoke XenAPI to get the stats for VGPUs."},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"        The return value is a dict which has GPU groups\u0027 uuid as"},{"line_number":227,"context_line":"        the keys."},{"line_number":228,"context_line":"        \"\"\""},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"        vgpu_grp_refs \u003d self._session.call_xenapi(\u0027GPU_group.get_all\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f4b6375_0eee96b3","line":227,"in_reply_to":"3f4b6375_651bf61a","updated":"2017-11-02 03:29:58.000000000","message":"++","commit_id":"10066a6c6d34656e5be4a818d79a1deef00987fe"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"582770b40a12975269cef28d60de554ffde715fd","unresolved":false,"context_lines":[{"line_number":235,"context_line":"            if stat:"},{"line_number":236,"context_line":"                vgpu_stats[grp_uuid] \u003d stat"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"        LOG.debug(\"The stats for vGPU: %s\", vgpu_stats)"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        return vgpu_stats"},{"line_number":241,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3f4b6375_a521ee4f","line":238,"updated":"2017-11-01 16:31:15.000000000","message":"Nit: Would be better as \"Returning vGPU stats: %s\")","commit_id":"10066a6c6d34656e5be4a818d79a1deef00987fe"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"582770b40a12975269cef28d60de554ffde715fd","unresolved":false,"context_lines":[{"line_number":283,"context_line":"        chosen_type \u003d sorted_types[0]"},{"line_number":284,"context_line":"        if len(sorted_types) \u003e 1:"},{"line_number":285,"context_line":"            LOG.warning(\u0027XenAPI only supports one vGPU type per GPU group,\u0027"},{"line_number":286,"context_line":"                        \u0027 but enabled multiple vGPU types: %(types)s.\u0027"},{"line_number":287,"context_line":"                        \u0027 Choosing the first one: %(type)s.\u0027,"},{"line_number":288,"context_line":"                       dict(types\u003dsorted_types,"},{"line_number":289,"context_line":"                            type\u003dchosen_type))"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f4b6375_45991a77","line":286,"updated":"2017-11-01 16:31:15.000000000","message":"having types and type is confusing.\nI\u0027d suggest \"available\" and \"chosen\" for the dict to pass in.","commit_id":"10066a6c6d34656e5be4a818d79a1deef00987fe"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"abfe76a9e63854f04ef78a9048af374408c9325d","unresolved":false,"context_lines":[{"line_number":283,"context_line":"        chosen_type \u003d sorted_types[0]"},{"line_number":284,"context_line":"        if len(sorted_types) \u003e 1:"},{"line_number":285,"context_line":"            LOG.warning(\u0027XenAPI only supports one vGPU type per GPU group,\u0027"},{"line_number":286,"context_line":"                        \u0027 but enabled multiple vGPU types: %(types)s.\u0027"},{"line_number":287,"context_line":"                        \u0027 Choosing the first one: %(type)s.\u0027,"},{"line_number":288,"context_line":"                       dict(types\u003dsorted_types,"},{"line_number":289,"context_line":"                            type\u003dchosen_type))"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f4b6375_ae82e2c6","line":286,"in_reply_to":"3f4b6375_45991a77","updated":"2017-11-02 03:29:58.000000000","message":"++","commit_id":"10066a6c6d34656e5be4a818d79a1deef00987fe"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"582770b40a12975269cef28d60de554ffde715fd","unresolved":false,"context_lines":[{"line_number":302,"context_line":"        \"\"\"Get the total capacity of vGPUs in the group.\"\"\""},{"line_number":303,"context_line":"        grp_ref \u003d self._session.call_xenapi(\u0027GPU_group.get_by_uuid\u0027,"},{"line_number":304,"context_line":"                                             grp_uuid)"},{"line_number":305,"context_line":"        type_ref \u003d self._session.call_xenapi(\u0027VGPU_type.get_by_uuid\u0027,"},{"line_number":306,"context_line":"                                             type_uuid)"},{"line_number":307,"context_line":"        pgpu_refs \u003d self._session.call_xenapi(\u0027GPU_group.get_PGPUs\u0027,"},{"line_number":308,"context_line":"                                              grp_ref)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f4b6375_e5d006cc","line":305,"range":{"start_line":305,"start_character":8,"end_line":305,"end_character":16},"updated":"2017-11-01 16:31:15.000000000","message":"If we are going from a type_uuid then why can\u0027t we use XAPI to find the answers, rather than using logic in Python?\n\ne.g. VGPU_type.get_enabled-on-PGPUs and VGPU_type.get_supported-on-GPU-groups?\n\nWe could even use a get_all_records_where to get XAPI to search for the PGPUs which are enabled and in the right group?\n\nOn the other hand, if we have the group already, then we know all vGPU types are supported by that group (by definition) and we know all of the GPUs that are in the group.\nTherefore the type_ref check might just be superfluous?","commit_id":"10066a6c6d34656e5be4a818d79a1deef00987fe"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"8274d5168b9fd840e37c2fb990d164b91296e557","unresolved":false,"context_lines":[{"line_number":302,"context_line":"        \"\"\"Get the total capacity of vGPUs in the group.\"\"\""},{"line_number":303,"context_line":"        grp_ref \u003d self._session.call_xenapi(\u0027GPU_group.get_by_uuid\u0027,"},{"line_number":304,"context_line":"                                             grp_uuid)"},{"line_number":305,"context_line":"        type_ref \u003d self._session.call_xenapi(\u0027VGPU_type.get_by_uuid\u0027,"},{"line_number":306,"context_line":"                                             type_uuid)"},{"line_number":307,"context_line":"        pgpu_refs \u003d self._session.call_xenapi(\u0027GPU_group.get_PGPUs\u0027,"},{"line_number":308,"context_line":"                                              grp_ref)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f4b6375_77d03a20","line":305,"range":{"start_line":305,"start_character":8,"end_line":305,"end_character":16},"in_reply_to":"3f4b6375_9415f44b","updated":"2017-11-02 03:45:20.000000000","message":"I think we still need check if the vGPU types are enabled in the PGPUs, as xapi allows to disable a VGPU type in a specific PGPU.","commit_id":"10066a6c6d34656e5be4a818d79a1deef00987fe"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"20d2009d6bf976a3f089149eeae7fc0bfdaa206c","unresolved":false,"context_lines":[{"line_number":302,"context_line":"        \"\"\"Get the total capacity of vGPUs in the group.\"\"\""},{"line_number":303,"context_line":"        grp_ref \u003d self._session.call_xenapi(\u0027GPU_group.get_by_uuid\u0027,"},{"line_number":304,"context_line":"                                             grp_uuid)"},{"line_number":305,"context_line":"        type_ref \u003d self._session.call_xenapi(\u0027VGPU_type.get_by_uuid\u0027,"},{"line_number":306,"context_line":"                                             type_uuid)"},{"line_number":307,"context_line":"        pgpu_refs \u003d self._session.call_xenapi(\u0027GPU_group.get_PGPUs\u0027,"},{"line_number":308,"context_line":"                                              grp_ref)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f4b6375_bad0c720","line":305,"range":{"start_line":305,"start_character":8,"end_line":305,"end_character":16},"in_reply_to":"3f4b6375_9415f44b","updated":"2017-11-02 15:46:06.000000000","message":"Re-thinking on this. As this function is used by host_stat only, actually we can use refs instead of uuids. Less xenapi callings if use refs.","commit_id":"10066a6c6d34656e5be4a818d79a1deef00987fe"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"abfe76a9e63854f04ef78a9048af374408c9325d","unresolved":false,"context_lines":[{"line_number":302,"context_line":"        \"\"\"Get the total capacity of vGPUs in the group.\"\"\""},{"line_number":303,"context_line":"        grp_ref \u003d self._session.call_xenapi(\u0027GPU_group.get_by_uuid\u0027,"},{"line_number":304,"context_line":"                                             grp_uuid)"},{"line_number":305,"context_line":"        type_ref \u003d self._session.call_xenapi(\u0027VGPU_type.get_by_uuid\u0027,"},{"line_number":306,"context_line":"                                             type_uuid)"},{"line_number":307,"context_line":"        pgpu_refs \u003d self._session.call_xenapi(\u0027GPU_group.get_PGPUs\u0027,"},{"line_number":308,"context_line":"                                              grp_ref)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f4b6375_9415f44b","line":305,"range":{"start_line":305,"start_character":8,"end_line":305,"end_character":16},"in_reply_to":"3f4b6375_e5d006cc","updated":"2017-11-02 03:29:58.000000000","message":"Bob,\n The reason for starting from uuid instead of ref is to ensure this function can be re-used easier. As ref is something internal of XenAPI not users visible. When we use nested-resource-provider, the RP\u0027s name will be generated basing on uuids (so that we can easily map it back to uuids from the allocations).\n Agreed to use XAPI as much as possible to search for PGPUs, which should be able to make code clean and get more effective.\n Thanks.\n-Jianghua","commit_id":"10066a6c6d34656e5be4a818d79a1deef00987fe"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"edab12e5a1b540300033af192fefd0061455d1cf","unresolved":false,"context_lines":[{"line_number":233,"context_line":"        vGPU stats in GPU group x. For details, please refer to"},{"line_number":234,"context_line":"        the return value of the function of _get_vgpu_stats_in_group()."},{"line_number":235,"context_line":"        \"\"\""},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"        vgpu_grp_refs \u003d self._session.call_xenapi(\u0027GPU_group.get_all\u0027)"},{"line_number":238,"context_line":"        vgpu_stats \u003d {}"},{"line_number":239,"context_line":"        for ref in vgpu_grp_refs:"}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_69eabd0f","line":236,"updated":"2017-11-14 18:39:55.000000000","message":"unnecessary blank line","commit_id":"0e4c0918b6ddd012621d58e57a7d54132c3d9500"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"45179408757fd71ef5bf957d7e1fe61c992d18b9","unresolved":false,"context_lines":[{"line_number":233,"context_line":"        vGPU stats in GPU group x. For details, please refer to"},{"line_number":234,"context_line":"        the return value of the function of _get_vgpu_stats_in_group()."},{"line_number":235,"context_line":"        \"\"\""},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"        vgpu_grp_refs \u003d self._session.call_xenapi(\u0027GPU_group.get_all\u0027)"},{"line_number":238,"context_line":"        vgpu_stats \u003d {}"},{"line_number":239,"context_line":"        for ref in vgpu_grp_refs:"}],"source_content_type":"text/x-python","patch_set":11,"id":"1f485f77_f02b207f","line":236,"in_reply_to":"1f485f77_69eabd0f","updated":"2017-11-15 03:38:04.000000000","message":"Done","commit_id":"0e4c0918b6ddd012621d58e57a7d54132c3d9500"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"be7ec407a5fd0bcbe597810b7948d88ccb2dc872","unresolved":false,"context_lines":[{"line_number":289,"context_line":"                        \u0027 but enabled multiple vGPU types: %(available)s.\u0027"},{"line_number":290,"context_line":"                        \u0027 Choosing the first one: %(chosen)s.\u0027,"},{"line_number":291,"context_line":"                       dict(available\u003dsorted_types,"},{"line_number":292,"context_line":"                            chosen\u003dchosen_type))"},{"line_number":293,"context_line":"        type_ref \u003d type_names_in_grp[chosen_type]"},{"line_number":294,"context_line":"        type_uuid \u003d self._session.call_xenapi(\u0027VGPU_type.get_uuid\u0027, type_ref)"},{"line_number":295,"context_line":"        stat[\u0027uuid\u0027] \u003d type_uuid"}],"source_content_type":"text/x-python","patch_set":18,"id":"1f485f77_112330bf","line":292,"updated":"2017-11-16 15:41:24.000000000","message":"well, okay, different behaviour from the one I provided with https://review.openstack.org/#/c/514763/6/nova/virt/libvirt/driver.py@5405 but okay.","commit_id":"11c449fd562cd533f795f754edc83e97b4dbe550"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0dcc8fe2a43294526a9d62e222716f57a461a8e3","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        if len(CONF.devices.enabled_vgpu_types) \u003e 1:"},{"line_number":248,"context_line":"            LOG.warning(\u0027XenAPI only supports one GPU type per compute node,\u0027"},{"line_number":249,"context_line":"                        \u0027 only first type will be used.\u0027)"},{"line_number":250,"context_line":"        cfg_enabled_types \u003d CONF.devices.enabled_vgpu_types[:1]"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        vgpu_grp_refs \u003d self._session.call_xenapi(\u0027GPU_group.get_all\u0027)"},{"line_number":253,"context_line":"        for ref in vgpu_grp_refs:"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_2be4fcab","line":250,"range":{"start_line":250,"start_character":59,"end_line":250,"end_character":63},"updated":"2017-12-04 14:35:48.000000000","message":"well, [0] is equivalent, but meh, you prefer to pass a list with only one item, fine by me.","commit_id":"6d2cd197bc312ac4c7b1879f4e64fecc14bb0147"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"f708fccd4a3dddc97b2668a8de5adc8d887faf7a","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        if len(CONF.devices.enabled_vgpu_types) \u003e 1:"},{"line_number":248,"context_line":"            LOG.warning(\u0027XenAPI only supports one GPU type per compute node,\u0027"},{"line_number":249,"context_line":"                        \u0027 only first type will be used.\u0027)"},{"line_number":250,"context_line":"        cfg_enabled_types \u003d CONF.devices.enabled_vgpu_types[:1]"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        vgpu_grp_refs \u003d self._session.call_xenapi(\u0027GPU_group.get_all\u0027)"},{"line_number":253,"context_line":"        for ref in vgpu_grp_refs:"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_2b839b55","line":250,"range":{"start_line":250,"start_character":59,"end_line":250,"end_character":63},"in_reply_to":"df87a7cf_2be4fcab","updated":"2017-12-04 14:56:39.000000000","message":"Sylvain, I\u0027d keep the parameter of _get_vgpu_stats_in_group to accept a list. so that it\u0027s very easy to pass the whole list when we switch to use n-rp. Just as I said in the above NOTE.","commit_id":"6d2cd197bc312ac4c7b1879f4e64fecc14bb0147"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0dcc8fe2a43294526a9d62e222716f57a461a8e3","unresolved":false,"context_lines":[{"line_number":249,"context_line":"                        \u0027 only first type will be used.\u0027)"},{"line_number":250,"context_line":"        cfg_enabled_types \u003d CONF.devices.enabled_vgpu_types[:1]"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        vgpu_grp_refs \u003d self._session.call_xenapi(\u0027GPU_group.get_all\u0027)"},{"line_number":253,"context_line":"        for ref in vgpu_grp_refs:"},{"line_number":254,"context_line":"            grp_uuid \u003d self._session.call_xenapi(\u0027GPU_group.get_uuid\u0027, ref)"},{"line_number":255,"context_line":"            stat \u003d self._get_vgpu_stats_in_group(ref, cfg_enabled_types)"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_2bfddc39","line":252,"updated":"2017-12-04 14:35:48.000000000","message":"does it need some Xen version ? Is that call supported by the minimum Xen version that Nova supports ?","commit_id":"6d2cd197bc312ac4c7b1879f4e64fecc14bb0147"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"f708fccd4a3dddc97b2668a8de5adc8d887faf7a","unresolved":false,"context_lines":[{"line_number":249,"context_line":"                        \u0027 only first type will be used.\u0027)"},{"line_number":250,"context_line":"        cfg_enabled_types \u003d CONF.devices.enabled_vgpu_types[:1]"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        vgpu_grp_refs \u003d self._session.call_xenapi(\u0027GPU_group.get_all\u0027)"},{"line_number":253,"context_line":"        for ref in vgpu_grp_refs:"},{"line_number":254,"context_line":"            grp_uuid \u003d self._session.call_xenapi(\u0027GPU_group.get_uuid\u0027, ref)"},{"line_number":255,"context_line":"            stat \u003d self._get_vgpu_stats_in_group(ref, cfg_enabled_types)"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_abc6cb66","line":252,"in_reply_to":"df87a7cf_2bfddc39","updated":"2017-12-04 14:56:39.000000000","message":"Yes, the API was introduced since xs6.0 so also exists in the minimum Xen Version support by nova - XS6.5 SP1.\nhttp://xapi-project.github.io/xen-api/classes/gpu_group.html\n...\nPublished in:\tXenServer 6.0 (XCP 1.5) (boston)","commit_id":"6d2cd197bc312ac4c7b1879f4e64fecc14bb0147"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e803f129e1c79c5a1c27ab971b1216157a9032f4","unresolved":false,"context_lines":[{"line_number":249,"context_line":"                        \u0027 only first type will be used.\u0027)"},{"line_number":250,"context_line":"        cfg_enabled_types \u003d CONF.devices.enabled_vgpu_types[:1]"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        vgpu_grp_refs \u003d self._session.call_xenapi(\u0027GPU_group.get_all\u0027)"},{"line_number":253,"context_line":"        for ref in vgpu_grp_refs:"},{"line_number":254,"context_line":"            grp_uuid \u003d self._session.call_xenapi(\u0027GPU_group.get_uuid\u0027, ref)"},{"line_number":255,"context_line":"            stat \u003d self._get_vgpu_stats_in_group(ref, cfg_enabled_types)"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_4e286d85","line":252,"in_reply_to":"df87a7cf_abc6cb66","updated":"2017-12-04 15:10:03.000000000","message":"Cool, thanks.","commit_id":"6d2cd197bc312ac4c7b1879f4e64fecc14bb0147"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0dcc8fe2a43294526a9d62e222716f57a461a8e3","unresolved":false,"context_lines":[{"line_number":256,"context_line":"            if stat:"},{"line_number":257,"context_line":"                vgpu_stats[grp_uuid] \u003d stat"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"        LOG.debug(\"Returning vGPU stats: %s\", vgpu_stats)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"        return vgpu_stats"},{"line_number":262,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_ebbdb468","line":259,"updated":"2017-12-04 14:35:48.000000000","message":"Can be a huge LOG string but okay.","commit_id":"6d2cd197bc312ac4c7b1879f4e64fecc14bb0147"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"5296b52ed9f91365ea67202b3d0d89529dc99f91","unresolved":false,"context_lines":[{"line_number":256,"context_line":"            if stat:"},{"line_number":257,"context_line":"                vgpu_stats[grp_uuid] \u003d stat"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"        LOG.debug(\"Returning vGPU stats: %s\", vgpu_stats)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"        return vgpu_stats"},{"line_number":262,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_6bf52357","line":259,"in_reply_to":"df87a7cf_ebbdb468","updated":"2017-12-04 15:05:36.000000000","message":"It will print this log each time invoking get_host_stat, but there won\u0027t be too many GPU groups at the moment. So not a big problem I think.","commit_id":"6d2cd197bc312ac4c7b1879f4e64fecc14bb0147"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0dcc8fe2a43294526a9d62e222716f57a461a8e3","unresolved":false,"context_lines":[{"line_number":278,"context_line":"         }"},{"line_number":279,"context_line":"        \"\"\""},{"line_number":280,"context_line":"        type_refs_in_grp \u003d self._session.call_xenapi("},{"line_number":281,"context_line":"            \u0027GPU_group.get_enabled_VGPU_types\u0027, grp_ref)"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"        type_names_in_grp \u003d {self._session.call_xenapi("},{"line_number":284,"context_line":"                                 \u0027VGPU_type.get_model_name\u0027,"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_6bb1a48f","line":281,"updated":"2017-12-04 14:35:48.000000000","message":"same question than the above about the Xen version","commit_id":"6d2cd197bc312ac4c7b1879f4e64fecc14bb0147"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"f708fccd4a3dddc97b2668a8de5adc8d887faf7a","unresolved":false,"context_lines":[{"line_number":278,"context_line":"         }"},{"line_number":279,"context_line":"        \"\"\""},{"line_number":280,"context_line":"        type_refs_in_grp \u003d self._session.call_xenapi("},{"line_number":281,"context_line":"            \u0027GPU_group.get_enabled_VGPU_types\u0027, grp_ref)"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"        type_names_in_grp \u003d {self._session.call_xenapi("},{"line_number":284,"context_line":"                                 \u0027VGPU_type.get_model_name\u0027,"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_6bbd23b6","line":281,"in_reply_to":"df87a7cf_6bb1a48f","updated":"2017-12-04 14:56:39.000000000","message":"see the above answer. thanks.","commit_id":"6d2cd197bc312ac4c7b1879f4e64fecc14bb0147"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0dcc8fe2a43294526a9d62e222716f57a461a8e3","unresolved":false,"context_lines":[{"line_number":296,"context_line":"        sorted_types \u003d sorted(enabled_types)"},{"line_number":297,"context_line":"        chosen_type \u003d sorted_types[0]"},{"line_number":298,"context_line":"        if len(sorted_types) \u003e 1:"},{"line_number":299,"context_line":"            LOG.warning(\u0027XenAPI only supports one vGPU type per GPU group,\u0027"},{"line_number":300,"context_line":"                        \u0027 but enabled multiple vGPU types: %(available)s.\u0027"},{"line_number":301,"context_line":"                        \u0027 Choosing the first one: %(chosen)s.\u0027,"},{"line_number":302,"context_line":"                       dict(available\u003dsorted_types,"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_2b595c59","line":299,"updated":"2017-12-04 14:35:48.000000000","message":"possibly a TODO comment saying we could remove that once we have nested RPs ?","commit_id":"6d2cd197bc312ac4c7b1879f4e64fecc14bb0147"}]}
