)]}'
{"nova/pci/manager.py":[{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"6577e3c2821cbf2b25dbd62aa45c118262766db1","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                    self.stale[new_value[\u0027address\u0027]] \u003d new_value"},{"line_number":226,"context_line":"                else:"},{"line_number":227,"context_line":"                    existed.update_device(new_value)"},{"line_number":228,"context_line":"                    self.stats.update_device(existed)"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"        # Track newly discovered devices."},{"line_number":231,"context_line":"        for dev in [dev for dev in devices if"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_6e0bc97c","line":228,"range":{"start_line":228,"start_character":20,"end_line":228,"end_character":53},"updated":"2020-09-16 12:15:34.000000000","message":"I wonder if it\u0027s possible to re-create self.stats from scratch instead of adding/removing devices. It even could be done in atomic fashion.","commit_id":"5a123375c4e4ce08132b9d4bb733d8dd965d7f2d"},{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"376e86169e6ea7e53778520ad49185c796bc0321","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                    self.stale[new_value[\u0027address\u0027]] \u003d new_value"},{"line_number":226,"context_line":"                else:"},{"line_number":227,"context_line":"                    existed.update_device(new_value)"},{"line_number":228,"context_line":"                    self.stats.update_device(existed)"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"        # Track newly discovered devices."},{"line_number":231,"context_line":"        for dev in [dev for dev in devices if"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_9c4c7c9e","line":228,"range":{"start_line":228,"start_character":20,"end_line":228,"end_character":53},"in_reply_to":"9f560f44_1cbeacff","updated":"2020-09-17 12:05:43.000000000","message":"That\u0027s true. I mean we can just \n\ndef _set_hvdevs\n   ...\n   self.stats \u003d stats.PciDeviceStats(dev_filter\u003dself.dev_filter)\n\ninstead of removing and adding devices.\nATM I don\u0027t see a big difference neither performance nor space, but this could simplify code.","commit_id":"5a123375c4e4ce08132b9d4bb733d8dd965d7f2d"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"ce26f0b0d56b07e98b1a75cc0602108c88e45b75","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                    self.stale[new_value[\u0027address\u0027]] \u003d new_value"},{"line_number":226,"context_line":"                else:"},{"line_number":227,"context_line":"                    existed.update_device(new_value)"},{"line_number":228,"context_line":"                    self.stats.update_device(existed)"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"        # Track newly discovered devices."},{"line_number":231,"context_line":"        for dev in [dev for dev in devices if"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_1cbeacff","line":228,"range":{"start_line":228,"start_character":20,"end_line":228,"end_character":53},"in_reply_to":"9f560f44_6e0bc97c","updated":"2020-09-17 11:28:23.000000000","message":"The stats are recreated from scratch on every nova-compute service restart, initially populated from existing PCI devices table and later from hypervisor updates.","commit_id":"5a123375c4e4ce08132b9d4bb733d8dd965d7f2d"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"45b4e3f83d9c6f177bbcda7a451b3760bbad5241","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                    self.stale[new_value[\u0027address\u0027]] \u003d new_value"},{"line_number":226,"context_line":"                else:"},{"line_number":227,"context_line":"                    existed.update_device(new_value)"},{"line_number":228,"context_line":"                    self.stats.update_device(existed)"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"        # Track newly discovered devices."},{"line_number":231,"context_line":"        for dev in [dev for dev in devices if"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_38dce043","line":228,"range":{"start_line":228,"start_character":20,"end_line":228,"end_character":53},"in_reply_to":"9f560f44_9c4c7c9e","updated":"2020-09-24 11:09:37.000000000","message":"we could explore that as a follow up patch that would only be merged in the master branch as a clean-up and not backported.\n\nfor this patch keeping the refactoring to a minium is better but simplfying code is always a good thing we just need to do that seperatly.","commit_id":"5a123375c4e4ce08132b9d4bb733d8dd965d7f2d"}],"nova/pci/stats.py":[{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"4ddf2e91dd7508df7f85fb89c34d6b6ae7f21141","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            for device in pool[\u0027devices\u0027]:"},{"line_number":111,"context_line":"                if device.address \u003d\u003d dev.address:"},{"line_number":112,"context_line":"                    if dev.dev_type !\u003d pool[\"dev_type\"]:"},{"line_number":113,"context_line":"                        pool[\u0027devices\u0027].remove(device)"},{"line_number":114,"context_line":"                        self._decrease_pool_count(self.pools, pool)"},{"line_number":115,"context_line":"                        self.add_device(dev)"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_d7da4a77","line":113,"range":{"start_line":113,"start_character":24,"end_line":113,"end_character":54},"updated":"2020-09-02 16:11:27.000000000","message":"it is generally not very safe to remove an item from a list while you are iterating it.\n\nSee https://stackoverflow.com/questions/6260089/strange-result-when-removing-item-from-a-list","commit_id":"4603aab407ceed9035a8621eeb1f62e05f412208"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"7f288a781469cf052fc74bdd9cfdbc10019458bb","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            for device in pool[\u0027devices\u0027]:"},{"line_number":111,"context_line":"                if device.address \u003d\u003d dev.address:"},{"line_number":112,"context_line":"                    if dev.dev_type !\u003d pool[\"dev_type\"]:"},{"line_number":113,"context_line":"                        pool[\u0027devices\u0027].remove(device)"},{"line_number":114,"context_line":"                        self._decrease_pool_count(self.pools, pool)"},{"line_number":115,"context_line":"                        self.add_device(dev)"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_64a45c09","line":113,"range":{"start_line":113,"start_character":24,"end_line":113,"end_character":54},"in_reply_to":"9f560f44_41a14a46","updated":"2020-09-03 12:24:07.000000000","message":"oh right! I didn\u0027t follow the unindentation correctly for the return, thanks for pointing that out! \u003d)","commit_id":"4603aab407ceed9035a8621eeb1f62e05f412208"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"2e17876da79b7775dff6711d686a7d9ef44cabeb","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            for device in pool[\u0027devices\u0027]:"},{"line_number":111,"context_line":"                if device.address \u003d\u003d dev.address:"},{"line_number":112,"context_line":"                    if dev.dev_type !\u003d pool[\"dev_type\"]:"},{"line_number":113,"context_line":"                        pool[\u0027devices\u0027].remove(device)"},{"line_number":114,"context_line":"                        self._decrease_pool_count(self.pools, pool)"},{"line_number":115,"context_line":"                        self.add_device(dev)"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_cc61f813","line":113,"range":{"start_line":113,"start_character":24,"end_line":113,"end_character":54},"in_reply_to":"9f560f44_64a45c09","updated":"2020-09-04 15:12:35.000000000","message":"ya in the general case you will need to make a copy iterate over the copy and update the original\nor potentially make this a list comprehension.\n\nin this case i guess it is safe if still not the best style. \n\nyou could add a break\n\nyou could do this in stead.\n        found_pool \u003d None\n        found_dev\u003d None\n        for pool in self.pools:\n            for device in pool[\u0027devices\u0027]:\n                if device.address \u003d\u003d dev.address:\n                    if dev.dev_type !\u003d pool[\"dev_type\"]:\n                        found_pool \u003d pool\n                        found_dev \u003d device\n                        break\n        else:\n            return\n        found_pool[\u0027devices\u0027].remove(found_dev)\n        self._decrease_pool_count(self.pools, found_pool)\n        self.add_device(dev)","commit_id":"4603aab407ceed9035a8621eeb1f62e05f412208"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"0f496f755d0780a14583b1b40057fd4ba11937a1","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            for device in pool[\u0027devices\u0027]:"},{"line_number":111,"context_line":"                if device.address \u003d\u003d dev.address:"},{"line_number":112,"context_line":"                    if dev.dev_type !\u003d pool[\"dev_type\"]:"},{"line_number":113,"context_line":"                        pool[\u0027devices\u0027].remove(device)"},{"line_number":114,"context_line":"                        self._decrease_pool_count(self.pools, pool)"},{"line_number":115,"context_line":"                        self.add_device(dev)"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_69934350","line":113,"range":{"start_line":113,"start_character":24,"end_line":113,"end_character":54},"in_reply_to":"9f560f44_cc61f813","updated":"2020-09-09 12:13:46.000000000","message":"The above code requires another else/break just to avoid looping at the pools level if the device is already found. To make it simpler, kept the logic in separate function.","commit_id":"4603aab407ceed9035a8621eeb1f62e05f412208"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"a03d603bb4d92784cc4cd6a5f63db276fcb06ed4","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            for device in pool[\u0027devices\u0027]:"},{"line_number":111,"context_line":"                if device.address \u003d\u003d dev.address:"},{"line_number":112,"context_line":"                    if dev.dev_type !\u003d pool[\"dev_type\"]:"},{"line_number":113,"context_line":"                        pool[\u0027devices\u0027].remove(device)"},{"line_number":114,"context_line":"                        self._decrease_pool_count(self.pools, pool)"},{"line_number":115,"context_line":"                        self.add_device(dev)"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_41a14a46","line":113,"range":{"start_line":113,"start_character":24,"end_line":113,"end_character":54},"in_reply_to":"9f560f44_d7da4a77","updated":"2020-09-03 12:16:01.000000000","message":"Thanks for the review. In this case, the function will return once it hits this piece of code and so modifying the list should not be a problem.","commit_id":"4603aab407ceed9035a8621eeb1f62e05f412208"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"18795fa40c9bff985472c00c6ae7d4908b8036a4","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            pool[\u0027parent_ifname\u0027] \u003d dev.extra_info[\u0027parent_ifname\u0027]"},{"line_number":105,"context_line":"        return pool"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def _get_pool_with_device_type_mismatch(self, dev):"},{"line_number":108,"context_line":"        \"\"\"Check for device type mismatch in the pools for a given device."},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        Return (pool, device) if device type does not match."},{"line_number":111,"context_line":"        \"\"\""},{"line_number":112,"context_line":"        for pool in self.pools:"},{"line_number":113,"context_line":"            for device in pool[\u0027devices\u0027]:"},{"line_number":114,"context_line":"                if device.address \u003d\u003d dev.address:"},{"line_number":115,"context_line":"                    if dev.dev_type !\u003d pool[\"dev_type\"]:"},{"line_number":116,"context_line":"                        return pool, device"},{"line_number":117,"context_line":"                    return None, None"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        return None, None"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def update_device(self, dev):"},{"line_number":122,"context_line":"        \"\"\"Update a device to its matching pool.\"\"\""},{"line_number":123,"context_line":"        pool, device \u003d self._get_pool_with_device_type_mismatch(dev)"},{"line_number":124,"context_line":"        if pool is None or device is None:"},{"line_number":125,"context_line":"            return"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        pool[\u0027devices\u0027].remove(device)"},{"line_number":128,"context_line":"        self._decrease_pool_count(self.pools, pool)"},{"line_number":129,"context_line":"        self.add_device(dev)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def add_device(self, dev):"},{"line_number":132,"context_line":"        \"\"\"Add a device to its matching pool.\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_faf40189","line":129,"range":{"start_line":107,"start_character":3,"end_line":129,"end_character":28},"updated":"2020-09-11 11:14:17.000000000","message":"+1\nthanks for spiting this","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"6577e3c2821cbf2b25dbd62aa45c118262766db1","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        for pool in self.pools:"},{"line_number":113,"context_line":"            for device in pool[\u0027devices\u0027]:"},{"line_number":114,"context_line":"                if device.address \u003d\u003d dev.address:"},{"line_number":115,"context_line":"                    if dev.dev_type !\u003d pool[\"dev_type\"]:"},{"line_number":116,"context_line":"                        return pool, device"},{"line_number":117,"context_line":"                    return None, None"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_8e661d55","line":115,"range":{"start_line":115,"start_character":20,"end_line":115,"end_character":56},"updated":"2020-09-16 12:15:34.000000000","message":"You\u0027re resolving that particular case, but other device properties (tags?) can be mismatched too, and not updated.","commit_id":"5a123375c4e4ce08132b9d4bb733d8dd965d7f2d"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"ce26f0b0d56b07e98b1a75cc0602108c88e45b75","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        for pool in self.pools:"},{"line_number":113,"context_line":"            for device in pool[\u0027devices\u0027]:"},{"line_number":114,"context_line":"                if device.address \u003d\u003d dev.address:"},{"line_number":115,"context_line":"                    if dev.dev_type !\u003d pool[\"dev_type\"]:"},{"line_number":116,"context_line":"                        return pool, device"},{"line_number":117,"context_line":"                    return None, None"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_bc34e0ad","line":115,"range":{"start_line":115,"start_character":20,"end_line":115,"end_character":56},"in_reply_to":"9f560f44_8e661d55","updated":"2020-09-17 11:28:23.000000000","message":"The tags are updated whenever there is change in pci passthrough whitelist, so check for tags in not required here.","commit_id":"5a123375c4e4ce08132b9d4bb733d8dd965d7f2d"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"61443b03cdc7c7aac8ea7a1c9f39ac095cc2101b","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                if device.address \u003d\u003d dev.address:"},{"line_number":115,"context_line":"                    if dev.dev_type !\u003d pool[\"dev_type\"]:"},{"line_number":116,"context_line":"                        return pool, device"},{"line_number":117,"context_line":"                    return None, None"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        return None, None"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7f6b1bfe_27047217","line":117,"range":{"start_line":117,"start_character":20,"end_line":117,"end_character":37},"updated":"2020-10-14 10:09:55.000000000","message":"nit: You could just return None and do the tuple expansion later below","commit_id":"b6fbe02585cf6cb9bf4e0d7afc1d446193a638b8"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"1746e3d4cca8c3f83dc6951ed91f2d3edff63a45","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                if device.address \u003d\u003d dev.address:"},{"line_number":115,"context_line":"                    if dev.dev_type !\u003d pool[\"dev_type\"]:"},{"line_number":116,"context_line":"                        return pool, device"},{"line_number":117,"context_line":"                    return None, None"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        return None, None"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7f6b1bfe_c0d63650","line":117,"range":{"start_line":117,"start_character":20,"end_line":117,"end_character":37},"in_reply_to":"7f6b1bfe_27047217","updated":"2020-10-15 04:15:50.000000000","message":"Done","commit_id":"b6fbe02585cf6cb9bf4e0d7afc1d446193a638b8"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d50f5c891bd650a41fb5e577e4534d55d8444cb2","unresolved":false,"context_lines":[{"line_number":107,"context_line":"    def _get_pool_with_device_type_mismatch(self, dev):"},{"line_number":108,"context_line":"        \"\"\"Check for device type mismatch in the pools for a given device."},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        Return (pool, device) if device type does not match."},{"line_number":111,"context_line":"        \"\"\""},{"line_number":112,"context_line":"        for pool in self.pools:"},{"line_number":113,"context_line":"            for device in pool[\u0027devices\u0027]:"}],"source_content_type":"text/x-python","patch_set":13,"id":"7f6b1bfe_0e0e9f33","line":110,"range":{"start_line":110,"start_character":8,"end_line":110,"end_character":60},"updated":"2020-10-15 07:26:18.000000000","message":"or a single None if the device type matches","commit_id":"23ad55b6d730d17e515f338b6325c2e277aec3f5"}],"nova/tests/functional/libvirt/test_pci_sriov_servers.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"18795fa40c9bff985472c00c6ae7d4908b8036a4","unresolved":false,"context_lines":[{"line_number":304,"context_line":"        self.assertIn(first_port_id, attached_ports)"},{"line_number":305,"context_line":"        self.assertNotIn(second_port_id, attached_ports)"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"    def _disable_sriov_in_pf(self, pci_info):"},{"line_number":308,"context_line":"        # Check for PF and change the capability from virt_functions"},{"line_number":309,"context_line":"        # Delete all the VFs"},{"line_number":310,"context_line":"        vfs_to_delete \u003d []"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_3a5b1922","line":307,"range":{"start_line":307,"start_character":8,"end_line":307,"end_character":28},"updated":"2020-09-11 11:14:17.000000000","message":"im not sure this is needed see my momment below","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"5f37f19c62d00f4576f8c6c99987d0c578026e16","unresolved":false,"context_lines":[{"line_number":304,"context_line":"        self.assertIn(first_port_id, attached_ports)"},{"line_number":305,"context_line":"        self.assertNotIn(second_port_id, attached_ports)"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"    def _disable_sriov_in_pf(self, pci_info):"},{"line_number":308,"context_line":"        # Check for PF and change the capability from virt_functions"},{"line_number":309,"context_line":"        # Delete all the VFs"},{"line_number":310,"context_line":"        vfs_to_delete \u003d []"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_b7957f34","line":307,"range":{"start_line":307,"start_character":8,"end_line":307,"end_character":28},"in_reply_to":"9f560f44_3a5b1922","updated":"2020-09-11 14:26:46.000000000","message":"+1","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"5f37f19c62d00f4576f8c6c99987d0c578026e16","unresolved":false,"context_lines":[{"line_number":333,"context_line":"            self.neutron.sriov_pf_port[\u0027id\u0027],"},{"line_number":334,"context_line":"            self.neutron.sriov_pf_port2[\u0027id\u0027])"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"    def test_attach_change_nonsriov_pf_to_sriov_pf(self):"},{"line_number":337,"context_line":"        # Starts a compute with PF not configured with SRIOV capabilities"},{"line_number":338,"context_line":"        # Updates the PF with SRIOV capability and restart the compute service"},{"line_number":339,"context_line":"        # Then starts a VM with the sriov port. The VM should be in active"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_d79d9357","line":336,"updated":"2020-09-11 14:26:46.000000000","message":"This is the wrong class: we\u0027re not attaching/detaching devices here. Can you place it in \u0027SRIOVServersTest\u0027 above?","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"4356f43ea45a8c14baf0f46831b76479259923eb","unresolved":false,"context_lines":[{"line_number":333,"context_line":"            self.neutron.sriov_pf_port[\u0027id\u0027],"},{"line_number":334,"context_line":"            self.neutron.sriov_pf_port2[\u0027id\u0027])"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"    def test_attach_change_nonsriov_pf_to_sriov_pf(self):"},{"line_number":337,"context_line":"        # Starts a compute with PF not configured with SRIOV capabilities"},{"line_number":338,"context_line":"        # Updates the PF with SRIOV capability and restart the compute service"},{"line_number":339,"context_line":"        # Then starts a VM with the sriov port. The VM should be in active"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_06e1849c","line":336,"in_reply_to":"9f560f44_d79d9357","updated":"2020-09-14 10:52:23.000000000","message":"This test case requires more setup than the SRIOVServersTest, so created new Test class SRIOVServersTestViaNeutron.","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"5f37f19c62d00f4576f8c6c99987d0c578026e16","unresolved":false,"context_lines":[{"line_number":338,"context_line":"        # Updates the PF with SRIOV capability and restart the compute service"},{"line_number":339,"context_line":"        # Then starts a VM with the sriov port. The VM should be in active"},{"line_number":340,"context_line":"        # state with sriov port attached."},{"line_number":341,"context_line":"        host_info \u003d fakelibvirt.HostInfo(cpu_nodes\u003d2, cpu_sockets\u003d1,"},{"line_number":342,"context_line":"                                         cpu_cores\u003d2, cpu_threads\u003d2,"},{"line_number":343,"context_line":"                                         kB_mem\u003d15740000)"},{"line_number":344,"context_line":"        pci_info \u003d fakelibvirt.HostPCIDevicesInfo(num_pfs\u003d1, num_vfs\u003d1)"},{"line_number":345,"context_line":"        pci_info_no_sriov \u003d copy.deepcopy(pci_info)"},{"line_number":346,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_17a42ba2","line":343,"range":{"start_line":341,"start_character":0,"end_line":343,"end_character":57},"updated":"2020-09-11 14:26:46.000000000","message":"You don\u0027t need this anymore. It\u0027s the default value if host_info is not provided to \u0027_get_connection\u0027","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"4356f43ea45a8c14baf0f46831b76479259923eb","unresolved":false,"context_lines":[{"line_number":338,"context_line":"        # Updates the PF with SRIOV capability and restart the compute service"},{"line_number":339,"context_line":"        # Then starts a VM with the sriov port. The VM should be in active"},{"line_number":340,"context_line":"        # state with sriov port attached."},{"line_number":341,"context_line":"        host_info \u003d fakelibvirt.HostInfo(cpu_nodes\u003d2, cpu_sockets\u003d1,"},{"line_number":342,"context_line":"                                         cpu_cores\u003d2, cpu_threads\u003d2,"},{"line_number":343,"context_line":"                                         kB_mem\u003d15740000)"},{"line_number":344,"context_line":"        pci_info \u003d fakelibvirt.HostPCIDevicesInfo(num_pfs\u003d1, num_vfs\u003d1)"},{"line_number":345,"context_line":"        pci_info_no_sriov \u003d copy.deepcopy(pci_info)"},{"line_number":346,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_e6dd70de","line":343,"range":{"start_line":341,"start_character":0,"end_line":343,"end_character":57},"in_reply_to":"9f560f44_17a42ba2","updated":"2020-09-14 10:52:23.000000000","message":"Done","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"18795fa40c9bff985472c00c6ae7d4908b8036a4","unresolved":false,"context_lines":[{"line_number":342,"context_line":"                                         cpu_cores\u003d2, cpu_threads\u003d2,"},{"line_number":343,"context_line":"                                         kB_mem\u003d15740000)"},{"line_number":344,"context_line":"        pci_info \u003d fakelibvirt.HostPCIDevicesInfo(num_pfs\u003d1, num_vfs\u003d1)"},{"line_number":345,"context_line":"        pci_info_no_sriov \u003d copy.deepcopy(pci_info)"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"        # Disable SRIOV capabilties in PF and delete the VFs"},{"line_number":348,"context_line":"        self._disable_sriov_in_pf(pci_info_no_sriov)"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"        fake_connection \u003d self._get_connection(host_info, pci_info_no_sriov)"},{"line_number":351,"context_line":"        self.mock_conn.return_value \u003d fake_connection"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_ba6f29c2","line":348,"range":{"start_line":345,"start_character":9,"end_line":348,"end_character":52},"updated":"2020-09-11 11:14:17.000000000","message":"instead of doing this you could have done\n\npci_info_no_sriov \u003d fakelibvirt.HostPCIDevicesInfo(num_pci\u003d1)\n\nis there a reason you have not done that?","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c2802f52a96d6be60d8647bf9c44be432b6cabee","unresolved":false,"context_lines":[{"line_number":342,"context_line":"                                         cpu_cores\u003d2, cpu_threads\u003d2,"},{"line_number":343,"context_line":"                                         kB_mem\u003d15740000)"},{"line_number":344,"context_line":"        pci_info \u003d fakelibvirt.HostPCIDevicesInfo(num_pfs\u003d1, num_vfs\u003d1)"},{"line_number":345,"context_line":"        pci_info_no_sriov \u003d copy.deepcopy(pci_info)"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"        # Disable SRIOV capabilties in PF and delete the VFs"},{"line_number":348,"context_line":"        self._disable_sriov_in_pf(pci_info_no_sriov)"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"        fake_connection \u003d self._get_connection(host_info, pci_info_no_sriov)"},{"line_number":351,"context_line":"        self.mock_conn.return_value \u003d fake_connection"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_715bd8f5","line":348,"range":{"start_line":345,"start_character":9,"end_line":348,"end_character":52},"in_reply_to":"9f560f44_66eb2078","updated":"2020-09-14 11:21:17.000000000","message":"am can you leave a comment in the code to that effect.\nits non obvious that that is the reason.","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"04305241ebcb06126cecf172079b6d8462abaae8","unresolved":false,"context_lines":[{"line_number":342,"context_line":"                                         cpu_cores\u003d2, cpu_threads\u003d2,"},{"line_number":343,"context_line":"                                         kB_mem\u003d15740000)"},{"line_number":344,"context_line":"        pci_info \u003d fakelibvirt.HostPCIDevicesInfo(num_pfs\u003d1, num_vfs\u003d1)"},{"line_number":345,"context_line":"        pci_info_no_sriov \u003d copy.deepcopy(pci_info)"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"        # Disable SRIOV capabilties in PF and delete the VFs"},{"line_number":348,"context_line":"        self._disable_sriov_in_pf(pci_info_no_sriov)"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"        fake_connection \u003d self._get_connection(host_info, pci_info_no_sriov)"},{"line_number":351,"context_line":"        self.mock_conn.return_value \u003d fake_connection"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_91a78cbd","line":348,"range":{"start_line":345,"start_character":9,"end_line":348,"end_character":52},"in_reply_to":"9f560f44_715bd8f5","updated":"2020-09-14 11:35:24.000000000","message":"Done","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"4356f43ea45a8c14baf0f46831b76479259923eb","unresolved":false,"context_lines":[{"line_number":342,"context_line":"                                         cpu_cores\u003d2, cpu_threads\u003d2,"},{"line_number":343,"context_line":"                                         kB_mem\u003d15740000)"},{"line_number":344,"context_line":"        pci_info \u003d fakelibvirt.HostPCIDevicesInfo(num_pfs\u003d1, num_vfs\u003d1)"},{"line_number":345,"context_line":"        pci_info_no_sriov \u003d copy.deepcopy(pci_info)"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"        # Disable SRIOV capabilties in PF and delete the VFs"},{"line_number":348,"context_line":"        self._disable_sriov_in_pf(pci_info_no_sriov)"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"        fake_connection \u003d self._get_connection(host_info, pci_info_no_sriov)"},{"line_number":351,"context_line":"        self.mock_conn.return_value \u003d fake_connection"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_66eb2078","line":348,"range":{"start_line":345,"start_character":9,"end_line":348,"end_character":52},"in_reply_to":"9f560f44_ba6f29c2","updated":"2020-09-14 10:52:23.000000000","message":"The vendor/product id are different for PCI and PF. Thats the reason a PF is created and simulated disabling the sriov capabilities","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"18795fa40c9bff985472c00c6ae7d4908b8036a4","unresolved":false,"context_lines":[{"line_number":351,"context_line":"        self.mock_conn.return_value \u003d fake_connection"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"        self.compute \u003d self.start_service(\u0027compute\u0027, host\u003d\u0027test_compute0\u0027)"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"        # Update connection with original pci info with sriov PFs"},{"line_number":356,"context_line":"        fake_connection \u003d self._get_connection(host_info, pci_info)"},{"line_number":357,"context_line":"        self.mock_conn.return_value \u003d fake_connection"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_daef7d1a","line":354,"updated":"2020-09-11 11:14:17.000000000","message":"you might need to call\n    self.run_periodic()\nhere to ensure they are run.\nthey normally dont run in the func test unless you run them\nalthough that said pci info will be updated form init_host on agent start in either case so in this case i think the test is correct as written.","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"4356f43ea45a8c14baf0f46831b76479259923eb","unresolved":false,"context_lines":[{"line_number":351,"context_line":"        self.mock_conn.return_value \u003d fake_connection"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"        self.compute \u003d self.start_service(\u0027compute\u0027, host\u003d\u0027test_compute0\u0027)"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"        # Update connection with original pci info with sriov PFs"},{"line_number":356,"context_line":"        fake_connection \u003d self._get_connection(host_info, pci_info)"},{"line_number":357,"context_line":"        self.mock_conn.return_value \u003d fake_connection"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_4691bcf7","line":354,"in_reply_to":"9f560f44_daef7d1a","updated":"2020-09-14 10:52:23.000000000","message":"As you mentioned the periodic call is not required since the pci info is updated on agent start. \nEither way, I couldn\u0027t find proper function to call run_periodic()","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"18795fa40c9bff985472c00c6ae7d4908b8036a4","unresolved":false,"context_lines":[{"line_number":352,"context_line":""},{"line_number":353,"context_line":"        self.compute \u003d self.start_service(\u0027compute\u0027, host\u003d\u0027test_compute0\u0027)"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"        # Update connection with original pci info with sriov PFs"},{"line_number":356,"context_line":"        fake_connection \u003d self._get_connection(host_info, pci_info)"},{"line_number":357,"context_line":"        self.mock_conn.return_value \u003d fake_connection"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"        # Restart the compute service"},{"line_number":360,"context_line":"        self.restart_compute_service(self.compute)"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"        # Create server with a port"},{"line_number":363,"context_line":"        sriov_port_id \u003d self.neutron.sriov_port[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_9ad2255b","line":360,"range":{"start_line":355,"start_character":8,"end_line":360,"end_character":50},"updated":"2020-09-11 11:14:17.000000000","message":"so the first compute service start populates the pci device table with the non sriov value.\n\nwe probably should assert that before restarting the service.","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"4356f43ea45a8c14baf0f46831b76479259923eb","unresolved":false,"context_lines":[{"line_number":352,"context_line":""},{"line_number":353,"context_line":"        self.compute \u003d self.start_service(\u0027compute\u0027, host\u003d\u0027test_compute0\u0027)"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"        # Update connection with original pci info with sriov PFs"},{"line_number":356,"context_line":"        fake_connection \u003d self._get_connection(host_info, pci_info)"},{"line_number":357,"context_line":"        self.mock_conn.return_value \u003d fake_connection"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"        # Restart the compute service"},{"line_number":360,"context_line":"        self.restart_compute_service(self.compute)"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"        # Create server with a port"},{"line_number":363,"context_line":"        sriov_port_id \u003d self.neutron.sriov_port[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_269648f1","line":360,"range":{"start_line":355,"start_character":8,"end_line":360,"end_character":50},"in_reply_to":"9f560f44_9ad2255b","updated":"2020-09-14 10:52:23.000000000","message":"Done","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"5f37f19c62d00f4576f8c6c99987d0c578026e16","unresolved":false,"context_lines":[{"line_number":363,"context_line":"        sriov_port_id \u003d self.neutron.sriov_port[\u0027id\u0027]"},{"line_number":364,"context_line":"        server \u003d self._create_server(networks\u003d[{\u0027port\u0027: sriov_port_id}])"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"        updated_port \u003d self.neutron.show_port(sriov_port_id)[\u0027port\u0027]"},{"line_number":367,"context_line":"        self.assertEqual(\u0027test_compute0\u0027, updated_port[\u0027binding:host_id\u0027])"},{"line_number":368,"context_line":"        self.assertIn(sriov_port_id, self._get_attached_port_ids(server[\u0027id\u0027]))"},{"line_number":369,"context_line":""},{"line_number":370,"context_line":""},{"line_number":371,"context_line":"class PCIServersTest(_PCIServersTestBase):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_975b1b84","line":368,"range":{"start_line":366,"start_character":0,"end_line":368,"end_character":79},"updated":"2020-09-11 14:26:46.000000000","message":"This isn\u0027t necessary. The VM will fail to boot if it can\u0027t get a PF.","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"4356f43ea45a8c14baf0f46831b76479259923eb","unresolved":false,"context_lines":[{"line_number":363,"context_line":"        sriov_port_id \u003d self.neutron.sriov_port[\u0027id\u0027]"},{"line_number":364,"context_line":"        server \u003d self._create_server(networks\u003d[{\u0027port\u0027: sriov_port_id}])"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"        updated_port \u003d self.neutron.show_port(sriov_port_id)[\u0027port\u0027]"},{"line_number":367,"context_line":"        self.assertEqual(\u0027test_compute0\u0027, updated_port[\u0027binding:host_id\u0027])"},{"line_number":368,"context_line":"        self.assertIn(sriov_port_id, self._get_attached_port_ids(server[\u0027id\u0027]))"},{"line_number":369,"context_line":""},{"line_number":370,"context_line":""},{"line_number":371,"context_line":"class PCIServersTest(_PCIServersTestBase):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_869bd415","line":368,"range":{"start_line":366,"start_character":0,"end_line":368,"end_character":79},"in_reply_to":"9f560f44_975b1b84","updated":"2020-09-14 10:52:23.000000000","message":"Done","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"55fcf2a4b4a83bff57c5d57cf3ab506c5487fbaa","unresolved":false,"context_lines":[{"line_number":259,"context_line":"        # Then starts a VM with the sriov port. The VM should be in active"},{"line_number":260,"context_line":"        # state with sriov port attached."},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"        # Create a HostPCIDevice with PF which is created with SRIOV"},{"line_number":263,"context_line":"        # capabilities by default. Remove the sriov capability by modifying"},{"line_number":264,"context_line":"        # capability function and deleting the VFs under PF."},{"line_number":265,"context_line":"        # Creating HostPCIDevice with PCI and convert to PF is not considered"},{"line_number":266,"context_line":"        # since the PF_PROD_ID and PCI_PROD_ID are different. The nova"},{"line_number":267,"context_line":"        # considers them as separate device."},{"line_number":268,"context_line":"        pci_info \u003d fakelibvirt.HostPCIDevicesInfo(num_pfs\u003d1, num_vfs\u003d1)"},{"line_number":269,"context_line":"        pci_info_no_sriov \u003d copy.deepcopy(pci_info)"},{"line_number":270,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_76f469f2","line":267,"range":{"start_line":262,"start_character":7,"end_line":267,"end_character":44},"updated":"2020-09-14 14:24:10.000000000","message":"so if the only thing that need to be changed is the product id then it sould like it would be simpler to create it with num_pci and then just updated that instead of creating PFs and VFs and then removing the VFs\n\nwith that said if we leave this the way it is i would rewirte the comment as follows\n\n# To emulated the device type changing we first create a HostPCIDevicesInfo object with PFs and VFs.\n# Then we make a copy and remove the VFs and the virt_functions capability. This is done to ensure the physical function product id is the same in both versions.","commit_id":"793e4e23c25681033e0c918e85ee431ab6f478e5"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"639846b7fb549cdf14fca6e188e0307a685f42e9","unresolved":false,"context_lines":[{"line_number":259,"context_line":"        # Then starts a VM with the sriov port. The VM should be in active"},{"line_number":260,"context_line":"        # state with sriov port attached."},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"        # Create a HostPCIDevice with PF which is created with SRIOV"},{"line_number":263,"context_line":"        # capabilities by default. Remove the sriov capability by modifying"},{"line_number":264,"context_line":"        # capability function and deleting the VFs under PF."},{"line_number":265,"context_line":"        # Creating HostPCIDevice with PCI and convert to PF is not considered"},{"line_number":266,"context_line":"        # since the PF_PROD_ID and PCI_PROD_ID are different. The nova"},{"line_number":267,"context_line":"        # considers them as separate device."},{"line_number":268,"context_line":"        pci_info \u003d fakelibvirt.HostPCIDevicesInfo(num_pfs\u003d1, num_vfs\u003d1)"},{"line_number":269,"context_line":"        pci_info_no_sriov \u003d copy.deepcopy(pci_info)"},{"line_number":270,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_f49351a3","line":267,"range":{"start_line":262,"start_character":7,"end_line":267,"end_character":44},"in_reply_to":"9f560f44_76f469f2","updated":"2020-09-14 15:06:21.000000000","message":"Done, left with the comment as suggested.","commit_id":"793e4e23c25681033e0c918e85ee431ab6f478e5"},{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"6577e3c2821cbf2b25dbd62aa45c118262766db1","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        self.assertIsNone(diagnostics[\u0027nic_details\u0027][1][\u0027tx_packets\u0027])"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"class SRIOVServersTestViaNeutron(_PCIServersTestBase):"},{"line_number":270,"context_line":"    # no need for aliases as these test will request SRIOV via neutron"},{"line_number":271,"context_line":"    PCI_ALIAS \u003d []"},{"line_number":272,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_eee1999d","line":269,"range":{"start_line":269,"start_character":6,"end_line":269,"end_character":32},"updated":"2020-09-16 12:15:34.000000000","message":"nit: SRIOVDeviceTypeChangeTest maybe?","commit_id":"5a123375c4e4ce08132b9d4bb733d8dd965d7f2d"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"ce26f0b0d56b07e98b1a75cc0602108c88e45b75","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        self.assertIsNone(diagnostics[\u0027nic_details\u0027][1][\u0027tx_packets\u0027])"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"class SRIOVServersTestViaNeutron(_PCIServersTestBase):"},{"line_number":270,"context_line":"    # no need for aliases as these test will request SRIOV via neutron"},{"line_number":271,"context_line":"    PCI_ALIAS \u003d []"},{"line_number":272,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_3c48d02c","line":269,"range":{"start_line":269,"start_character":6,"end_line":269,"end_character":32},"in_reply_to":"9f560f44_eee1999d","updated":"2020-09-17 11:28:23.000000000","message":"My bad, unnecessarily created a separate class for single test case, now i moved the test case to class SRIOVServersTest.","commit_id":"5a123375c4e4ce08132b9d4bb733d8dd965d7f2d"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"54473e817be1df496f9e859ac8a4b1bde1522e2e","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        vfs_to_delete \u003d []"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        for device_name, device in pci_info.devices.items():"},{"line_number":114,"context_line":"            if \u0027virt_functions\u0027 in device.pci_device:"},{"line_number":115,"context_line":"                device.pci_device \u003d device.pci_device.replace("},{"line_number":116,"context_line":"                    \u0027virt_functions\u0027, \u0027fake_functions\u0027)"},{"line_number":117,"context_line":"            elif \u0027phys_function\u0027 in device.pci_device:"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f6b1bfe_85458c73","line":114,"updated":"2020-10-13 16:13:33.000000000","message":"So you\u0027re modifying the XML in-place rather than generating new, similar devices because they\u0027ll have a different address or something? That seems reasonable but what you\u0027re doing here is very fragile and hard to grok. Rather than doing this, how about we improve \u0027FakePCIDevice\u0027 so that we can do this properly? You could move the bulk of the XML generation from \u0027__init__\u0027 [1] to a separate function, e.g. \u0027generate_xml\u0027, that we can call after updating attributes?\n\n  class FakePCIDevice(object):\n  \n      ...\n\n      def __init__(\n          self, dev_type, slot, function, iommu_group, numa_node,\n          vf_ratio\u003dNone, multiple_gpu_types\u003dFalse, parent\u003dNone\n      ):\n          self.dev_type \u003d dev_type\n          self.slot \u003d slot\n          self.function \u003d function\n          self.iommu_group \u003d iommu_group\n          self.numa_node \u003d numa_node\n          self.vf_ratio \u003d vf_ratio\n          self.multiple_gpu_types \u003d multiple_gpu_types\n          self.parent \u003d parent\n\n          self.generate_xml()\n\n      def generate_xml(self):\n          vend_id \u003d PCI_VEND_ID\n          ...\n\n[1] https://github.com/openstack/nova/blob/261de76104ca67bed3ea6cdbcaaab0e44030f1e2/nova/tests/unit/virt/libvirt/fakelibvirt.py#L287-L369","commit_id":"84bb6a9751dec95e7bbeb15a6a08958db7753b4c"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"9d8679bc2981f072a290bc470800e8fc524a8dac","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        vfs_to_delete \u003d []"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        for device_name, device in pci_info.devices.items():"},{"line_number":114,"context_line":"            if \u0027virt_functions\u0027 in device.pci_device:"},{"line_number":115,"context_line":"                device.pci_device \u003d device.pci_device.replace("},{"line_number":116,"context_line":"                    \u0027virt_functions\u0027, \u0027fake_functions\u0027)"},{"line_number":117,"context_line":"            elif \u0027phys_function\u0027 in device.pci_device:"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f6b1bfe_0c7d20b1","line":114,"in_reply_to":"7f6b1bfe_85458c73","updated":"2020-10-14 05:10:50.000000000","message":"Modified as per your suggestion. In addition, new parameter skip_capability is added with default value as False. If this parameter is set to True, the capability section is not updated for the device.","commit_id":"84bb6a9751dec95e7bbeb15a6a08958db7753b4c"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"54473e817be1df496f9e859ac8a4b1bde1522e2e","unresolved":false,"context_lines":[{"line_number":305,"context_line":""},{"line_number":306,"context_line":"        self.compute \u003d self.start_service(\u0027compute\u0027, host\u003d\u0027test_compute0\u0027)"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"        engine \u003d session.get_engine()"},{"line_number":309,"context_line":"        conn \u003d engine.connect()"},{"line_number":310,"context_line":"        result \u003d conn.execute(\"select * from pci_devices\")"},{"line_number":311,"context_line":"        rows \u003d result.fetchall()"},{"line_number":312,"context_line":"        # Assert if DB has device registered with type-PCI"},{"line_number":313,"context_line":"        self.assertEqual(\u0027type-PCI\u0027, rows[0].dev_type)"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"        # Update connection with original pci info with sriov PFs"},{"line_number":316,"context_line":"        fake_connection \u003d self._get_connection(pci_info\u003dpci_info)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f6b1bfe_457894f7","line":313,"range":{"start_line":308,"start_character":0,"end_line":313,"end_character":54},"updated":"2020-10-13 16:13:33.000000000","message":"Any reason we can\u0027t use the \u0027PciDeviceList.get_by_compute_node\u0027 helper to achieve this? It reads from the DB, albeit via the SQLAlchemy-based ORM. For example:\n\n  pci_devices \u003d objects.PciDeviceList.get_by_compute_node(\n      self.ctxt,\n      objects.ComputeNode.get_by_nodename(\n          self.ctxt, \u0027test_compute0\u0027,\n      ).id,\n  )\n  self.assertEqual(1, len(pci_devices))\n  self.assertEqual(\u0027type-PCI\u0027, pci_devices[0].dev_type)","commit_id":"84bb6a9751dec95e7bbeb15a6a08958db7753b4c"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"9d8679bc2981f072a290bc470800e8fc524a8dac","unresolved":false,"context_lines":[{"line_number":305,"context_line":""},{"line_number":306,"context_line":"        self.compute \u003d self.start_service(\u0027compute\u0027, host\u003d\u0027test_compute0\u0027)"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"        engine \u003d session.get_engine()"},{"line_number":309,"context_line":"        conn \u003d engine.connect()"},{"line_number":310,"context_line":"        result \u003d conn.execute(\"select * from pci_devices\")"},{"line_number":311,"context_line":"        rows \u003d result.fetchall()"},{"line_number":312,"context_line":"        # Assert if DB has device registered with type-PCI"},{"line_number":313,"context_line":"        self.assertEqual(\u0027type-PCI\u0027, rows[0].dev_type)"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"        # Update connection with original pci info with sriov PFs"},{"line_number":316,"context_line":"        fake_connection \u003d self._get_connection(pci_info\u003dpci_info)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f6b1bfe_6c4bf486","line":313,"range":{"start_line":308,"start_character":0,"end_line":313,"end_character":54},"in_reply_to":"7f6b1bfe_457894f7","updated":"2020-10-14 05:10:50.000000000","message":"Modified the code to read from objects instead of directly from DB.","commit_id":"84bb6a9751dec95e7bbeb15a6a08958db7753b4c"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"54473e817be1df496f9e859ac8a4b1bde1522e2e","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        # Restart the compute service"},{"line_number":320,"context_line":"        self.restart_compute_service(self.compute)"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"        # create the port"},{"line_number":323,"context_line":"        self.neutron.create_port({\u0027port\u0027: self.neutron.network_4_port_1})"},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"        # create a server using the VF via neutron"},{"line_number":326,"context_line":"        flavor_id \u003d self._create_flavor()"},{"line_number":327,"context_line":"        self._create_server("},{"line_number":328,"context_line":"            flavor_id\u003dflavor_id,"},{"line_number":329,"context_line":"            networks\u003d["},{"line_number":330,"context_line":"                {\u0027port\u0027: base.LibvirtNeutronFixture.network_4_port_1[\u0027id\u0027]},"},{"line_number":331,"context_line":"            ],"},{"line_number":332,"context_line":"        )"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"class SRIOVAttachDetachTest(_PCIServersTestBase):"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f6b1bfe_c5d944f5","line":332,"range":{"start_line":322,"start_character":0,"end_line":332,"end_character":9},"updated":"2020-10-13 16:13:33.000000000","message":"Not that this is a bad idea, but instead of this (or in addition), couldn\u0027t you check the DB? I mean, you\u0027ve done nothing to indicate that this wouldn\u0027t work before you made the changes","commit_id":"84bb6a9751dec95e7bbeb15a6a08958db7753b4c"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"9d8679bc2981f072a290bc470800e8fc524a8dac","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        # Restart the compute service"},{"line_number":320,"context_line":"        self.restart_compute_service(self.compute)"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"        # create the port"},{"line_number":323,"context_line":"        self.neutron.create_port({\u0027port\u0027: self.neutron.network_4_port_1})"},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"        # create a server using the VF via neutron"},{"line_number":326,"context_line":"        flavor_id \u003d self._create_flavor()"},{"line_number":327,"context_line":"        self._create_server("},{"line_number":328,"context_line":"            flavor_id\u003dflavor_id,"},{"line_number":329,"context_line":"            networks\u003d["},{"line_number":330,"context_line":"                {\u0027port\u0027: base.LibvirtNeutronFixture.network_4_port_1[\u0027id\u0027]},"},{"line_number":331,"context_line":"            ],"},{"line_number":332,"context_line":"        )"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"class SRIOVAttachDetachTest(_PCIServersTestBase):"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f6b1bfe_a721a5a2","line":332,"range":{"start_line":322,"start_character":0,"end_line":332,"end_character":9},"in_reply_to":"7f6b1bfe_c5d944f5","updated":"2020-10-14 05:10:50.000000000","message":"After adding sriov capabilities and restart of compute node, the PCIDevTracker updates the stats pools based on information available in DB (dev_type for the device is type-PCI at this point). The hypervisor resource update gets triggered which corrects the DB (changes dev_type to type-PF) but the stats pools are not updated based on changes in dev_type.\n\nIn short, the DB gets corrected after restart of compute node but not the PCI stats pools. The only way to verify is to assert the stats object directly using self.compute.manager.rt.pci_tracker.stats\nIs this a good way to use the stats object directly for assertions given these are functional tests? Could you please suggest.","commit_id":"84bb6a9751dec95e7bbeb15a6a08958db7753b4c"}],"nova/tests/unit/pci/test_stats.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"2e17876da79b7775dff6711d686a7d9ef44cabeb","unresolved":false,"context_lines":[{"line_number":562,"context_line":"        self._assertPools()"},{"line_number":563,"context_line":""},{"line_number":564,"context_line":"    def test_update_device(self):"},{"line_number":565,"context_line":"        # Update device type of one of the device from type-PCI to"},{"line_number":566,"context_line":"        # type-PF. Verify if the existing pool is updated and a new"},{"line_number":567,"context_line":"        # pool is created with dev_type type-PF."},{"line_number":568,"context_line":"        self._create_pci_devices()"},{"line_number":569,"context_line":"        dev1 \u003d self.pci_tagged_devices.pop()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_efa66e0f","line":566,"range":{"start_line":565,"start_character":9,"end_line":566,"end_character":19},"updated":"2020-09-04 15:12:35.000000000","message":"this shoudl never happen at runtime but it can happen if you do a firmware update or in some case reconfigure a device form datacenter bridning mode to sriov mode.\n\nbasically this will only happen if a device previously did not support sriov virtual fucntions but then gain the ablity to support virtual function in the pci config space capablities.\n\nso this is an exceeing rare edgecase but it can happen with devices like intel QAT if they are running a very very old firmware and kernel\n\nother device might also cahnge in this way.\n\na better example is PF passthough \n\nif you allocate the VF at runtime then do a PF pasthough when you detach the PF from the vm the VF wont be reallocated in which case we end up with a bunch of VF in the DB that nolonger exist on the host.\n\nill pull donw this patch on monday and see if it also fixes that case if not we might want to exted it to also cover that case. i was going to file a bug for it after i noticed it yesterday but it would be nice to cover both cases in one patch so we can backport it together.\n\nthere is a third use case that this might fix that i became aware of last week realted to changeing the numa toplody fo the host via a bios change.\n\ni belive that this patch as written should correct that use cause but it would be nice ot have functional test to validate that too.","commit_id":"4603aab407ceed9035a8621eeb1f62e05f412208"}],"nova/tests/unit/virt/libvirt/fakelibvirt.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"18795fa40c9bff985472c00c6ae7d4908b8036a4","unresolved":false,"context_lines":[{"line_number":992,"context_line":""},{"line_number":993,"context_line":"        return definition"},{"line_number":994,"context_line":""},{"line_number":995,"context_line":"    def _is_pcidevice_vf(self):"},{"line_number":996,"context_line":"        error_message \u003d (\"Interface type hostdev is currently supported on \""},{"line_number":997,"context_line":"                         \"SR-IOV Virtual Functions only\")"},{"line_number":998,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_da0bfdd1","line":995,"range":{"start_line":995,"start_character":8,"end_line":995,"end_character":24},"updated":"2020-09-11 11:14:17.000000000","message":"this is not realy a good name\n\n_is impleies this fucntion returns a bool but this returns nothing.\n\nit also does not capture that this is actully asserting that all interface of type hostdev are VFs\n\nso verify_hostdevs_interface_are_vfs would be better\nif you update the name im ok with this raising an excpetion instead of returning.","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"4356f43ea45a8c14baf0f46831b76479259923eb","unresolved":false,"context_lines":[{"line_number":992,"context_line":""},{"line_number":993,"context_line":"        return definition"},{"line_number":994,"context_line":""},{"line_number":995,"context_line":"    def _is_pcidevice_vf(self):"},{"line_number":996,"context_line":"        error_message \u003d (\"Interface type hostdev is currently supported on \""},{"line_number":997,"context_line":"                         \"SR-IOV Virtual Functions only\")"},{"line_number":998,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_e68bb0bd","line":995,"range":{"start_line":995,"start_character":8,"end_line":995,"end_character":24},"in_reply_to":"9f560f44_da0bfdd1","updated":"2020-09-14 10:52:23.000000000","message":"Done","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"18795fa40c9bff985472c00c6ae7d4908b8036a4","unresolved":false,"context_lines":[{"line_number":1002,"context_line":"                pci_device \u003d nic[\u0027source\u0027]"},{"line_number":1003,"context_line":"                pci_info_from_connection \u003d self._connection.pci_info.devices["},{"line_number":1004,"context_line":"                    pci_device]"},{"line_number":1005,"context_line":"                if \u0027phys_function\u0027 not in pci_info_from_connection.pci_device:"},{"line_number":1006,"context_line":"                    raise make_libvirtError("},{"line_number":1007,"context_line":"                        libvirtError,"},{"line_number":1008,"context_line":"                        error_message,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_fa1c0114","line":1005,"range":{"start_line":1005,"start_character":16,"end_line":1005,"end_character":18},"updated":"2020-09-11 11:14:17.000000000","message":"if you want to keep the current name change this if to a return\n\ne.g. return \u0027phys_function\u0027 in pci_info_from_connection.pci_device","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"4356f43ea45a8c14baf0f46831b76479259923eb","unresolved":false,"context_lines":[{"line_number":1002,"context_line":"                pci_device \u003d nic[\u0027source\u0027]"},{"line_number":1003,"context_line":"                pci_info_from_connection \u003d self._connection.pci_info.devices["},{"line_number":1004,"context_line":"                    pci_device]"},{"line_number":1005,"context_line":"                if \u0027phys_function\u0027 not in pci_info_from_connection.pci_device:"},{"line_number":1006,"context_line":"                    raise make_libvirtError("},{"line_number":1007,"context_line":"                        libvirtError,"},{"line_number":1008,"context_line":"                        error_message,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_46ba5c71","line":1005,"range":{"start_line":1005,"start_character":16,"end_line":1005,"end_character":18},"in_reply_to":"9f560f44_fa1c0114","updated":"2020-09-14 10:52:23.000000000","message":"Done","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"18795fa40c9bff985472c00c6ae7d4908b8036a4","unresolved":false,"context_lines":[{"line_number":1014,"context_line":""},{"line_number":1015,"context_line":"    def createWithFlags(self, flags):"},{"line_number":1016,"context_line":"        # FIXME: Not handling flags at the moment"},{"line_number":1017,"context_line":"        self._is_pcidevice_vf()"},{"line_number":1018,"context_line":"        self._state \u003d VIR_DOMAIN_RUNNING"},{"line_number":1019,"context_line":"        self._connection._mark_running(self)"},{"line_number":1020,"context_line":"        self._has_saved_state \u003d False"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_badc4945","line":1017,"range":{"start_line":1017,"start_character":7,"end_line":1017,"end_character":31},"updated":"2020-09-11 11:14:17.000000000","message":"then do\nif not self._is_pcidevice_vf():\n    raise ...","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"4356f43ea45a8c14baf0f46831b76479259923eb","unresolved":false,"context_lines":[{"line_number":1014,"context_line":""},{"line_number":1015,"context_line":"    def createWithFlags(self, flags):"},{"line_number":1016,"context_line":"        # FIXME: Not handling flags at the moment"},{"line_number":1017,"context_line":"        self._is_pcidevice_vf()"},{"line_number":1018,"context_line":"        self._state \u003d VIR_DOMAIN_RUNNING"},{"line_number":1019,"context_line":"        self._connection._mark_running(self)"},{"line_number":1020,"context_line":"        self._has_saved_state \u003d False"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_26bf6861","line":1017,"range":{"start_line":1017,"start_character":7,"end_line":1017,"end_character":31},"in_reply_to":"9f560f44_badc4945","updated":"2020-09-14 10:52:23.000000000","message":"Done","commit_id":"1c341b954eac5dc5318137b3e4934cf9fa74aaa8"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7a643d18859da41fb324213e78b9360450d138d9","unresolved":false,"context_lines":[{"line_number":972,"context_line":"                        \u0027model\u0027: hostdev.get(\u0027model\u0027),"},{"line_number":973,"context_line":"                        \u0027address_uuid\u0027: address.get(\u0027uuid\u0027)"},{"line_number":974,"context_line":"                    })"},{"line_number":975,"context_line":""},{"line_number":976,"context_line":"            devices[\u0027hostdevs\u0027] \u003d hostdev_info"},{"line_number":977,"context_line":""},{"line_number":978,"context_line":"            vpmem_info \u003d []"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f560f44_ff7661a3","line":975,"updated":"2020-10-01 12:53:37.000000000","message":"nit: seems unrelated","commit_id":"07169fc0270723f79c561dfe40151e1318913157"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"057f2a165fec3080b69a1a8fd6a6e67665ef9011","unresolved":false,"context_lines":[{"line_number":972,"context_line":"                        \u0027model\u0027: hostdev.get(\u0027model\u0027),"},{"line_number":973,"context_line":"                        \u0027address_uuid\u0027: address.get(\u0027uuid\u0027)"},{"line_number":974,"context_line":"                    })"},{"line_number":975,"context_line":""},{"line_number":976,"context_line":"            devices[\u0027hostdevs\u0027] \u003d hostdev_info"},{"line_number":977,"context_line":""},{"line_number":978,"context_line":"            vpmem_info \u003d []"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f560f44_4ecd202f","line":975,"in_reply_to":"9f560f44_ff7661a3","updated":"2020-10-01 13:15:02.000000000","message":"Done","commit_id":"07169fc0270723f79c561dfe40151e1318913157"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7a643d18859da41fb324213e78b9360450d138d9","unresolved":false,"context_lines":[{"line_number":999,"context_line":""},{"line_number":1000,"context_line":"    def verify_hostdevs_interface_are_vfs(self):"},{"line_number":1001,"context_line":"        error_message \u003d (\"Interface type hostdev is currently supported on \""},{"line_number":1002,"context_line":"                         \"SR-IOV Virtual Functions only\")"},{"line_number":1003,"context_line":""},{"line_number":1004,"context_line":"        nics \u003d self._def[\u0027devices\u0027].get(\u0027nics\u0027, [])"},{"line_number":1005,"context_line":"        for nic in nics:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f560f44_ff9b01c5","line":1002,"range":{"start_line":1002,"start_character":26,"end_line":1002,"end_character":56},"updated":"2020-10-01 12:53:37.000000000","message":"I\u0027m confused. I thought hostdev is for SRIOV PF not SRIOV VF.","commit_id":"07169fc0270723f79c561dfe40151e1318913157"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"af71e4f64793dd00558f5a1ccfaef477b3a43fbd","unresolved":false,"context_lines":[{"line_number":999,"context_line":""},{"line_number":1000,"context_line":"    def verify_hostdevs_interface_are_vfs(self):"},{"line_number":1001,"context_line":"        error_message \u003d (\"Interface type hostdev is currently supported on \""},{"line_number":1002,"context_line":"                         \"SR-IOV Virtual Functions only\")"},{"line_number":1003,"context_line":""},{"line_number":1004,"context_line":"        nics \u003d self._def[\u0027devices\u0027].get(\u0027nics\u0027, [])"},{"line_number":1005,"context_line":"        for nic in nics:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f560f44_646a9ced","line":1002,"range":{"start_line":1002,"start_character":26,"end_line":1002,"end_character":56},"in_reply_to":"9f560f44_04802949","updated":"2020-10-05 15:34:56.000000000","message":"Thanks for the explanation.","commit_id":"07169fc0270723f79c561dfe40151e1318913157"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"9304dc8df1d8204be7d09f4b22b824e296ea809a","unresolved":false,"context_lines":[{"line_number":999,"context_line":""},{"line_number":1000,"context_line":"    def verify_hostdevs_interface_are_vfs(self):"},{"line_number":1001,"context_line":"        error_message \u003d (\"Interface type hostdev is currently supported on \""},{"line_number":1002,"context_line":"                         \"SR-IOV Virtual Functions only\")"},{"line_number":1003,"context_line":""},{"line_number":1004,"context_line":"        nics \u003d self._def[\u0027devices\u0027].get(\u0027nics\u0027, [])"},{"line_number":1005,"context_line":"        for nic in nics:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f560f44_04802949","line":1002,"range":{"start_line":1002,"start_character":26,"end_line":1002,"end_character":56},"in_reply_to":"9f560f44_ee4cf49e","updated":"2020-10-01 14:21:22.000000000","message":"the \u003chostdev\u003e element is for PF and other passhtough devices but the hostdev type\n\ne.g. \u003cinterface type\u003d\"hostdev\"\u003e is for a vf when using vnic-type\u003ddirect\n\nconfusingly \u003cinterface type\u003d\"direct\"\u003e is for macvtap","commit_id":"07169fc0270723f79c561dfe40151e1318913157"},{"author":{"_account_id":10366,"name":"Hemanth N","email":"hemanth.nakkina@canonical.com","username":"Hemanth"},"change_message_id":"057f2a165fec3080b69a1a8fd6a6e67665ef9011","unresolved":false,"context_lines":[{"line_number":999,"context_line":""},{"line_number":1000,"context_line":"    def verify_hostdevs_interface_are_vfs(self):"},{"line_number":1001,"context_line":"        error_message \u003d (\"Interface type hostdev is currently supported on \""},{"line_number":1002,"context_line":"                         \"SR-IOV Virtual Functions only\")"},{"line_number":1003,"context_line":""},{"line_number":1004,"context_line":"        nics \u003d self._def[\u0027devices\u0027].get(\u0027nics\u0027, [])"},{"line_number":1005,"context_line":"        for nic in nics:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f560f44_ee4cf49e","line":1002,"range":{"start_line":1002,"start_character":26,"end_line":1002,"end_character":56},"in_reply_to":"9f560f44_ff9b01c5","updated":"2020-10-01 13:15:02.000000000","message":"hostdev is for SRIOV VF. Here is the corresponding libvirt code that checks if the device is VF or not [1] \n\n[1]https://github.com/libvirt/libvirt/blob/master/src/hypervisor/virhostdev.c#L426-L431","commit_id":"07169fc0270723f79c561dfe40151e1318913157"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"9304dc8df1d8204be7d09f4b22b824e296ea809a","unresolved":false,"context_lines":[{"line_number":1003,"context_line":""},{"line_number":1004,"context_line":"        nics \u003d self._def[\u0027devices\u0027].get(\u0027nics\u0027, [])"},{"line_number":1005,"context_line":"        for nic in nics:"},{"line_number":1006,"context_line":"            if nic[\u0027type\u0027] \u003d\u003d \u0027hostdev\u0027:"},{"line_number":1007,"context_line":"                pci_device \u003d nic[\u0027source\u0027]"},{"line_number":1008,"context_line":"                pci_info_from_connection \u003d self._connection.pci_info.devices["},{"line_number":1009,"context_line":"                    pci_device]"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f560f44_247f2d67","line":1006,"range":{"start_line":1006,"start_character":14,"end_line":1006,"end_character":40},"updated":"2020-10-01 14:21:22.000000000","message":"so this is vnic_type\u003ddirect e.g. a vf when the device support sriov","commit_id":"07169fc0270723f79c561dfe40151e1318913157"}],"releasenotes/notes/bug-1892361-pci-deivce-type-update-c407a66fd37f6405.yaml":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"8657fc82640b824fd72a546c4951eab70bc8871a","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    existing device is enabled with SRIOV capability. Restart of nova-compute"},{"line_number":6,"context_line":"    service updates the pci device type from type-PCI to type-PF but the pools"},{"line_number":7,"context_line":"    still maintain the device type as type-PCI. And so the PF is considered for"},{"line_number":8,"context_line":"    allocation to instance that requests VF. With this fix, the pci device type"},{"line_number":9,"context_line":"    updates are detected and the pci stat pools are updated properly."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"    .. _bug 1892361: https://bugs.launchpad.net/nova/+bug/1892361"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"9f560f44_85ebc176","line":8,"range":{"start_line":8,"start_character":41,"end_line":8,"end_character":43},"updated":"2020-09-14 17:28:21.000000000","message":"nit: technically they requested vnic_type\u003ddirect not a VF.","commit_id":"015588f913393ee7d6efb5c5d4f4ffdabff2c0c1"},{"author":{"_account_id":32171,"name":"Girish Chilukuri","email":"girish.chilukuri@ibm.com","username":"GirishChilukuri"},"change_message_id":"ee77ffb4b8e38eb01747788d881cf491278fc333","unresolved":false,"context_lines":[{"line_number":9,"context_line":"    pci device type updates are detected and the pci stat pools are updated"},{"line_number":10,"context_line":"    properly."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"    .. _bug 1892361: https://bugs.launchpad.net/nova/+bug/1892361"}],"source_content_type":"text/x-yaml","patch_set":12,"id":"7f6b1bfe_2aa9d97a","line":12,"range":{"start_line":12,"start_character":21,"end_line":12,"end_character":65},"updated":"2020-10-14 10:44:45.000000000","message":"Hi Hemanth,\nThis link should come at line 4, please refer https://docs.openstack.org/keystone/pike/contributor/release-notes.html for updating the release notes.","commit_id":"b6fbe02585cf6cb9bf4e0d7afc1d446193a638b8"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"7da2732fd714c54dfee381e8ef00e319713ca1cf","unresolved":false,"context_lines":[{"line_number":9,"context_line":"    pci device type updates are detected and the pci stat pools are updated"},{"line_number":10,"context_line":"    properly."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"    .. _bug 1892361: https://bugs.launchpad.net/nova/+bug/1892361"}],"source_content_type":"text/x-yaml","patch_set":12,"id":"7f6b1bfe_eaf52185","line":12,"range":{"start_line":12,"start_character":21,"end_line":12,"end_character":65},"in_reply_to":"7f6b1bfe_2aa9d97a","updated":"2020-10-14 10:49:11.000000000","message":"No, this is correct rST\n\nhttp://rst.ninjs.org/#Rml4ZXMgYGJ1ZyAxODkyMzYxYF8KCi4uIF9idWcgMTg5MjM2MTogaHR0cHM6Ly9idWdzLmxhdW5jaHBhZC5uZXQvbm92YS8rYnVnLzE4OTIzNjE\u003d","commit_id":"b6fbe02585cf6cb9bf4e0d7afc1d446193a638b8"},{"author":{"_account_id":32171,"name":"Girish Chilukuri","email":"girish.chilukuri@ibm.com","username":"GirishChilukuri"},"change_message_id":"3494aa04a084274a88e7f7d42d3424e5d15aa586","unresolved":false,"context_lines":[{"line_number":9,"context_line":"    pci device type updates are detected and the pci stat pools are updated"},{"line_number":10,"context_line":"    properly."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"    .. _bug 1892361: https://bugs.launchpad.net/nova/+bug/1892361"}],"source_content_type":"text/x-yaml","patch_set":12,"id":"7f6b1bfe_8d05a77d","line":12,"range":{"start_line":12,"start_character":21,"end_line":12,"end_character":65},"in_reply_to":"7f6b1bfe_eaf52185","updated":"2020-10-14 12:02:38.000000000","message":"Looks Good.","commit_id":"b6fbe02585cf6cb9bf4e0d7afc1d446193a638b8"}]}
