)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7a439e46a4ddbbf22b30a1cc2991ff613c175184","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"9f91af0f_4a6799be","line":24,"updated":"2018-01-08 12:08:53.000000000","message":"nit: could you please refer to the related bp?","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"}],"nova/tests/unit/virt/libvirt/test_config.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"c685556038366b556090b57d248c8cc276383081","unresolved":false,"context_lines":[{"line_number":2799,"context_line":"          \u003cname\u003emdev_4b20d080_1b54_4048_85b3_a6a62d165c01\u003c/name\u003e"},{"line_number":2800,"context_line":"          \u003cparent\u003epci_0000_06_00_0\u003c/parent\u003e"},{"line_number":2801,"context_line":"          \u003ccapability type\u003d\u0027mdev\u0027\u003e"},{"line_number":2802,"context_line":"            \u003ctype id\u003d\u0027nvidia-11\u0027/\u003e"},{"line_number":2803,"context_line":"            \u003ciommuGroup number\u003d\u002712\u0027/\u003e"},{"line_number":2804,"context_line":"          \u003c/capability\u003e"},{"line_number":2805,"context_line":"        \u003c/device\u003e\"\"\""},{"line_number":2806,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"bf8cb3f7_0276caa5","line":2803,"range":{"start_line":2802,"start_character":0,"end_line":2803,"end_character":37},"updated":"2017-12-21 16:21:57.000000000","message":"see, those are specific mediate device information, not capabilities","commit_id":"090d6208d425f118eff7b1db59878a483290e11c"}],"nova/tests/unit/virt/libvirt/test_driver.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"d569a3aefd45ba5d80d34350350fc54386fd019b","unresolved":false,"context_lines":[{"line_number":18090,"context_line":"    @mock.patch(\u0027nova.virt.libvirt.driver.LibvirtDriver\u0027"},{"line_number":18091,"context_line":"                \u0027._get_mdev_capable_devices\u0027)"},{"line_number":18092,"context_line":"    def test_get_vgpu_total(self, get_mdev_devs):"},{"line_number":18093,"context_line":"        get_mdev_devs.return_value \u003d [{\u0027dev_id\u0027: \u0027pci_0000_84_00_0\u0027,"},{"line_number":18094,"context_line":"                                       \u0027nvidia-11\u0027: 16,"},{"line_number":18095,"context_line":"                                       \u0027nvidia-12\u0027: 8},"},{"line_number":18096,"context_line":"                                      {\u0027dev_id\u0027: \u0027pci_0000_85_00_0\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f4b6375_0aa27f4c","line":18093,"updated":"2017-10-27 16:52:19.000000000","message":"this is wrong","commit_id":"0d8e64fceb8e89ee499e5fe8798ec2aef21a127c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3e161272cadafb0f530dcb69ab72512bba665e94","unresolved":false,"context_lines":[{"line_number":18257,"context_line":"                \u0027._get_mediated_devices\u0027)"},{"line_number":18258,"context_line":"    @mock.patch(\u0027nova.virt.libvirt.driver.LibvirtDriver\u0027"},{"line_number":18259,"context_line":"                \u0027._get_mdev_capable_devices\u0027)"},{"line_number":18260,"context_line":"    def test_get_vgpu_total_with_one_mdev(self, get_mdev_devs, get_mdevs):"},{"line_number":18261,"context_line":"        get_mdev_devs.return_value \u003d ["},{"line_number":18262,"context_line":"            {\u0027dev_id\u0027: \u0027pci_0000_84_00_0\u0027,"},{"line_number":18263,"context_line":"             \u0027types\u0027: {\u0027nvidia-11\u0027: {\u0027availableInstances\u0027: 14,"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_d261bb06","line":18260,"range":{"start_line":18260,"start_character":33,"end_line":18260,"end_character":41},"updated":"2017-12-12 15:35:44.000000000","message":"Is this technically two mdevs? Maybe I\u0027m missing the terminology, but this is two devices with multiple instances yes?","commit_id":"83e8f520856c8123e308feef7137d5c56fadb862"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3e161272cadafb0f530dcb69ab72512bba665e94","unresolved":false,"context_lines":[{"line_number":18283,"context_line":"        self.flags(enabled_vgpu_types\u003d[\u0027nvidia-11\u0027], group\u003d\u0027devices\u0027)"},{"line_number":18284,"context_line":"        # We have 14 available resources for creating mdevs plus 2 existing"},{"line_number":18285,"context_line":"        # for the same nvidia-11 type, the 3rd mdev using a non-requested type."},{"line_number":18286,"context_line":"        self.assertEqual(16, self.drvr._get_vgpu_total())"},{"line_number":18287,"context_line":""},{"line_number":18288,"context_line":""},{"line_number":18289,"context_line":"class LibvirtVolumeUsageTestCase(test.NoDBTestCase):"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_15070d1a","line":18286,"updated":"2017-12-12 15:35:44.000000000","message":"It took me a sec to reconcile this because I was assuming we should have gotten 25 here, or maybe 22. But, this is asking for the total number, which is limited by the config\u0027s specification of nvidia-11, which only includes the 14 available, plus the two allocated for that type. What\u0027s weird is that there is one allocated for nvidia-12, but that is not configured, so.. not sure how that could have happened :)\n\nAnyway, nothing fatal, but if you respin you might add a few more words here.","commit_id":"83e8f520856c8123e308feef7137d5c56fadb862"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7a439e46a4ddbbf22b30a1cc2991ff613c175184","unresolved":false,"context_lines":[{"line_number":18264,"context_line":""},{"line_number":18265,"context_line":"        # Now, ask for only one"},{"line_number":18266,"context_line":"        self.flags(enabled_vgpu_types\u003d[\u0027nvidia-11\u0027], group\u003d\u0027devices\u0027)"},{"line_number":18267,"context_line":"        # We have 14 available for nvidia-11 and 8 for nvidia-12. Just take"},{"line_number":18268,"context_line":"        # nvidia-11 usage since that\u0027s the requested type."},{"line_number":18269,"context_line":"        # We also have 2 mdevs of nvidia-11 type and one for nvidia-12. Same"},{"line_number":18270,"context_line":"        # thing, don\u0027t take in account the last one since it\u0027s a non-supported"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_158c5234","line":18267,"range":{"start_line":18267,"start_character":48,"end_line":18267,"end_character":64},"updated":"2018-01-08 12:08:53.000000000","message":"Where is the 8 nvidia-12 in the test setup?","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7a439e46a4ddbbf22b30a1cc2991ff613c175184","unresolved":false,"context_lines":[{"line_number":18266,"context_line":"        self.flags(enabled_vgpu_types\u003d[\u0027nvidia-11\u0027], group\u003d\u0027devices\u0027)"},{"line_number":18267,"context_line":"        # We have 14 available for nvidia-11 and 8 for nvidia-12. Just take"},{"line_number":18268,"context_line":"        # nvidia-11 usage since that\u0027s the requested type."},{"line_number":18269,"context_line":"        # We also have 2 mdevs of nvidia-11 type and one for nvidia-12. Same"},{"line_number":18270,"context_line":"        # thing, don\u0027t take in account the last one since it\u0027s a non-supported"},{"line_number":18271,"context_line":"        # type."},{"line_number":18272,"context_line":"        # So, as a total, we have 14+2, hence 16."}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_b57c861f","line":18269,"range":{"start_line":18269,"start_character":53,"end_line":18269,"end_character":70},"updated":"2018-01-08 12:08:53.000000000","message":"ditto","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7a439e46a4ddbbf22b30a1cc2991ff613c175184","unresolved":false,"context_lines":[{"line_number":18272,"context_line":"        # So, as a total, we have 14+2, hence 16."},{"line_number":18273,"context_line":"        self.assertEqual(16, self.drvr._get_vgpu_total())"},{"line_number":18274,"context_line":""},{"line_number":18275,"context_line":"        # We can ask for more but only the first type is supported yet."},{"line_number":18276,"context_line":"        # TODO(sbauza): Remove that once we support multiple types"},{"line_number":18277,"context_line":"        self.flags(enabled_vgpu_types\u003d[\u0027nvidia-11\u0027, \u0027nvidia-12\u0027],"},{"line_number":18278,"context_line":"                   group\u003d\u0027devices\u0027)"},{"line_number":18279,"context_line":"        # Only nvidia-11 resources are supported then."},{"line_number":18280,"context_line":"        self.assertEqual(16, self.drvr._get_vgpu_total())"},{"line_number":18281,"context_line":""},{"line_number":18282,"context_line":"    @mock.patch.object(host.Host, \u0027device_lookup_by_name\u0027)"},{"line_number":18283,"context_line":"    @mock.patch.object(host.Host, \u0027list_mdev_capable_devices\u0027)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_55aada70","line":18280,"range":{"start_line":18275,"start_character":1,"end_line":18280,"end_character":57},"updated":"2018-01-08 12:08:53.000000000","message":"I think there is no nvidia-12 in the test setup so this test does not prove that the code only user the first requested type","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7aeb156d088861a71b5bf1ff3bad99ac05c0bb88","unresolved":false,"context_lines":[{"line_number":18272,"context_line":"        # So, as a total, we have 14+2, hence 16."},{"line_number":18273,"context_line":"        self.assertEqual(16, self.drvr._get_vgpu_total())"},{"line_number":18274,"context_line":""},{"line_number":18275,"context_line":"        # We can ask for more but only the first type is supported yet."},{"line_number":18276,"context_line":"        # TODO(sbauza): Remove that once we support multiple types"},{"line_number":18277,"context_line":"        self.flags(enabled_vgpu_types\u003d[\u0027nvidia-11\u0027, \u0027nvidia-12\u0027],"},{"line_number":18278,"context_line":"                   group\u003d\u0027devices\u0027)"},{"line_number":18279,"context_line":"        # Only nvidia-11 resources are supported then."},{"line_number":18280,"context_line":"        self.assertEqual(16, self.drvr._get_vgpu_total())"},{"line_number":18281,"context_line":""},{"line_number":18282,"context_line":"    @mock.patch.object(host.Host, \u0027device_lookup_by_name\u0027)"},{"line_number":18283,"context_line":"    @mock.patch.object(host.Host, \u0027list_mdev_capable_devices\u0027)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_bb20f549","line":18280,"range":{"start_line":18275,"start_character":1,"end_line":18280,"end_character":57},"in_reply_to":"9f91af0f_55aada70","updated":"2018-01-08 13:53:47.000000000","message":"Right, all of the above concerns come from a late PS that I didn\u0027t modified when I started to filter mdevs elsewhere.","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"}],"nova/virt/libvirt/config.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":2448,"context_line":"                funcap \u003d LibvirtConfigNodeDevicePciSubFunctionCap()"},{"line_number":2449,"context_line":"                funcap.parse_dom(c)"},{"line_number":2450,"context_line":"                self.fun_capability.append(funcap)"},{"line_number":2451,"context_line":"            elif c.tag \u003d\u003d \"capability\" and c.get(\u0027type\u0027) in (\u0027mdev_types\u0027,):"},{"line_number":2452,"context_line":"                mdevcap \u003d LibvirtConfigNodeDeviceMdevCapableSubFunctionCap()"},{"line_number":2453,"context_line":"                mdevcap.parse_dom(c)"},{"line_number":2454,"context_line":"                self.mdev_capability.append(mdevcap)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_2a3a22cb","line":2451,"updated":"2017-10-26 08:44:10.000000000","message":"We are in a context of PCI capability, I would have considered to re-use LibvirtConfigNodeDevicePciSubFunctionCap and make the logic based on type inside this class.","commit_id":"332fb844407e6b94dc0142ebbe9dca01753dc398"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":2451,"context_line":"            elif c.tag \u003d\u003d \"capability\" and c.get(\u0027type\u0027) in (\u0027mdev_types\u0027,):"},{"line_number":2452,"context_line":"                mdevcap \u003d LibvirtConfigNodeDeviceMdevCapableSubFunctionCap()"},{"line_number":2453,"context_line":"                mdevcap.parse_dom(c)"},{"line_number":2454,"context_line":"                self.mdev_capability.append(mdevcap)"},{"line_number":2455,"context_line":""},{"line_number":2456,"context_line":""},{"line_number":2457,"context_line":"class LibvirtConfigNodeDevicePciSubFunctionCap(LibvirtConfigObject):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_6af5baec","line":2454,"updated":"2017-10-26 08:44:10.000000000","message":"Not sure why you have added an attribute mdev_capability instead of reuse fun_capability?","commit_id":"332fb844407e6b94dc0142ebbe9dca01753dc398"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":2472,"context_line":"                                          int(c.get(\u0027function\u0027), 16)))"},{"line_number":2473,"context_line":""},{"line_number":2474,"context_line":""},{"line_number":2475,"context_line":"class LibvirtConfigNodeDeviceMdevCapableSubFunctionCap(LibvirtConfigObject):"},{"line_number":2476,"context_line":"    def __init__(self, **kwargs):"},{"line_number":2477,"context_line":"        super(LibvirtConfigNodeDeviceMdevCapableSubFunctionCap, self).__init__("},{"line_number":2478,"context_line":"                                        root_name\u003d\"capability\", **kwargs)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_0a488659","line":2475,"updated":"2017-10-26 08:44:10.000000000","message":"At least if you really want to use a new class so please rename it to keep the same convention.\n\nLibvirtConfigNodeDeviceMdevSubFunctionCap","commit_id":"332fb844407e6b94dc0142ebbe9dca01753dc398"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":2478,"context_line":"                                        root_name\u003d\"capability\", **kwargs)"},{"line_number":2479,"context_line":"        # mdev_types is a list of dictionaries with keys being"},{"line_number":2480,"context_line":"        # (type, name, deviceAPI, availableInstances)"},{"line_number":2481,"context_line":"        self.mdev_types \u003d list()"},{"line_number":2482,"context_line":""},{"line_number":2483,"context_line":"    def parse_dom(self, xmldoc):"},{"line_number":2484,"context_line":"        super(LibvirtConfigNodeDeviceMdevCapableSubFunctionCap,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_8780efc0","line":2481,"updated":"2017-10-26 08:44:10.000000000","message":"I would prefer see a dictionary here. To handle PCI addresses it would make sense using a tuple since each value can\u0027t be  un-ordered.","commit_id":"332fb844407e6b94dc0142ebbe9dca01753dc398"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":2491,"context_line":"                                        if e.tag \u003d\u003d \u0027availableInstances\u0027"},{"line_number":2492,"context_line":"                                        else e.text)"},{"line_number":2493,"context_line":"                self.mdev_types.append(mdev_type)"},{"line_number":2494,"context_line":""},{"line_number":2495,"context_line":""},{"line_number":2496,"context_line":"class LibvirtConfigGuestRng(LibvirtConfigGuestDevice):"},{"line_number":2497,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_c7bf075f","line":2494,"updated":"2017-10-26 08:44:10.000000000","message":"Please also implement format_dom() that will help to produce XML for the functional tests.","commit_id":"332fb844407e6b94dc0142ebbe9dca01753dc398"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":2448,"context_line":"                funcap \u003d LibvirtConfigNodeDevicePciSubFunctionCap()"},{"line_number":2449,"context_line":"                funcap.parse_dom(c)"},{"line_number":2450,"context_line":"                self.fun_capability.append(funcap)"},{"line_number":2451,"context_line":"            elif c.tag \u003d\u003d \"capability\" and c.get(\u0027type\u0027) in (\u0027mdev_types\u0027,):"},{"line_number":2452,"context_line":"                mdevcap \u003d LibvirtConfigNodeDeviceMdevCapableSubFunctionCap()"},{"line_number":2453,"context_line":"                mdevcap.parse_dom(c)"},{"line_number":2454,"context_line":"                self.mdev_capability.append(mdevcap)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_e80ab9cf","line":2451,"updated":"2017-10-26 08:44:10.000000000","message":"We are in a context of PCI capability, I would have considered to re-use LibvirtConfigNodeDevicePciSubFunctionCap and make the logic based on type inside this class.","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4127b693af041fdbf7698a4b8bfadd7333b66a4c","unresolved":false,"context_lines":[{"line_number":2448,"context_line":"                funcap \u003d LibvirtConfigNodeDevicePciSubFunctionCap()"},{"line_number":2449,"context_line":"                funcap.parse_dom(c)"},{"line_number":2450,"context_line":"                self.fun_capability.append(funcap)"},{"line_number":2451,"context_line":"            elif c.tag \u003d\u003d \"capability\" and c.get(\u0027type\u0027) in (\u0027mdev_types\u0027,):"},{"line_number":2452,"context_line":"                mdevcap \u003d LibvirtConfigNodeDeviceMdevCapableSubFunctionCap()"},{"line_number":2453,"context_line":"                mdevcap.parse_dom(c)"},{"line_number":2454,"context_line":"                self.mdev_capability.append(mdevcap)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_c3febe69","line":2451,"in_reply_to":"3f4b6375_e80ab9cf","updated":"2017-10-26 09:35:56.000000000","message":"No, I really want to just use a separate method for that given devices having capabilities for creating mediated devices could be more than just PCI devices.","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":2451,"context_line":"            elif c.tag \u003d\u003d \"capability\" and c.get(\u0027type\u0027) in (\u0027mdev_types\u0027,):"},{"line_number":2452,"context_line":"                mdevcap \u003d LibvirtConfigNodeDeviceMdevCapableSubFunctionCap()"},{"line_number":2453,"context_line":"                mdevcap.parse_dom(c)"},{"line_number":2454,"context_line":"                self.mdev_capability.append(mdevcap)"},{"line_number":2455,"context_line":""},{"line_number":2456,"context_line":""},{"line_number":2457,"context_line":"class LibvirtConfigNodeDevicePciSubFunctionCap(LibvirtConfigObject):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_a8104101","line":2454,"updated":"2017-10-26 08:44:10.000000000","message":"Not sure why you have added an attribute mdev_capability instead of reuse fun_capability?","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4127b693af041fdbf7698a4b8bfadd7333b66a4c","unresolved":false,"context_lines":[{"line_number":2451,"context_line":"            elif c.tag \u003d\u003d \"capability\" and c.get(\u0027type\u0027) in (\u0027mdev_types\u0027,):"},{"line_number":2452,"context_line":"                mdevcap \u003d LibvirtConfigNodeDeviceMdevCapableSubFunctionCap()"},{"line_number":2453,"context_line":"                mdevcap.parse_dom(c)"},{"line_number":2454,"context_line":"                self.mdev_capability.append(mdevcap)"},{"line_number":2455,"context_line":""},{"line_number":2456,"context_line":""},{"line_number":2457,"context_line":"class LibvirtConfigNodeDevicePciSubFunctionCap(LibvirtConfigObject):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_a30f4286","line":2454,"in_reply_to":"3f4b6375_a8104101","updated":"2017-10-26 09:35:56.000000000","message":"fun_capability says which SR-IOV \u0027functional\u0027 capabilities can be used for that device (I mean possible PFs and VFs). Here, we\u0027re not talking of that, but about something very different. Having a separate attribute is also better for just knowing which mdev capabilities are available for that device without looping on all the SR-IOV functions.","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":2472,"context_line":"                                          int(c.get(\u0027function\u0027), 16)))"},{"line_number":2473,"context_line":""},{"line_number":2474,"context_line":""},{"line_number":2475,"context_line":"class LibvirtConfigNodeDeviceMdevCapableSubFunctionCap(LibvirtConfigObject):"},{"line_number":2476,"context_line":"    def __init__(self, **kwargs):"},{"line_number":2477,"context_line":"        super(LibvirtConfigNodeDeviceMdevCapableSubFunctionCap, self).__init__("},{"line_number":2478,"context_line":"                                        root_name\u003d\"capability\", **kwargs)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_28fc51b3","line":2475,"updated":"2017-10-26 08:44:10.000000000","message":"At least if you really want to use a new class so please rename it to keep the same convention.\n\nLibvirtConfigNodeDeviceMdevSubFunctionCap","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4127b693af041fdbf7698a4b8bfadd7333b66a4c","unresolved":false,"context_lines":[{"line_number":2472,"context_line":"                                          int(c.get(\u0027function\u0027), 16)))"},{"line_number":2473,"context_line":""},{"line_number":2474,"context_line":""},{"line_number":2475,"context_line":"class LibvirtConfigNodeDeviceMdevCapableSubFunctionCap(LibvirtConfigObject):"},{"line_number":2476,"context_line":"    def __init__(self, **kwargs):"},{"line_number":2477,"context_line":"        super(LibvirtConfigNodeDeviceMdevCapableSubFunctionCap, self).__init__("},{"line_number":2478,"context_line":"                                        root_name\u003d\"capability\", **kwargs)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_63c94a57","line":2475,"in_reply_to":"3f4b6375_28fc51b3","updated":"2017-10-26 09:35:56.000000000","message":"No, here I want to only report the devices to be *capable* of creating mdevs, not the mediated devices themselves.","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":2478,"context_line":"                                        root_name\u003d\"capability\", **kwargs)"},{"line_number":2479,"context_line":"        # mdev_types is a list of dictionaries with keys being"},{"line_number":2480,"context_line":"        # (type, name, deviceAPI, availableInstances)"},{"line_number":2481,"context_line":"        self.mdev_types \u003d list()"},{"line_number":2482,"context_line":""},{"line_number":2483,"context_line":"    def parse_dom(self, xmldoc):"},{"line_number":2484,"context_line":"        super(LibvirtConfigNodeDeviceMdevCapableSubFunctionCap,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_083195a3","line":2481,"updated":"2017-10-26 08:44:10.000000000","message":"I would prefer see a dictionary here. To handle PCI addresses it would make sense using a tuple since each value can\u0027t be un-ordered.","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4127b693af041fdbf7698a4b8bfadd7333b66a4c","unresolved":false,"context_lines":[{"line_number":2478,"context_line":"                                        root_name\u003d\"capability\", **kwargs)"},{"line_number":2479,"context_line":"        # mdev_types is a list of dictionaries with keys being"},{"line_number":2480,"context_line":"        # (type, name, deviceAPI, availableInstances)"},{"line_number":2481,"context_line":"        self.mdev_types \u003d list()"},{"line_number":2482,"context_line":""},{"line_number":2483,"context_line":"    def parse_dom(self, xmldoc):"},{"line_number":2484,"context_line":"        super(LibvirtConfigNodeDeviceMdevCapableSubFunctionCap,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_83d32604","line":2481,"in_reply_to":"3f4b6375_083195a3","updated":"2017-10-26 09:35:56.000000000","message":"We can discuss on the format, for sure.","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"3d4d9320c2612a41a548d4f64bbe4af0356ca718","unresolved":false,"context_lines":[{"line_number":2488,"context_line":"                mdev_type \u003d {\u0027type\u0027: c.get(\u0027id\u0027)}"},{"line_number":2489,"context_line":"                for e in c.getchildren():"},{"line_number":2490,"context_line":"                    mdev_type[e.tag] \u003d (int(e.text)"},{"line_number":2491,"context_line":"                                        if e.tag \u003d\u003d \u0027availableInstances\u0027"},{"line_number":2492,"context_line":"                                        else e.text)"},{"line_number":2493,"context_line":"                self.mdev_types.append(mdev_type)"},{"line_number":2494,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_6e67f9ea","line":2491,"updated":"2017-10-26 04:01:33.000000000","message":"Per https://libvirt.org/drvnodedev.html#MDEVCap\navailableInstances reports the current state of resource allocation. In other words, how many instances of the given type can *still* be successfully created on the physical device.\n\nSo the \u0027total\u0027 field of the inventory is just the remaining capacity instead of total capacity? https://review.openstack.org/#/c/514763/5/nova/virt/libvirt/driver.py@5834\n\nWe should report the total amount of the VGPUs including the already created ones. right?","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4127b693af041fdbf7698a4b8bfadd7333b66a4c","unresolved":false,"context_lines":[{"line_number":2488,"context_line":"                mdev_type \u003d {\u0027type\u0027: c.get(\u0027id\u0027)}"},{"line_number":2489,"context_line":"                for e in c.getchildren():"},{"line_number":2490,"context_line":"                    mdev_type[e.tag] \u003d (int(e.text)"},{"line_number":2491,"context_line":"                                        if e.tag \u003d\u003d \u0027availableInstances\u0027"},{"line_number":2492,"context_line":"                                        else e.text)"},{"line_number":2493,"context_line":"                self.mdev_types.append(mdev_type)"},{"line_number":2494,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_c3b0fedf","line":2491,"in_reply_to":"3f4b6375_486c2d9b","updated":"2017-10-26 09:35:56.000000000","message":"@Jinghua, you\u0027re right, my bad. MHO is that we should report the available *left* instances here by telling which devices are supporting to be \"mdev capable\" and then we should in _get_vgpu_total() add those values with the number of existing vGPUs.","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":2488,"context_line":"                mdev_type \u003d {\u0027type\u0027: c.get(\u0027id\u0027)}"},{"line_number":2489,"context_line":"                for e in c.getchildren():"},{"line_number":2490,"context_line":"                    mdev_type[e.tag] \u003d (int(e.text)"},{"line_number":2491,"context_line":"                                        if e.tag \u003d\u003d \u0027availableInstances\u0027"},{"line_number":2492,"context_line":"                                        else e.text)"},{"line_number":2493,"context_line":"                self.mdev_types.append(mdev_type)"},{"line_number":2494,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_486c2d9b","line":2491,"in_reply_to":"3f4b6375_6e67f9ea","updated":"2017-10-26 08:44:10.000000000","message":"Right.","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":2492,"context_line":"                                        else e.text)"},{"line_number":2493,"context_line":"                self.mdev_types.append(mdev_type)"},{"line_number":2494,"context_line":""},{"line_number":2495,"context_line":""},{"line_number":2496,"context_line":"class LibvirtConfigGuestRng(LibvirtConfigGuestDevice):"},{"line_number":2497,"context_line":""},{"line_number":2498,"context_line":"    def __init__(self, **kwargs):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_e833d9a9","line":2495,"updated":"2017-10-26 08:44:10.000000000","message":"Please also implement format_dom() that will help to produce XML for the functional tests.","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4127b693af041fdbf7698a4b8bfadd7333b66a4c","unresolved":false,"context_lines":[{"line_number":2492,"context_line":"                                        else e.text)"},{"line_number":2493,"context_line":"                self.mdev_types.append(mdev_type)"},{"line_number":2494,"context_line":""},{"line_number":2495,"context_line":""},{"line_number":2496,"context_line":"class LibvirtConfigGuestRng(LibvirtConfigGuestDevice):"},{"line_number":2497,"context_line":""},{"line_number":2498,"context_line":"    def __init__(self, **kwargs):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_a3b3c2e8","line":2495,"in_reply_to":"3f4b6375_e833d9a9","updated":"2017-10-26 09:35:56.000000000","message":"Ack","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3e161272cadafb0f530dcb69ab72512bba665e94","unresolved":false,"context_lines":[{"line_number":2476,"context_line":"                                          int(c.get(\u0027function\u0027), 16)))"},{"line_number":2477,"context_line":""},{"line_number":2478,"context_line":""},{"line_number":2479,"context_line":"class LibvirtConfigNodeDeviceMdevCapableSubFunctionCap(LibvirtConfigObject):"},{"line_number":2480,"context_line":"    def __init__(self, **kwargs):"},{"line_number":2481,"context_line":"        super(LibvirtConfigNodeDeviceMdevCapableSubFunctionCap, self).__init__("},{"line_number":2482,"context_line":"                                        root_name\u003d\"capability\", **kwargs)"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_d2053b47","line":2479,"range":{"start_line":2479,"start_character":6,"end_line":2479,"end_character":54},"updated":"2017-12-12 15:35:44.000000000","message":"Jeepers.","commit_id":"83e8f520856c8123e308feef7137d5c56fadb862"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"19b312337785f9ace1235fb74559f897c5c5ec14","unresolved":false,"context_lines":[{"line_number":2476,"context_line":"                                          int(c.get(\u0027function\u0027), 16)))"},{"line_number":2477,"context_line":""},{"line_number":2478,"context_line":""},{"line_number":2479,"context_line":"class LibvirtConfigNodeDeviceMdevCapableSubFunctionCap(LibvirtConfigObject):"},{"line_number":2480,"context_line":"    def __init__(self, **kwargs):"},{"line_number":2481,"context_line":"        super(LibvirtConfigNodeDeviceMdevCapableSubFunctionCap, self).__init__("},{"line_number":2482,"context_line":"                                        root_name\u003d\"capability\", **kwargs)"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_4112b20b","line":2479,"range":{"start_line":2479,"start_character":6,"end_line":2479,"end_character":54},"in_reply_to":"df87a7cf_d2053b47","updated":"2017-12-12 21:37:30.000000000","message":"Creepers.","commit_id":"83e8f520856c8123e308feef7137d5c56fadb862"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"23a1d51959f10e26994537fa3ec070ba0fff8ce7","unresolved":false,"context_lines":[{"line_number":2377,"context_line":"        self.parent \u003d None"},{"line_number":2378,"context_line":"        self.driver \u003d None"},{"line_number":2379,"context_line":"        self.pci_capability \u003d None"},{"line_number":2380,"context_line":"        self.mdev_information \u003d None"},{"line_number":2381,"context_line":""},{"line_number":2382,"context_line":"    def parse_dom(self, xmldoc):"},{"line_number":2383,"context_line":"        super(LibvirtConfigNodeDevice, self).parse_dom(xmldoc)"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf8cb3f7_ffe81f17","line":2380,"range":{"start_line":2380,"start_character":18,"end_line":2380,"end_character":29},"updated":"2017-12-21 15:48:42.000000000","message":"Why information and not capability? What\u0027s the difference?","commit_id":"090d6208d425f118eff7b1db59878a483290e11c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"c685556038366b556090b57d248c8cc276383081","unresolved":false,"context_lines":[{"line_number":2377,"context_line":"        self.parent \u003d None"},{"line_number":2378,"context_line":"        self.driver \u003d None"},{"line_number":2379,"context_line":"        self.pci_capability \u003d None"},{"line_number":2380,"context_line":"        self.mdev_information \u003d None"},{"line_number":2381,"context_line":""},{"line_number":2382,"context_line":"    def parse_dom(self, xmldoc):"},{"line_number":2383,"context_line":"        super(LibvirtConfigNodeDevice, self).parse_dom(xmldoc)"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf8cb3f7_df18bb82","line":2380,"range":{"start_line":2380,"start_character":18,"end_line":2380,"end_character":29},"in_reply_to":"bf8cb3f7_ffe81f17","updated":"2017-12-21 16:21:57.000000000","message":"No, that\u0027s not a capability, that\u0027s rather the direct mediated device information (ie. the type and the IOMMU group, hence the name.\n\nSee the difference here https://libvirt.org/drvnodedev.html#MDEV","commit_id":"090d6208d425f118eff7b1db59878a483290e11c"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"23a1d51959f10e26994537fa3ec070ba0fff8ce7","unresolved":false,"context_lines":[{"line_number":2392,"context_line":"                pcicap.parse_dom(c)"},{"line_number":2393,"context_line":"                self.pci_capability \u003d pcicap"},{"line_number":2394,"context_line":"            elif c.tag \u003d\u003d \"capability\" and c.get(\"type\") in [\u0027mdev\u0027]:"},{"line_number":2395,"context_line":"                mdev_info \u003d LibvirtConfigNodeDeviceMdevInformation()"},{"line_number":2396,"context_line":"                mdev_info.parse_dom(c)"},{"line_number":2397,"context_line":"                self.mdev_information \u003d mdev_info"},{"line_number":2398,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"bf8cb3f7_3f6d2798","line":2395,"range":{"start_line":2395,"start_character":55,"end_line":2395,"end_character":66},"updated":"2017-12-21 15:48:42.000000000","message":"Cap. If you think they should both be s/Cap/Information/, let\u0027s do that separately","commit_id":"090d6208d425f118eff7b1db59878a483290e11c"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":5393,"context_line":"        where one or more pGPUs supports that type."},{"line_number":5394,"context_line":"        \"\"\""},{"line_number":5395,"context_line":"        # Bail out early if operator doesn\u0027t care about providing vGPUs"},{"line_number":5396,"context_line":"        if not CONF.devices.enabled_vgpu_types:"},{"line_number":5397,"context_line":"            return 0"},{"line_number":5398,"context_line":"        vgpus \u003d 0"},{"line_number":5399,"context_line":"        # TODO(sbauza): Move that check up to compute_manager.init_host"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_f4498fb6","line":5396,"updated":"2017-10-26 08:44:10.000000000","message":"This option does not look right, it implies that all vGPUs are using mdev/vfio infrastructure which is not the case, we could have for example vGPUs based on product id (SRIOV case)","commit_id":"332fb844407e6b94dc0142ebbe9dca01753dc398"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":5572,"context_line":"            return jsonutils.dumps([])"},{"line_number":5573,"context_line":""},{"line_number":5574,"context_line":"        try:"},{"line_number":5575,"context_line":"            # TODO(sbauza): Replace that call by a generic list_devices(\"pci\")"},{"line_number":5576,"context_line":"            dev_names \u003d self._host.list_pci_devices() or []"},{"line_number":5577,"context_line":"        except libvirt.libvirtError as ex:"},{"line_number":5578,"context_line":"            error_code \u003d ex.get_error_code()"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_67ce13b5","line":5575,"updated":"2017-10-26 08:44:10.000000000","message":"I\u0027d rather have list_pci_devices(), list_mdev_devices()","commit_id":"332fb844407e6b94dc0142ebbe9dca01753dc398"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":5605,"context_line":"        }"},{"line_number":5606,"context_line":"        for mdev_cap in cfgdev.pci_capability.mdev_capability:"},{"line_number":5607,"context_line":"            types \u003d mdev_cap.mdev_types"},{"line_number":5608,"context_line":"            # TODO(sbauza): We could somehow add a mapping dictionary for"},{"line_number":5609,"context_line":"            # persisting in between the type (eg. \u0027nvidia-35\u0027) and the optional"},{"line_number":5610,"context_line":"            # name (eg. \u0027GRID M10-0Q\u0027)"},{"line_number":5611,"context_line":"            device.update("}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_474c3741","line":5608,"updated":"2017-10-26 08:44:10.000000000","message":"Certainly is not something we want. The only safe way to identify a mdev device it\u0027s by its  mdev_type. The name is an optional attribute which can be provided or not by vendors.","commit_id":"332fb844407e6b94dc0142ebbe9dca01753dc398"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":5609,"context_line":"            # persisting in between the type (eg. \u0027nvidia-35\u0027) and the optional"},{"line_number":5610,"context_line":"            # name (eg. \u0027GRID M10-0Q\u0027)"},{"line_number":5611,"context_line":"            device.update("},{"line_number":5612,"context_line":"                {cap[\u0027type\u0027]: cap[\u0027availableInstances\u0027] for cap in types}"},{"line_number":5613,"context_line":"            )"},{"line_number":5614,"context_line":""},{"line_number":5615,"context_line":"        return device"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_47143744","line":5612,"updated":"2017-10-26 08:44:10.000000000","message":"This is wrong, \u0027availableInstances\u0027 indicates the number of devices of that specific type can be allocated, not how many are allocated. Basically \u0027availableInstances\u0027 is decreasing following the allocation of devices on a certain type.\n\nThis implementation is not intended to allocate the the mdev devices. The operators will beforehand locate them.\n\nWhat you want to do here is to get the parent physical PCI device, then count the number of devices are allocated, see: capability type\u003dmdev of the PCI device.","commit_id":"332fb844407e6b94dc0142ebbe9dca01753dc398"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":5572,"context_line":"            return jsonutils.dumps([])"},{"line_number":5573,"context_line":""},{"line_number":5574,"context_line":"        try:"},{"line_number":5575,"context_line":"            # TODO(sbauza): Replace that call by a generic list_devices(\"pci\")"},{"line_number":5576,"context_line":"            dev_names \u003d self._host.list_pci_devices() or []"},{"line_number":5577,"context_line":"        except libvirt.libvirtError as ex:"},{"line_number":5578,"context_line":"            error_code \u003d ex.get_error_code()"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_68c3698a","line":5575,"updated":"2017-10-26 08:44:10.000000000","message":"I\u0027d rather have list_pci_devices(), list_mdev_devices()","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4127b693af041fdbf7698a4b8bfadd7333b66a4c","unresolved":false,"context_lines":[{"line_number":5572,"context_line":"            return jsonutils.dumps([])"},{"line_number":5573,"context_line":""},{"line_number":5574,"context_line":"        try:"},{"line_number":5575,"context_line":"            # TODO(sbauza): Replace that call by a generic list_devices(\"pci\")"},{"line_number":5576,"context_line":"            dev_names \u003d self._host.list_pci_devices() or []"},{"line_number":5577,"context_line":"        except libvirt.libvirtError as ex:"},{"line_number":5578,"context_line":"            error_code \u003d ex.get_error_code()"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_c3811ec5","line":5575,"in_reply_to":"3f4b6375_68c3698a","updated":"2017-10-26 09:35:56.000000000","message":"That\u0027s understandable.","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":5606,"context_line":"        }"},{"line_number":5607,"context_line":"        for mdev_cap in cfgdev.pci_capability.mdev_capability:"},{"line_number":5608,"context_line":"            types \u003d mdev_cap.mdev_types"},{"line_number":5609,"context_line":"            # TODO(sbauza): We could somehow add a mapping dictionary for"},{"line_number":5610,"context_line":"            # persisting in between the type (eg. \u0027nvidia-35\u0027) and the optional"},{"line_number":5611,"context_line":"            # name (eg. \u0027GRID M10-0Q\u0027)"},{"line_number":5612,"context_line":"            device.update("}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_28b9f113","line":5609,"updated":"2017-10-26 08:44:10.000000000","message":"Certainly is not something we want. The only safe way to identify a mdev device it\u0027s by its  mdev_type. The name is an optional attribute which can be provided or not by vendors.","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4127b693af041fdbf7698a4b8bfadd7333b66a4c","unresolved":false,"context_lines":[{"line_number":5606,"context_line":"        }"},{"line_number":5607,"context_line":"        for mdev_cap in cfgdev.pci_capability.mdev_capability:"},{"line_number":5608,"context_line":"            types \u003d mdev_cap.mdev_types"},{"line_number":5609,"context_line":"            # TODO(sbauza): We could somehow add a mapping dictionary for"},{"line_number":5610,"context_line":"            # persisting in between the type (eg. \u0027nvidia-35\u0027) and the optional"},{"line_number":5611,"context_line":"            # name (eg. \u0027GRID M10-0Q\u0027)"},{"line_number":5612,"context_line":"            device.update("}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_a35d027a","line":5609,"in_reply_to":"3f4b6375_28b9f113","updated":"2017-10-26 09:35:56.000000000","message":"Sure, I just thought about operators wanting to just use names in the conf option rather than trying to find the exact type for libvirt. We could imagine regexes and all other crazypants but I agree with you, it\u0027s not something *for now*.\nWill remove that comment for the sake of clarity of what\u0027s targeted by this blueprint","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":5610,"context_line":"            # persisting in between the type (eg. \u0027nvidia-35\u0027) and the optional"},{"line_number":5611,"context_line":"            # name (eg. \u0027GRID M10-0Q\u0027)"},{"line_number":5612,"context_line":"            device.update("},{"line_number":5613,"context_line":"                {cap[\u0027type\u0027]: cap[\u0027availableInstances\u0027] for cap in types}"},{"line_number":5614,"context_line":"            )"},{"line_number":5615,"context_line":""},{"line_number":5616,"context_line":"        return device"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_a842810d","line":5613,"updated":"2017-10-26 08:44:10.000000000","message":"This is wrong, \u0027availableInstances\u0027 indicates the number of devices of that specific type can be allocated, not how many are allocated. Basically \u0027availableInstances\u0027 is decreasing following the allocation of devices on a certain type.\n\nThis implementation is not intended to allocate the the mdev devices. The operators will beforehand locate them.\n\nWhat you want to do here is to get the parent physical PCI device, then count the number of devices are allocated, see: capability type\u003dmdev of the PCI device.","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"a88a82daa2e7d41af3f850eeab541acacbb49fc8","unresolved":false,"context_lines":[{"line_number":5610,"context_line":"            # persisting in between the type (eg. \u0027nvidia-35\u0027) and the optional"},{"line_number":5611,"context_line":"            # name (eg. \u0027GRID M10-0Q\u0027)"},{"line_number":5612,"context_line":"            device.update("},{"line_number":5613,"context_line":"                {cap[\u0027type\u0027]: cap[\u0027availableInstances\u0027] for cap in types}"},{"line_number":5614,"context_line":"            )"},{"line_number":5615,"context_line":""},{"line_number":5616,"context_line":"        return device"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_c358fefa","line":5613,"in_reply_to":"3f4b6375_a842810d","updated":"2017-10-26 09:14:25.000000000","message":"\u003e What you want to do here is to get the parent physical PCI device, then count the number of devices are allocated, see: capability type\u003dmdev of the PCI device.\n\nOh no... i\u0027m saying a mistake I got confused because your are listing \u0027mdev_types\u0027 as devices which is normally a *capability* of \u0027pci\u0027. If you want to list mdevs you have to call list_devices with \u0027mdev\u0027. for the config please see:\n\n https://review.openstack.org/#/c/508183/4/nova/virt/libvirt/config.py line 2393","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4127b693af041fdbf7698a4b8bfadd7333b66a4c","unresolved":false,"context_lines":[{"line_number":5610,"context_line":"            # persisting in between the type (eg. \u0027nvidia-35\u0027) and the optional"},{"line_number":5611,"context_line":"            # name (eg. \u0027GRID M10-0Q\u0027)"},{"line_number":5612,"context_line":"            device.update("},{"line_number":5613,"context_line":"                {cap[\u0027type\u0027]: cap[\u0027availableInstances\u0027] for cap in types}"},{"line_number":5614,"context_line":"            )"},{"line_number":5615,"context_line":""},{"line_number":5616,"context_line":"        return device"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_c3e8fe7c","line":5613,"in_reply_to":"3f4b6375_c358fefa","updated":"2017-10-26 09:35:56.000000000","message":"Yup, here I don\u0027t want to report existing allocations, I want to provide the number of instances the device can create for a specific mediated device type.\n\nFor the moment, that change is only focusing on reporting the total inventory of resources, not how we consume those.","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"3d4d9320c2612a41a548d4f64bbe4af0356ca718","unresolved":false,"context_lines":[{"line_number":5833,"context_line":"                    fields.ResourceClass.VGPU: {"},{"line_number":5834,"context_line":"                        \u0027total\u0027: vgpus,"},{"line_number":5835,"context_line":"                        \u0027min_unit\u0027: 1,"},{"line_number":5836,"context_line":"                        \u0027max_unit\u0027: vgpus,"},{"line_number":5837,"context_line":"                        \u0027step_size\u0027: 1,"},{"line_number":5838,"context_line":"                    }"},{"line_number":5839,"context_line":"                }"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_ae0a911c","line":5836,"range":{"start_line":5836,"start_character":24,"end_line":5836,"end_character":41},"updated":"2017-10-26 04:01:33.000000000","message":"Does KVM support attaching \u003e1 vgpu into instance at the moment?","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4127b693af041fdbf7698a4b8bfadd7333b66a4c","unresolved":false,"context_lines":[{"line_number":5833,"context_line":"                    fields.ResourceClass.VGPU: {"},{"line_number":5834,"context_line":"                        \u0027total\u0027: vgpus,"},{"line_number":5835,"context_line":"                        \u0027min_unit\u0027: 1,"},{"line_number":5836,"context_line":"                        \u0027max_unit\u0027: vgpus,"},{"line_number":5837,"context_line":"                        \u0027step_size\u0027: 1,"},{"line_number":5838,"context_line":"                    }"},{"line_number":5839,"context_line":"                }"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_23a59247","line":5836,"range":{"start_line":5836,"start_character":24,"end_line":5836,"end_character":41},"in_reply_to":"3f4b6375_ae0a911c","updated":"2017-10-26 09:35:56.000000000","message":"You could create two mediated devices and add them to the guest configuration. I haven\u0027t tested that but I don\u0027t really see a problem with that.\n\nhttps://libvirt.org/formatdomain.html#elementsHostDevSubsys","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c4c0f1555db33ae3cff1a5c2d5e50a573121125c","unresolved":false,"context_lines":[{"line_number":5408,"context_line":"        if not CONF.devices.enabled_vgpu_types:"},{"line_number":5409,"context_line":"            return 0"},{"line_number":5410,"context_line":"        vgpus \u003d 0"},{"line_number":5411,"context_line":"        # TODO(sbauza): Move that check up to compute_manager.init_host"},{"line_number":5412,"context_line":"        if len(CONF.devices.enabled_vgpu_types) \u003e 1:"},{"line_number":5413,"context_line":"            LOG.warning(\u0027libvirt only supports one GPU type per compute node,\u0027"},{"line_number":5414,"context_line":"                        \u0027 only first type will be used.\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ff82abbf_3330fe56","line":5411,"updated":"2017-11-21 15:56:47.000000000","message":"Sylvain, I\u0027d suggest we keep this in driver instead of compute_manager so that we allow it more flexible to specify different number of vgpu types in drivers.","commit_id":"ecf7fc6e0deac83fbeccc0c024e8d88ef661373d"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"ae2e48a5438360ea52b7208beba0345cb47dea90","unresolved":false,"context_lines":[{"line_number":5623,"context_line":"            \"types\": {},"},{"line_number":5624,"context_line":"        }"},{"line_number":5625,"context_line":"        for mdev_cap in cfgdev.pci_capability.mdev_capability:"},{"line_number":5626,"context_line":"            types \u003d mdev_cap.mdev_types"},{"line_number":5627,"context_line":"            for cap in mdev_cap.mdev_types:"},{"line_number":5628,"context_line":"                device[\"types\"].update({cap[\u0027type\u0027]: {"},{"line_number":5629,"context_line":"                    \u0027availableInstances\u0027: cap[\u0027availableInstances\u0027],"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff82abbf_b0a82bdb","line":5626,"range":{"start_line":5626,"start_character":12,"end_line":5626,"end_character":17},"updated":"2017-11-24 03:17:16.000000000","message":"it\u0027s not used at all?","commit_id":"3fcc9eeb7102ddccf7bfd911d5b344a9d2a420ca"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"19b312337785f9ace1235fb74559f897c5c5ec14","unresolved":false,"context_lines":[{"line_number":5401,"context_line":"        return total"},{"line_number":5402,"context_line":""},{"line_number":5403,"context_line":"    def _get_vgpu_total(self):"},{"line_number":5404,"context_line":"        \"\"\"Returns the number of total available vGPUs for a specific GPU type"},{"line_number":5405,"context_line":"        where one or more pGPUs supports that type."},{"line_number":5406,"context_line":"        \"\"\""},{"line_number":5407,"context_line":"        # Bail out early if operator doesn\u0027t care about providing vGPUs"},{"line_number":5408,"context_line":"        if not CONF.devices.enabled_vgpu_types:"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_21a9ae8f","line":5405,"range":{"start_line":5404,"start_character":55,"end_line":5405,"end_character":51},"updated":"2017-12-12 21:37:30.000000000","message":"This is misleading... I think you meant to say \"for any GPU type that is enabled with the enabled_vgpu_types CONF option\"?","commit_id":"83e8f520856c8123e308feef7137d5c56fadb862"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"20589be1b51722592d21e9f8496e306d63aaacca","unresolved":false,"context_lines":[{"line_number":5408,"context_line":"        if not CONF.devices.enabled_vgpu_types:"},{"line_number":5409,"context_line":"            return 0"},{"line_number":5410,"context_line":"        vgpus \u003d 0"},{"line_number":5411,"context_line":"        # TODO(sbauza): Move that check up to compute_manager.init_host"},{"line_number":5412,"context_line":"        if len(CONF.devices.enabled_vgpu_types) \u003e 1:"},{"line_number":5413,"context_line":"            LOG.warning(\u0027libvirt only supports one GPU type per compute node,\u0027"},{"line_number":5414,"context_line":"                        \u0027 only first type will be used.\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_e85b6c84","line":5411,"range":{"start_line":5411,"start_character":29,"end_line":5411,"end_character":33},"updated":"2017-12-04 22:56:47.000000000","message":"this","commit_id":"83e8f520856c8123e308feef7137d5c56fadb862"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3e161272cadafb0f530dcb69ab72512bba665e94","unresolved":false,"context_lines":[{"line_number":5409,"context_line":"            return 0"},{"line_number":5410,"context_line":"        vgpus \u003d 0"},{"line_number":5411,"context_line":"        # TODO(sbauza): Move that check up to compute_manager.init_host"},{"line_number":5412,"context_line":"        if len(CONF.devices.enabled_vgpu_types) \u003e 1:"},{"line_number":5413,"context_line":"            LOG.warning(\u0027libvirt only supports one GPU type per compute node,\u0027"},{"line_number":5414,"context_line":"                        \u0027 only first type will be used.\u0027)"},{"line_number":5415,"context_line":"        requested_type \u003d CONF.devices.enabled_vgpu_types[0]"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_d240dba7","line":5412,"updated":"2017-12-12 15:35:44.000000000","message":"Good call making this a list from the beginning even if we only support the first item.","commit_id":"83e8f520856c8123e308feef7137d5c56fadb862"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"19b312337785f9ace1235fb74559f897c5c5ec14","unresolved":false,"context_lines":[{"line_number":5409,"context_line":"            return 0"},{"line_number":5410,"context_line":"        vgpus \u003d 0"},{"line_number":5411,"context_line":"        # TODO(sbauza): Move that check up to compute_manager.init_host"},{"line_number":5412,"context_line":"        if len(CONF.devices.enabled_vgpu_types) \u003e 1:"},{"line_number":5413,"context_line":"            LOG.warning(\u0027libvirt only supports one GPU type per compute node,\u0027"},{"line_number":5414,"context_line":"                        \u0027 only first type will be used.\u0027)"},{"line_number":5415,"context_line":"        requested_type \u003d CONF.devices.enabled_vgpu_types[0]"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_61881622","line":5412,"in_reply_to":"df87a7cf_d240dba7","updated":"2017-12-12 21:37:30.000000000","message":"Well, technically the XenAPI folks added the enabled_vgpu_types option first :)","commit_id":"83e8f520856c8123e308feef7137d5c56fadb862"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"20589be1b51722592d21e9f8496e306d63aaacca","unresolved":false,"context_lines":[{"line_number":5413,"context_line":"            LOG.warning(\u0027libvirt only supports one GPU type per compute node,\u0027"},{"line_number":5414,"context_line":"                        \u0027 only first type will be used.\u0027)"},{"line_number":5415,"context_line":"        requested_type \u003d CONF.devices.enabled_vgpu_types[0]"},{"line_number":5416,"context_line":"        # Count the left allocable resources"},{"line_number":5417,"context_line":"        mdev_capable_devices \u003d self._get_mdev_capable_devices()"},{"line_number":5418,"context_line":"        for dev in mdev_capable_devices:"},{"line_number":5419,"context_line":"            if requested_type in dev[\u0027types\u0027]:"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_c8522868","line":5416,"range":{"start_line":5416,"start_character":20,"end_line":5416,"end_character":34},"updated":"2017-12-04 22:56:47.000000000","message":"available (maybe?)","commit_id":"83e8f520856c8123e308feef7137d5c56fadb862"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"20589be1b51722592d21e9f8496e306d63aaacca","unresolved":false,"context_lines":[{"line_number":5870,"context_line":""},{"line_number":5871,"context_line":"        if vgpus \u003e 0:"},{"line_number":5872,"context_line":"            # Only provide VGPU resource classes if the driver supports it."},{"line_number":5873,"context_line":"            result.update("},{"line_number":5874,"context_line":"                {"},{"line_number":5875,"context_line":"                    fields.ResourceClass.VGPU: {"},{"line_number":5876,"context_line":"                        \u0027total\u0027: vgpus,"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_c8d788bf","line":5873,"updated":"2017-12-04 22:56:47.000000000","message":"just curious? Why did you choose update here instead of assignment:\n\n    result[fields.ResourceClass.VGPU] \u003d {\u0027total\u0027 [...]\n\n?","commit_id":"83e8f520856c8123e308feef7137d5c56fadb862"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"23a1d51959f10e26994537fa3ec070ba0fff8ce7","unresolved":false,"context_lines":[{"line_number":5618,"context_line":""},{"line_number":5619,"context_line":"        return jsonutils.dumps(pci_info)"},{"line_number":5620,"context_line":""},{"line_number":5621,"context_line":"    def _get_mdev_capabilities_for_dev(self, devname, types\u003dNone):"},{"line_number":5622,"context_line":"        \"\"\"Returns a dict of MDEV capable device with the ID as first key"},{"line_number":5623,"context_line":"        and then a list of supported types, each of them being a dict."},{"line_number":5624,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"bf8cb3f7_3f3527db","line":5621,"range":{"start_line":5621,"start_character":45,"end_line":5621,"end_character":52},"updated":"2017-12-21 15:48:42.000000000","message":"missing docstring","commit_id":"090d6208d425f118eff7b1db59878a483290e11c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"c65313c2219e220d58cd7b2c94c2b3cc7073efd9","unresolved":false,"context_lines":[{"line_number":5651,"context_line":"        :param types: Filter only devices supporting those types."},{"line_number":5652,"context_line":"        \"\"\""},{"line_number":5653,"context_line":"        if not self._host.has_min_version(MIN_LIBVIRT_MDEV_SUPPORT):"},{"line_number":5654,"context_line":"            return [1]"},{"line_number":5655,"context_line":"        dev_names \u003d self._host.list_mdev_capable_devices() or []"},{"line_number":5656,"context_line":"        mdev_capable_devices \u003d []"},{"line_number":5657,"context_line":"        for name in dev_names:"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf8cb3f7_c34b0b85","line":5654,"range":{"start_line":5654,"start_character":19,"end_line":5654,"end_character":22},"updated":"2017-12-21 14:27:16.000000000","message":"shit, it was just for testing purpose, need to modify it.","commit_id":"090d6208d425f118eff7b1db59878a483290e11c"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"23a1d51959f10e26994537fa3ec070ba0fff8ce7","unresolved":false,"context_lines":[{"line_number":5893,"context_line":""},{"line_number":5894,"context_line":"        if vgpus \u003e 0:"},{"line_number":5895,"context_line":"            # Only provide VGPU resource classes if the driver supports it."},{"line_number":5896,"context_line":"            result[fields.ResourceClass.VGPU] \u003d {"},{"line_number":5897,"context_line":"                \u0027total\u0027: vgpus,"},{"line_number":5898,"context_line":"                \u0027min_unit\u0027: 1,"},{"line_number":5899,"context_line":"                \u0027max_unit\u0027: vgpus,"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf8cb3f7_bfa4d709","line":5896,"range":{"start_line":5896,"start_character":12,"end_line":5896,"end_character":49},"updated":"2017-12-21 15:48:42.000000000","message":"Do we not want to consistently return this anyway but leave it empty if there are no vGPUs?","commit_id":"090d6208d425f118eff7b1db59878a483290e11c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"c685556038366b556090b57d248c8cc276383081","unresolved":false,"context_lines":[{"line_number":5893,"context_line":""},{"line_number":5894,"context_line":"        if vgpus \u003e 0:"},{"line_number":5895,"context_line":"            # Only provide VGPU resource classes if the driver supports it."},{"line_number":5896,"context_line":"            result[fields.ResourceClass.VGPU] \u003d {"},{"line_number":5897,"context_line":"                \u0027total\u0027: vgpus,"},{"line_number":5898,"context_line":"                \u0027min_unit\u0027: 1,"},{"line_number":5899,"context_line":"                \u0027max_unit\u0027: vgpus,"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf8cb3f7_7f888fc5","line":5896,"range":{"start_line":5896,"start_character":12,"end_line":5896,"end_character":49},"in_reply_to":"bf8cb3f7_bfa4d709","updated":"2017-12-21 16:21:57.000000000","message":"No it\u0027s optional as we agreed in the spec","commit_id":"090d6208d425f118eff7b1db59878a483290e11c"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7a439e46a4ddbbf22b30a1cc2991ff613c175184","unresolved":false,"context_lines":[{"line_number":297,"context_line":"                               }"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"# Mediated devices support"},{"line_number":300,"context_line":"MIN_LIBVIRT_MDEV_SUPPORT \u003d (3, 2, 0)"},{"line_number":301,"context_line":""},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"class LibvirtDriver(driver.ComputeDriver):"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_a78a20bc","line":300,"updated":"2018-01-08 12:08:53.000000000","message":"Most of the xml tags related to the feature exists since 3.4.0 [1] but the header really states 3.2.0 for the Mediated Devices support so I\u0027m a bit confused from which version this will really work.\n\n[1] https://libvirt.org/drvnodedev.html#MDEVCap","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7aeb156d088861a71b5bf1ff3bad99ac05c0bb88","unresolved":false,"context_lines":[{"line_number":297,"context_line":"                               }"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"# Mediated devices support"},{"line_number":300,"context_line":"MIN_LIBVIRT_MDEV_SUPPORT \u003d (3, 2, 0)"},{"line_number":301,"context_line":""},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"class LibvirtDriver(driver.ComputeDriver):"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_3bc3855f","line":300,"in_reply_to":"9f91af0f_a78a20bc","updated":"2018-01-08 13:53:47.000000000","message":"You\u0027re right, my bad.","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7a439e46a4ddbbf22b30a1cc2991ff613c175184","unresolved":false,"context_lines":[{"line_number":5423,"context_line":"            return 0"},{"line_number":5424,"context_line":"        # Filter how many available mdevs we can create for all the supported"},{"line_number":5425,"context_line":"        # types."},{"line_number":5426,"context_line":"        mdev_capable_devices \u003d self._get_mdev_capable_devices(requested_types)"},{"line_number":5427,"context_line":"        vgpus \u003d 0"},{"line_number":5428,"context_line":"        for dev in mdev_capable_devices:"},{"line_number":5429,"context_line":"            for _type in dev[\u0027types\u0027]:"},{"line_number":5430,"context_line":"                vgpus +\u003d dev[\u0027types\u0027][_type][\u0027availableInstances\u0027]"},{"line_number":5431,"context_line":"        # Count the already created (but possibly not assigned to a guest)"},{"line_number":5432,"context_line":"        # mdevs for all the supported types"},{"line_number":5433,"context_line":"        mediated_devices \u003d self._get_mediated_devices(requested_types)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_caa16996","line":5430,"range":{"start_line":5426,"start_character":1,"end_line":5430,"end_character":66},"updated":"2018-01-08 12:08:53.000000000","message":"Do I understand correctly that now we only requests a single type, so nested for loop (L5429) only iterates once per device? Later when we allow requesting multiple types I think we should not summarize availabileInstances from different types on the same device.","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1e4008cb0788d5301e81bd93ef3e7b8cf293c9f5","unresolved":false,"context_lines":[{"line_number":5423,"context_line":"            return 0"},{"line_number":5424,"context_line":"        # Filter how many available mdevs we can create for all the supported"},{"line_number":5425,"context_line":"        # types."},{"line_number":5426,"context_line":"        mdev_capable_devices \u003d self._get_mdev_capable_devices(requested_types)"},{"line_number":5427,"context_line":"        vgpus \u003d 0"},{"line_number":5428,"context_line":"        for dev in mdev_capable_devices:"},{"line_number":5429,"context_line":"            for _type in dev[\u0027types\u0027]:"},{"line_number":5430,"context_line":"                vgpus +\u003d dev[\u0027types\u0027][_type][\u0027availableInstances\u0027]"},{"line_number":5431,"context_line":"        # Count the already created (but possibly not assigned to a guest)"},{"line_number":5432,"context_line":"        # mdevs for all the supported types"},{"line_number":5433,"context_line":"        mediated_devices \u003d self._get_mediated_devices(requested_types)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_e37573cc","line":5430,"range":{"start_line":5426,"start_character":1,"end_line":5430,"end_character":66},"in_reply_to":"9f91af0f_bbca354b","updated":"2018-01-08 16:16:58.000000000","message":"Thanks. So in the current case when we support a single type the core of the innermost for loop only executed once. Then later on when we will support multiple types the core of the innermost for loop will be executed more than once for a single PCI dev that supports different types. And at this point in the future we will modify the core not to blindly summarize available vgpus from different types.","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7aeb156d088861a71b5bf1ff3bad99ac05c0bb88","unresolved":false,"context_lines":[{"line_number":5423,"context_line":"            return 0"},{"line_number":5424,"context_line":"        # Filter how many available mdevs we can create for all the supported"},{"line_number":5425,"context_line":"        # types."},{"line_number":5426,"context_line":"        mdev_capable_devices \u003d self._get_mdev_capable_devices(requested_types)"},{"line_number":5427,"context_line":"        vgpus \u003d 0"},{"line_number":5428,"context_line":"        for dev in mdev_capable_devices:"},{"line_number":5429,"context_line":"            for _type in dev[\u0027types\u0027]:"},{"line_number":5430,"context_line":"                vgpus +\u003d dev[\u0027types\u0027][_type][\u0027availableInstances\u0027]"},{"line_number":5431,"context_line":"        # Count the already created (but possibly not assigned to a guest)"},{"line_number":5432,"context_line":"        # mdevs for all the supported types"},{"line_number":5433,"context_line":"        mediated_devices \u003d self._get_mediated_devices(requested_types)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_bbca354b","line":5430,"range":{"start_line":5426,"start_character":1,"end_line":5430,"end_character":66},"in_reply_to":"9f91af0f_caa16996","updated":"2018-01-08 13:53:47.000000000","message":"We only accept one single type per compute, but we can have multiple PCI cards that support the same type, so we need to aggregate all the metrics.\nSay I have 4 physical cards that can expose nvidia-11 with 16 available mdevs, my total available vgpus would be 4*16, ie. 64.","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7a439e46a4ddbbf22b30a1cc2991ff613c175184","unresolved":false,"context_lines":[{"line_number":5431,"context_line":"        # Count the already created (but possibly not assigned to a guest)"},{"line_number":5432,"context_line":"        # mdevs for all the supported types"},{"line_number":5433,"context_line":"        mediated_devices \u003d self._get_mediated_devices(requested_types)"},{"line_number":5434,"context_line":"        vgpus +\u003d len(mediated_devices)"},{"line_number":5435,"context_line":"        return vgpus"},{"line_number":5436,"context_line":""},{"line_number":5437,"context_line":"    def _get_instance_capabilities(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_ca3de92b","line":5434,"updated":"2018-01-08 12:08:53.000000000","message":"If there is already created mdevs from a device and type then the related availableInstances value is decreased? So we will not count vgpus twice.","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7aeb156d088861a71b5bf1ff3bad99ac05c0bb88","unresolved":false,"context_lines":[{"line_number":5431,"context_line":"        # Count the already created (but possibly not assigned to a guest)"},{"line_number":5432,"context_line":"        # mdevs for all the supported types"},{"line_number":5433,"context_line":"        mediated_devices \u003d self._get_mediated_devices(requested_types)"},{"line_number":5434,"context_line":"        vgpus +\u003d len(mediated_devices)"},{"line_number":5435,"context_line":"        return vgpus"},{"line_number":5436,"context_line":""},{"line_number":5437,"context_line":"    def _get_instance_capabilities(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_dbe4d9e2","line":5434,"in_reply_to":"9f91af0f_ca3de92b","updated":"2018-01-08 13:53:47.000000000","message":"Yes, this is correct. Say I have 16 available instances for nvidia-11 and I create a new mediated devices for that type, it will show me 15 available instances in the next iteration (yeah, I know, the naming sucks)","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9e352f8390691c734f148a3cf5a403faf24a1290","unresolved":false,"context_lines":[{"line_number":5635,"context_line":"        }"},{"line_number":5636,"context_line":"        for mdev_cap in cfgdev.pci_capability.mdev_capability:"},{"line_number":5637,"context_line":"            for cap in mdev_cap.mdev_types:"},{"line_number":5638,"context_line":"                if not types or cap[\u0027type\u0027] in types:"},{"line_number":5639,"context_line":"                    device[\"types\"].update({cap[\u0027type\u0027]: {"},{"line_number":5640,"context_line":"                        \u0027availableInstances\u0027: cap[\u0027availableInstances\u0027],"},{"line_number":5641,"context_line":"                        \u0027name\u0027: cap[\u0027name\u0027],"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_bb3a35c9","line":5638,"range":{"start_line":5638,"start_character":19,"end_line":5638,"end_character":28},"updated":"2018-01-08 13:37:01.000000000","message":"Prefer\n\n types is None\n\nOtherwise you\u0027re relying on the caller having logic to short out when types \u003d\u003d [] (which happens to be true... at the moment).","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"957d68228c7081467138f2dfbd19585c54018d70","unresolved":false,"context_lines":[{"line_number":5635,"context_line":"        }"},{"line_number":5636,"context_line":"        for mdev_cap in cfgdev.pci_capability.mdev_capability:"},{"line_number":5637,"context_line":"            for cap in mdev_cap.mdev_types:"},{"line_number":5638,"context_line":"                if not types or cap[\u0027type\u0027] in types:"},{"line_number":5639,"context_line":"                    device[\"types\"].update({cap[\u0027type\u0027]: {"},{"line_number":5640,"context_line":"                        \u0027availableInstances\u0027: cap[\u0027availableInstances\u0027],"},{"line_number":5641,"context_line":"                        \u0027name\u0027: cap[\u0027name\u0027],"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_20ea71ab","line":5638,"range":{"start_line":5638,"start_character":19,"end_line":5638,"end_character":28},"in_reply_to":"9f91af0f_1b7b21f5","updated":"2018-01-08 15:41:01.000000000","message":"For the record, I don\u0027t agree with this, but it\u0027s not worth making a thang about.","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7aeb156d088861a71b5bf1ff3bad99ac05c0bb88","unresolved":false,"context_lines":[{"line_number":5635,"context_line":"        }"},{"line_number":5636,"context_line":"        for mdev_cap in cfgdev.pci_capability.mdev_capability:"},{"line_number":5637,"context_line":"            for cap in mdev_cap.mdev_types:"},{"line_number":5638,"context_line":"                if not types or cap[\u0027type\u0027] in types:"},{"line_number":5639,"context_line":"                    device[\"types\"].update({cap[\u0027type\u0027]: {"},{"line_number":5640,"context_line":"                        \u0027availableInstances\u0027: cap[\u0027availableInstances\u0027],"},{"line_number":5641,"context_line":"                        \u0027name\u0027: cap[\u0027name\u0027],"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_1b7b21f5","line":5638,"range":{"start_line":5638,"start_character":19,"end_line":5638,"end_character":28},"in_reply_to":"9f91af0f_bb3a35c9","updated":"2018-01-08 13:53:47.000000000","message":"No, I want to also accept to pass types\u003d[] as an argument, and just say \"meh, we don\u0027t care then\"","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9e352f8390691c734f148a3cf5a403faf24a1290","unresolved":false,"context_lines":[{"line_number":5683,"context_line":""},{"line_number":5684,"context_line":"        :param types: Filter only devices supporting those types."},{"line_number":5685,"context_line":"        \"\"\""},{"line_number":5686,"context_line":"        if not self._host.has_min_version(MIN_LIBVIRT_MDEV_SUPPORT):"},{"line_number":5687,"context_line":"            return []"},{"line_number":5688,"context_line":"        dev_names \u003d self._host.list_mediated_devices() or []"},{"line_number":5689,"context_line":"        mediated_devices \u003d []"},{"line_number":5690,"context_line":"        for name in dev_names:"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_3b7dc57e","line":5687,"range":{"start_line":5686,"start_character":0,"end_line":5687,"end_character":21},"updated":"2018-01-08 13:37:01.000000000","message":"Wondering whether this would be better done with a decorator.","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7aeb156d088861a71b5bf1ff3bad99ac05c0bb88","unresolved":false,"context_lines":[{"line_number":5683,"context_line":""},{"line_number":5684,"context_line":"        :param types: Filter only devices supporting those types."},{"line_number":5685,"context_line":"        \"\"\""},{"line_number":5686,"context_line":"        if not self._host.has_min_version(MIN_LIBVIRT_MDEV_SUPPORT):"},{"line_number":5687,"context_line":"            return []"},{"line_number":5688,"context_line":"        dev_names \u003d self._host.list_mediated_devices() or []"},{"line_number":5689,"context_line":"        mediated_devices \u003d []"},{"line_number":5690,"context_line":"        for name in dev_names:"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_9b6e512d","line":5687,"range":{"start_line":5686,"start_character":0,"end_line":5687,"end_character":21},"in_reply_to":"9f91af0f_3b7dc57e","updated":"2018-01-08 13:53:47.000000000","message":"Of course, we can. Later change ?","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9e352f8390691c734f148a3cf5a403faf24a1290","unresolved":false,"context_lines":[{"line_number":5689,"context_line":"        mediated_devices \u003d []"},{"line_number":5690,"context_line":"        for name in dev_names:"},{"line_number":5691,"context_line":"            device \u003d self._get_mediated_device_information(name)"},{"line_number":5692,"context_line":"            if not types or device[\"type\"] in types:"},{"line_number":5693,"context_line":"                mediated_devices.append(device)"},{"line_number":5694,"context_line":"        return mediated_devices"},{"line_number":5695,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_dba299fc","line":5692,"range":{"start_line":5692,"start_character":15,"end_line":5692,"end_character":24},"updated":"2018-01-08 13:37:01.000000000","message":"ditto above","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7a439e46a4ddbbf22b30a1cc2991ff613c175184","unresolved":false,"context_lines":[{"line_number":5855,"context_line":"        memory_mb \u003d int(self._host.get_memory_mb_total())"},{"line_number":5856,"context_line":"        vcpus \u003d self._get_vcpu_total()"},{"line_number":5857,"context_line":""},{"line_number":5858,"context_line":"        # NOTE(sbauza): For the moment, libvirt only supports providing the"},{"line_number":5859,"context_line":"        # total number of virtual GPUs for a single GPU type. If you have"},{"line_number":5860,"context_line":"        # multiple physical GPUs, each of them providing multiple GPU types,"},{"line_number":5861,"context_line":"        # libvirt will return the total sum of virtual GPUs corresponding to"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_7516fef3","line":5858,"range":{"start_line":5858,"start_character":40,"end_line":5858,"end_character":47},"updated":"2018-01-08 12:08:53.000000000","message":"Is it libvirt limitation or libvirt driver limitation?","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7aeb156d088861a71b5bf1ff3bad99ac05c0bb88","unresolved":false,"context_lines":[{"line_number":5855,"context_line":"        memory_mb \u003d int(self._host.get_memory_mb_total())"},{"line_number":5856,"context_line":"        vcpus \u003d self._get_vcpu_total()"},{"line_number":5857,"context_line":""},{"line_number":5858,"context_line":"        # NOTE(sbauza): For the moment, libvirt only supports providing the"},{"line_number":5859,"context_line":"        # total number of virtual GPUs for a single GPU type. If you have"},{"line_number":5860,"context_line":"        # multiple physical GPUs, each of them providing multiple GPU types,"},{"line_number":5861,"context_line":"        # libvirt will return the total sum of virtual GPUs corresponding to"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_7beeedb4","line":5858,"range":{"start_line":5858,"start_character":40,"end_line":5858,"end_character":47},"in_reply_to":"9f91af0f_7516fef3","updated":"2018-01-08 13:53:47.000000000","message":"the latter","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"}],"nova/virt/libvirt/host.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":841,"context_line":"        \"\"\""},{"line_number":842,"context_line":"        return self.get_connection().listDevices(\"pci\", flags)"},{"line_number":843,"context_line":""},{"line_number":844,"context_line":"    def list_devices(self, cap, flags\u003d0):"},{"line_number":845,"context_line":"        \"\"\"Lookup devices."},{"line_number":846,"context_line":""},{"line_number":847,"context_line":"        :returns: a list of virNodeDevice instance"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_a70bebd3","line":844,"updated":"2017-10-26 08:44:10.000000000","message":"This function looks safe. What you have to do is rename it like: _list_devices(...) then update list_pci_devices() to use it and add a function list_mdev_devices()","commit_id":"332fb844407e6b94dc0142ebbe9dca01753dc398"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3abfd19088445552012ced1aa36425a6678d6009","unresolved":false,"context_lines":[{"line_number":841,"context_line":"        \"\"\""},{"line_number":842,"context_line":"        return self.get_connection().listDevices(\"pci\", flags)"},{"line_number":843,"context_line":""},{"line_number":844,"context_line":"    def list_devices(self, cap, flags\u003d0):"},{"line_number":845,"context_line":"        \"\"\"Lookup devices."},{"line_number":846,"context_line":""},{"line_number":847,"context_line":"        :returns: a list of virNodeDevice instance"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_8824655f","line":844,"updated":"2017-10-26 08:44:10.000000000","message":"This function looks safe. What you have to do is rename it like: _list_devices(...) then update list_pci_devices() to use it and add a function list_mdev_devices()","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4127b693af041fdbf7698a4b8bfadd7333b66a4c","unresolved":false,"context_lines":[{"line_number":841,"context_line":"        \"\"\""},{"line_number":842,"context_line":"        return self.get_connection().listDevices(\"pci\", flags)"},{"line_number":843,"context_line":""},{"line_number":844,"context_line":"    def list_devices(self, cap, flags\u003d0):"},{"line_number":845,"context_line":"        \"\"\"Lookup devices."},{"line_number":846,"context_line":""},{"line_number":847,"context_line":"        :returns: a list of virNodeDevice instance"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_43588e54","line":844,"in_reply_to":"3f4b6375_8824655f","updated":"2017-10-26 09:35:56.000000000","message":"Ack","commit_id":"a84f511622520e406f485116e0d74edbd557de2e"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"20589be1b51722592d21e9f8496e306d63aaacca","unresolved":false,"context_lines":[{"line_number":839,"context_line":""},{"line_number":840,"context_line":"        :returns: a list of virNodeDevice instance"},{"line_number":841,"context_line":"        \"\"\""},{"line_number":842,"context_line":"        # TODO(sbauza): Replace that call by a generic _list_devices(\"pci\")"},{"line_number":843,"context_line":"        return self.get_connection().listDevices(\"pci\", flags)"},{"line_number":844,"context_line":""},{"line_number":845,"context_line":"    def list_mdev_capable_devices(self, flags\u003d0):"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_28f07467","line":842,"range":{"start_line":842,"start_character":32,"end_line":842,"end_character":36},"updated":"2017-12-04 22:56:47.000000000","message":"this","commit_id":"83e8f520856c8123e308feef7137d5c56fadb862"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"19b312337785f9ace1235fb74559f897c5c5ec14","unresolved":false,"context_lines":[{"line_number":863,"context_line":"        \"\"\""},{"line_number":864,"context_line":"        # Bail early if we know we can\u0027t support `listDevices` to avoid"},{"line_number":865,"context_line":"        # repeated warnings within a periodic task"},{"line_number":866,"context_line":"        if not getattr(self, \u0027_list_devices_supported\u0027, True):"},{"line_number":867,"context_line":"            return []"},{"line_number":868,"context_line":"        try:"},{"line_number":869,"context_line":"            return self.get_connection().listDevices(cap, flags)"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_047278e4","line":866,"range":{"start_line":866,"start_character":8,"end_line":866,"end_character":62},"updated":"2017-12-12 21:37:30.000000000","message":"this isn\u0027t really how things have been done in the past with regards to figuring out what can be requested of the libvirt connection.\n\nTypically, we\u0027ve used constants in the nova/virt/libvirt/driver.py module to indicate the minimum required libvirt or QEMU version for a particular feature.\n\nFor instance:\n\nhttps://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L219\n\nwhich is checked like so:\n\nhttps://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L5994-L5995","commit_id":"83e8f520856c8123e308feef7137d5c56fadb862"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9e352f8390691c734f148a3cf5a403faf24a1290","unresolved":false,"context_lines":[{"line_number":856,"context_line":"        \"\"\""},{"line_number":857,"context_line":"        return self._list_devices(\"mdev\", flags\u003dflags)"},{"line_number":858,"context_line":""},{"line_number":859,"context_line":"    def _list_devices(self, cap, flags\u003d0):"},{"line_number":860,"context_line":"        \"\"\"Lookup devices."},{"line_number":861,"context_line":""},{"line_number":862,"context_line":"        :returns: a list of virNodeDevice instance"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_9bc73197","line":859,"range":{"start_line":859,"start_character":33,"end_line":859,"end_character":40},"updated":"2018-01-08 13:37:01.000000000","message":"This need not be a kwarg since you\u0027re always passing it in.","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7aeb156d088861a71b5bf1ff3bad99ac05c0bb88","unresolved":false,"context_lines":[{"line_number":856,"context_line":"        \"\"\""},{"line_number":857,"context_line":"        return self._list_devices(\"mdev\", flags\u003dflags)"},{"line_number":858,"context_line":""},{"line_number":859,"context_line":"    def _list_devices(self, cap, flags\u003d0):"},{"line_number":860,"context_line":"        \"\"\"Lookup devices."},{"line_number":861,"context_line":""},{"line_number":862,"context_line":"        :returns: a list of virNodeDevice instance"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_fb5e7d74","line":859,"range":{"start_line":859,"start_character":33,"end_line":859,"end_character":40},"in_reply_to":"9f91af0f_9bc73197","updated":"2018-01-08 13:53:47.000000000","message":"I prefer to keep it explicit.","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"eda11f6c5f2dc2cc4b030b2bd603968cd040cc8c","unresolved":false,"context_lines":[{"line_number":856,"context_line":"        \"\"\""},{"line_number":857,"context_line":"        return self._list_devices(\"mdev\", flags\u003dflags)"},{"line_number":858,"context_line":""},{"line_number":859,"context_line":"    def _list_devices(self, cap, flags\u003d0):"},{"line_number":860,"context_line":"        \"\"\"Lookup devices."},{"line_number":861,"context_line":""},{"line_number":862,"context_line":"        :returns: a list of virNodeDevice instance"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f91af0f_ed3d622b","line":859,"range":{"start_line":859,"start_character":33,"end_line":859,"end_character":40},"in_reply_to":"9f91af0f_fb5e7d74","updated":"2018-01-08 15:16:27.000000000","message":"It\u0027s also consistent with the other uses in view here, like L837 and L876","commit_id":"d4086733ffa9cafec6b43c9d17407b1a4b473f97"}]}
