)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"73fe2b7a9c671594f05e101dd7db3b6ecffdbfa5","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Update binding:profile for SR-IOV ports"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The libvirt driver relies on the network information for configuring the"},{"line_number":10,"context_line":"SR-IOV interfaces (binding:vnic_type\u003ddirect). The network information is"},{"line_number":11,"context_line":"specified when creating a Neutron port (binding:profile - which contain the"},{"line_number":12,"context_line":"PCI address of the device)."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":23,"id":"9abb7d3a_8f67b6e9","line":10,"range":{"start_line":10,"start_character":18,"end_line":10,"end_character":44},"updated":"2016-06-02 15:55:26.000000000","message":"this should fix migration to all SR-IOV port direct/macvtap/direct-physical","commit_id":"3ee779f77edf5f9929ef7864333cde78bef9615a"}],"nova/compute/manager.py":[{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"97db0f26b58f1e86022ea0d8923bc8c7e6d9c699","unresolved":false,"context_lines":[{"line_number":3940,"context_line":"                                                migration[\u0027dest_compute\u0027])"},{"line_number":3941,"context_line":""},{"line_number":3942,"context_line":"        migration_p \u003d obj_base.obj_to_primitive(migration)"},{"line_number":3943,"context_line":"        self.network_api.migrate_instance_finish(context,"},{"line_number":3944,"context_line":"                                                 instance,"},{"line_number":3945,"context_line":"                                                 migration_p)"},{"line_number":3946,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7af24918_15b4ea7f","line":3943,"range":{"start_line":3943,"start_character":25,"end_line":3943,"end_character":49},"updated":"2016-03-03 10:30:11.000000000","message":"Oddly enough the update happens here for resize... just making a comment...","commit_id":"b15b53ac95d0f8726d5da11e4dcd458545141d67"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"97db0f26b58f1e86022ea0d8923bc8c7e6d9c699","unresolved":false,"context_lines":[{"line_number":4345,"context_line":"        block_device_info \u003d self._prep_block_device(context, instance, bdms,"},{"line_number":4346,"context_line":"                                                    do_check_attach\u003dFalse)"},{"line_number":4347,"context_line":"        scrubbed_keys \u003d self._unshelve_instance_key_scrub(instance)"},{"line_number":4348,"context_line":""},{"line_number":4349,"context_line":"        if node is None:"},{"line_number":4350,"context_line":"            node \u003d self.driver.get_available_nodes()[0]"},{"line_number":4351,"context_line":"            LOG.debug(\u0027No node specified, defaulting to %s\u0027, node,"},{"line_number":4352,"context_line":"                      instance\u003dinstance)"},{"line_number":4353,"context_line":""},{"line_number":4354,"context_line":"        rt \u003d self._get_resource_tracker(node)"},{"line_number":4355,"context_line":"        limits \u003d filter_properties.get(\u0027limits\u0027, {})"}],"source_content_type":"text/x-python","patch_set":13,"id":"7af24918_c9e18900","line":4352,"range":{"start_line":4348,"start_character":0,"end_line":4352,"end_character":40},"updated":"2016-03-03 10:30:11.000000000","message":"here :(","commit_id":"b15b53ac95d0f8726d5da11e4dcd458545141d67"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"97db0f26b58f1e86022ea0d8923bc8c7e6d9c699","unresolved":false,"context_lines":[{"line_number":4365,"context_line":""},{"line_number":4366,"context_line":"        self.network_api.setup_instance_network_on_host(context, instance,"},{"line_number":4367,"context_line":"                                                        self.host,"},{"line_number":4368,"context_line":"                                                        instance.node)"},{"line_number":4369,"context_line":"        network_info \u003d self.network_api.get_instance_nw_info(context, instance)"},{"line_number":4370,"context_line":"        try:"},{"line_number":4371,"context_line":"            with rt.instance_claim(context, instance, limits):"}],"source_content_type":"text/x-python","patch_set":13,"id":"7af24918_c92a292c","line":4368,"range":{"start_line":4368,"start_character":56,"end_line":4368,"end_character":69},"updated":"2016-03-03 10:30:11.000000000","message":"So we can\u0027t use the instance node here I\u0027m afraid - that won\u0027t be properly set on the instance until the instance_claim call.\n\nWe do have the \"correct\" (*sobs*) node (see above) - we should pass that in instead.\n\nI think instance.node is None in case the instance was shelve-offloaded.","commit_id":"b15b53ac95d0f8726d5da11e4dcd458545141d67"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"ea5702e2d45006ccd83ae9a966b0366c2af96d03","unresolved":false,"context_lines":[{"line_number":4365,"context_line":""},{"line_number":4366,"context_line":"        self.network_api.setup_instance_network_on_host(context, instance,"},{"line_number":4367,"context_line":"                                                        self.host,"},{"line_number":4368,"context_line":"                                                        instance.node)"},{"line_number":4369,"context_line":"        network_info \u003d self.network_api.get_instance_nw_info(context, instance)"},{"line_number":4370,"context_line":"        try:"},{"line_number":4371,"context_line":"            with rt.instance_claim(context, instance, limits):"}],"source_content_type":"text/x-python","patch_set":13,"id":"7af24918_34cd96b7","line":4368,"range":{"start_line":4368,"start_character":56,"end_line":4368,"end_character":69},"in_reply_to":"7af24918_c92a292c","updated":"2016-03-03 15:34:29.000000000","message":"Good catch.  Thanks!","commit_id":"b15b53ac95d0f8726d5da11e4dcd458545141d67"}],"nova/compute/resource_tracker.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"094b79462e6459b110db08a92694cbeafac64191","unresolved":false,"context_lines":[{"line_number":774,"context_line":"                    migration)"},{"line_number":775,"context_line":"            numa_topology \u003d self._get_migration_context_resource("},{"line_number":776,"context_line":"                \u0027numa_topology\u0027, instance)"},{"line_number":777,"context_line":"            sign \u003d 1"},{"line_number":778,"context_line":""},{"line_number":779,"context_line":"        elif outbound and not record:"},{"line_number":780,"context_line":"            # instance migrated, but record usage for a possible revert:"}],"source_content_type":"text/x-python","patch_set":28,"id":"7aa08908_67869edc","line":777,"updated":"2016-06-11 15:34:03.000000000","message":"I have no idea what this is or why it\u0027s here, but shouldn\u0027t we have a unit test change for it to assert self.pci_tracker.update_pci_for_instance is called with it in this case?","commit_id":"acd5ab9f2b71cd4da779181a2c8298a83306a401"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"9bc11db7d154da4f908f9d00df37bbcabbfe897d","unresolved":false,"context_lines":[{"line_number":774,"context_line":"                    migration)"},{"line_number":775,"context_line":"            numa_topology \u003d self._get_migration_context_resource("},{"line_number":776,"context_line":"                \u0027numa_topology\u0027, instance)"},{"line_number":777,"context_line":"            sign \u003d 1"},{"line_number":778,"context_line":""},{"line_number":779,"context_line":"        elif outbound and not record:"},{"line_number":780,"context_line":"            # instance migrated, but record usage for a possible revert:"}],"source_content_type":"text/x-python","patch_set":28,"id":"7aa08908_4db623dd","line":777,"in_reply_to":"7aa08908_67869edc","updated":"2016-06-12 18:11:49.000000000","message":"This is related to allocating PCI devices (not just SRIOV) on migration.\n\nI will move out this change to a new patch.","commit_id":"acd5ab9f2b71cd4da779181a2c8298a83306a401"}],"nova/network/base_api.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"89c23941a8d5b68c4808c566f33a3e551ec2a1be","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        :param context: The request context."},{"line_number":338,"context_line":"        :param instance: nova.objects.instance.Instance object."},{"line_number":339,"context_line":"        :param host: The host which network should be setup for instance."},{"line_number":340,"context_line":"        :param host: The node which network should be setup for instance."},{"line_number":341,"context_line":"        \"\"\""},{"line_number":342,"context_line":"        raise NotImplementedError()"},{"line_number":343,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"3a57f1b5_f7760ad6","line":340,"range":{"start_line":340,"start_character":15,"end_line":340,"end_character":19},"updated":"2016-02-11 17:08:52.000000000","message":"nit: s/host/node/","commit_id":"23863dfa5ee6c8b04fa892c3c6d2257d4ac69738"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"84d32bb8323265dc25587486b4837c7a2d8cf787","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        :param context: The request context."},{"line_number":338,"context_line":"        :param instance: nova.objects.instance.Instance object."},{"line_number":339,"context_line":"        :param host: The host which network should be setup for instance."},{"line_number":340,"context_line":"        :param host: The node which network should be setup for instance."},{"line_number":341,"context_line":"        \"\"\""},{"line_number":342,"context_line":"        raise NotImplementedError()"},{"line_number":343,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"3a57f1b5_6306dc87","line":340,"range":{"start_line":340,"start_character":15,"end_line":340,"end_character":19},"in_reply_to":"3a57f1b5_f7760ad6","updated":"2016-02-11 18:43:57.000000000","message":"Done","commit_id":"23863dfa5ee6c8b04fa892c3c6d2257d4ac69738"}],"nova/network/neutronv2/api.py":[{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"b6e855455e054156d90810f3c2b12cc49211338e","unresolved":false,"context_lines":[{"line_number":1868,"context_line":"            # If the host hasn\u0027t changed, like in the case of resizing to the"},{"line_number":1869,"context_line":"            # same host, there is nothing to do."},{"line_number":1870,"context_line":"            if p.get(\u0027binding:host_id\u0027) !\u003d host:"},{"line_number":1871,"context_line":"                updates.update({\u0027binding:host_id\u0027: host})"},{"line_number":1872,"context_line":""},{"line_number":1873,"context_line":"            # Update PCI information for SR-IOV devices, correlate based"},{"line_number":1874,"context_line":"            # on PCI Request ID.  In the case of migration, the PCI"}],"source_content_type":"text/x-python","patch_set":2,"id":"da85f559_af585afb","line":1871,"updated":"2015-11-10 07:20:03.000000000","message":"why not \nupdates[\u0027binding:host_id\u0027]\u003dhost? ,  it is faster \n\nhttp://stackoverflow.com/questions/15456158/python-dict-update-vs-subscript-to-add-a-single-key-value-pair","commit_id":"8704ce7dcbb211ed099580549abd418592706155"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"8f158c4e032d60bc7a4d4bf8e388469a1e20c83d","unresolved":false,"context_lines":[{"line_number":1868,"context_line":"            # If the host hasn\u0027t changed, like in the case of resizing to the"},{"line_number":1869,"context_line":"            # same host, there is nothing to do."},{"line_number":1870,"context_line":"            if p.get(\u0027binding:host_id\u0027) !\u003d host:"},{"line_number":1871,"context_line":"                updates.update({\u0027binding:host_id\u0027: host})"},{"line_number":1872,"context_line":""},{"line_number":1873,"context_line":"            # Update PCI information for SR-IOV devices, correlate based"},{"line_number":1874,"context_line":"            # on PCI Request ID.  In the case of migration, the PCI"}],"source_content_type":"text/x-python","patch_set":2,"id":"da85f559_6c42e4af","line":1871,"in_reply_to":"da85f559_af585afb","updated":"2015-11-13 20:35:08.000000000","message":"Done","commit_id":"8704ce7dcbb211ed099580549abd418592706155"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"b6e855455e054156d90810f3c2b12cc49211338e","unresolved":false,"context_lines":[{"line_number":1876,"context_line":"            # the same pci_request_id.  So pick the one that was"},{"line_number":1877,"context_line":"            # allocated on this host."},{"line_number":1878,"context_line":"            vnic_type \u003d p.get(\u0027binding:vnic_type\u0027)"},{"line_number":1879,"context_line":"            if vnic_type \u003d\u003d network_model.VNIC_TYPE_DIRECT and compute:"},{"line_number":1880,"context_line":"                binding_profile \u003d p.get(\u0027binding:profile\u0027, {})"},{"line_number":1881,"context_line":"                pci_request_id \u003d binding_profile.get(\u0027pci_request_id\u0027)"},{"line_number":1882,"context_line":"                pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"}],"source_content_type":"text/x-python","patch_set":2,"id":"da85f559_8fc0f67d","line":1879,"updated":"2015-11-10 07:20:03.000000000","message":"pci request is created if the port_type is not NORMAL (MACVTAP and DIRECT) \nwhich I guess will introduce a bug when more vnic_types will be added https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L1069\n\nanyway I think you should check also vnic_type MACVTAP  as will.","commit_id":"8704ce7dcbb211ed099580549abd418592706155"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"8f158c4e032d60bc7a4d4bf8e388469a1e20c83d","unresolved":false,"context_lines":[{"line_number":1876,"context_line":"            # the same pci_request_id.  So pick the one that was"},{"line_number":1877,"context_line":"            # allocated on this host."},{"line_number":1878,"context_line":"            vnic_type \u003d p.get(\u0027binding:vnic_type\u0027)"},{"line_number":1879,"context_line":"            if vnic_type \u003d\u003d network_model.VNIC_TYPE_DIRECT and compute:"},{"line_number":1880,"context_line":"                binding_profile \u003d p.get(\u0027binding:profile\u0027, {})"},{"line_number":1881,"context_line":"                pci_request_id \u003d binding_profile.get(\u0027pci_request_id\u0027)"},{"line_number":1882,"context_line":"                pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"}],"source_content_type":"text/x-python","patch_set":2,"id":"da85f559_2c485ccb","line":1879,"in_reply_to":"da85f559_8fc0f67d","updated":"2015-11-13 20:35:08.000000000","message":"Done","commit_id":"8704ce7dcbb211ed099580549abd418592706155"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"b6e855455e054156d90810f3c2b12cc49211338e","unresolved":false,"context_lines":[{"line_number":1887,"context_line":"                if not pci_dev:"},{"line_number":1888,"context_line":"                    raise exception.PortUpdateFailed(port_id\u003dp[\u0027id\u0027],"},{"line_number":1889,"context_line":"                        reason\u003d_(\"Unable to correlate PCI request ID %s\") %"},{"line_number":1890,"context_line":"                                 pci_request_id)"},{"line_number":1891,"context_line":""},{"line_number":1892,"context_line":"                devspec \u003d pci_whitelist.get_pci_device_devspec(pci_dev)"},{"line_number":1893,"context_line":"                if devspec:"}],"source_content_type":"text/x-python","patch_set":2,"id":"da85f559_0fcba61f","line":1890,"updated":"2015-11-10 07:20:03.000000000","message":"so if the use user configure the Pci Passthrough filter you should not  get to here, and if he doesn\u0027t it maybe we should change the port to be NORMAL as the scheduler is not restricting PCI filtering. It is just a thought","commit_id":"8704ce7dcbb211ed099580549abd418592706155"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"b6e855455e054156d90810f3c2b12cc49211338e","unresolved":false,"context_lines":[{"line_number":1898,"context_line":"                        \u0027physical_network\u0027:"},{"line_number":1899,"context_line":"                            devspec.get_tags().get(\u0027physical_network\u0027),"},{"line_number":1900,"context_line":"                        \u0027pci_request_id\u0027: pci_dev.request_id}"},{"line_number":1901,"context_line":"                    updates.update({\u0027binding:profile\u0027: profile})"},{"line_number":1902,"context_line":"                else:"},{"line_number":1903,"context_line":"                    raise exception.PciDeviceNotFound("},{"line_number":1904,"context_line":"                        node_id\u003dpci_dev.compute_node_id,"}],"source_content_type":"text/x-python","patch_set":2,"id":"da85f559_6f55924e","line":1901,"updated":"2015-11-10 07:20:03.000000000","message":"same comment as above for using [] operator instead of update","commit_id":"8704ce7dcbb211ed099580549abd418592706155"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"8f158c4e032d60bc7a4d4bf8e388469a1e20c83d","unresolved":false,"context_lines":[{"line_number":1898,"context_line":"                        \u0027physical_network\u0027:"},{"line_number":1899,"context_line":"                            devspec.get_tags().get(\u0027physical_network\u0027),"},{"line_number":1900,"context_line":"                        \u0027pci_request_id\u0027: pci_dev.request_id}"},{"line_number":1901,"context_line":"                    updates.update({\u0027binding:profile\u0027: profile})"},{"line_number":1902,"context_line":"                else:"},{"line_number":1903,"context_line":"                    raise exception.PciDeviceNotFound("},{"line_number":1904,"context_line":"                        node_id\u003dpci_dev.compute_node_id,"}],"source_content_type":"text/x-python","patch_set":2,"id":"da85f559_6c2984e5","line":1901,"in_reply_to":"da85f559_6f55924e","updated":"2015-11-13 20:35:08.000000000","message":"Done","commit_id":"8704ce7dcbb211ed099580549abd418592706155"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"1459269abd0f097c32f2004ba0b0a5b9b51ebf30","unresolved":false,"context_lines":[{"line_number":1839,"context_line":"        pass"},{"line_number":1840,"context_line":""},{"line_number":1841,"context_line":"    def _update_port_binding_for_instance(self, context, instance, host):"},{"line_number":1842,"context_line":"        def get_pci_device(pci_devs, pci_request_id, compute_id):"},{"line_number":1843,"context_line":"            for pci_dev in pci_devs:"},{"line_number":1844,"context_line":"                if (pci_dev.request_id \u003d\u003d pci_request_id and"},{"line_number":1845,"context_line":"                    pci_dev.compute_node_id \u003d\u003d compute_id):"},{"line_number":1846,"context_line":"                    return pci_dev"},{"line_number":1847,"context_line":"            return None"},{"line_number":1848,"context_line":""},{"line_number":1849,"context_line":"        # Host is None during shelves."},{"line_number":1850,"context_line":"        compute \u003d None"}],"source_content_type":"text/x-python","patch_set":4,"id":"da85f559_0bb3de0b","line":1847,"range":{"start_line":1842,"start_character":8,"end_line":1847,"end_character":23},"updated":"2015-11-13 08:39:54.000000000","message":"This kind of logic should really not be inlined here like that. It should go to the pci_manager or even better to the Instance object class.","commit_id":"f812aa01490f2b09e52a897deac9765ffaacd54c"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"ef051815a8be462a18541de8a5904d2822a7eb3c","unresolved":false,"context_lines":[{"line_number":1844,"context_line":"                if (pci_dev.request_id \u003d\u003d pci_request_id and"},{"line_number":1845,"context_line":"                    pci_dev.compute_node_id \u003d\u003d compute_id):"},{"line_number":1846,"context_line":"                    return pci_dev"},{"line_number":1847,"context_line":"            return None"},{"line_number":1848,"context_line":""},{"line_number":1849,"context_line":"        # Host is None during shelves."},{"line_number":1850,"context_line":"        compute \u003d None"}],"source_content_type":"text/x-python","patch_set":4,"id":"da85f559_b3bea9d2","line":1847,"in_reply_to":"da85f559_0bb3de0b","updated":"2015-11-13 20:34:51.000000000","message":"Done","commit_id":"f812aa01490f2b09e52a897deac9765ffaacd54c"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"1459269abd0f097c32f2004ba0b0a5b9b51ebf30","unresolved":false,"context_lines":[{"line_number":1891,"context_line":"                                 pci_request_id)"},{"line_number":1892,"context_line":""},{"line_number":1893,"context_line":"                devspec \u003d pci_whitelist.get_pci_device_devspec(pci_dev)"},{"line_number":1894,"context_line":"                if devspec:"},{"line_number":1895,"context_line":"                    profile \u003d {"},{"line_number":1896,"context_line":"                        \u0027pci_vendor_info\u0027: \"%s:%s\" %"},{"line_number":1897,"context_line":"                            (pci_dev.vendor_id, pci_dev.product_id),"},{"line_number":1898,"context_line":"                        \u0027pci_slot\u0027: pci_dev.address,"},{"line_number":1899,"context_line":"                        \u0027physical_network\u0027:"},{"line_number":1900,"context_line":"                            devspec.get_tags().get(\u0027physical_network\u0027),"},{"line_number":1901,"context_line":"                        \u0027pci_request_id\u0027: pci_dev.request_id}"},{"line_number":1902,"context_line":"                    updates[\u0027binding:profile\u0027] \u003d profile"},{"line_number":1903,"context_line":"                else:"},{"line_number":1904,"context_line":"                    raise exception.PciDeviceNotFound("},{"line_number":1905,"context_line":"                        node_id\u003dpci_dev.compute_node_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"da85f559_ebf45a88","line":1902,"range":{"start_line":1894,"start_character":15,"end_line":1902,"end_character":56},"updated":"2015-11-13 08:39:54.000000000","message":"This logic also seems quite strange inlined like this. We must have this logic somewhere already on the boot instance path. Can\u0027t we make it a bit more reusable?","commit_id":"f812aa01490f2b09e52a897deac9765ffaacd54c"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"ef051815a8be462a18541de8a5904d2822a7eb3c","unresolved":false,"context_lines":[{"line_number":1899,"context_line":"                        \u0027physical_network\u0027:"},{"line_number":1900,"context_line":"                            devspec.get_tags().get(\u0027physical_network\u0027),"},{"line_number":1901,"context_line":"                        \u0027pci_request_id\u0027: pci_dev.request_id}"},{"line_number":1902,"context_line":"                    updates[\u0027binding:profile\u0027] \u003d profile"},{"line_number":1903,"context_line":"                else:"},{"line_number":1904,"context_line":"                    raise exception.PciDeviceNotFound("},{"line_number":1905,"context_line":"                        node_id\u003dpci_dev.compute_node_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"da85f559_13ce9583","line":1902,"in_reply_to":"da85f559_ebf45a88","updated":"2015-11-13 20:34:51.000000000","message":"Done","commit_id":"f812aa01490f2b09e52a897deac9765ffaacd54c"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"6327b5fa203f4eaa33379f132ea9ea9707bc7a24","unresolved":false,"context_lines":[{"line_number":768,"context_line":"        if pci_request_id:"},{"line_number":769,"context_line":"            pci_dev \u003d pci_manager.get_instance_pci_devs("},{"line_number":770,"context_line":"                instance, pci_request_id).pop()"},{"line_number":771,"context_line":"            profile \u003d pci_whitelist.get_pci_device_profile(pci_dev)"},{"line_number":772,"context_line":"            if not profile:"},{"line_number":773,"context_line":"                raise exception.PciDeviceNotFound("},{"line_number":774,"context_line":"                    node_id\u003dpci_dev.compute_node_id,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da85f559_cff29906","line":771,"updated":"2015-11-13 23:39:56.000000000","message":"why not throw the exception in the pci_whitelist.get_pci_device_profile? \nthis will reduce the duplicate code in line 1886-1890","commit_id":"77587a616f4bbb9f40418dd6b4b230257a752f27"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"ebf4b0d7f3b846b3ae5fbd4bbf8fcbaaa88a6a05","unresolved":false,"context_lines":[{"line_number":768,"context_line":"        if pci_request_id:"},{"line_number":769,"context_line":"            pci_dev \u003d pci_manager.get_instance_pci_devs("},{"line_number":770,"context_line":"                instance, pci_request_id).pop()"},{"line_number":771,"context_line":"            profile \u003d pci_whitelist.get_pci_device_profile(pci_dev)"},{"line_number":772,"context_line":"            if not profile:"},{"line_number":773,"context_line":"                raise exception.PciDeviceNotFound("},{"line_number":774,"context_line":"                    node_id\u003dpci_dev.compute_node_id,"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_dc5ccaef","line":771,"in_reply_to":"da85f559_cff29906","updated":"2015-11-16 14:07:30.000000000","message":"Good point.","commit_id":"77587a616f4bbb9f40418dd6b4b230257a752f27"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"9289742dafe4202504c5536b13a2b9e69175eccc","unresolved":false,"context_lines":[{"line_number":1856,"context_line":"            updates \u003d {}"},{"line_number":1857,"context_line":""},{"line_number":1858,"context_line":"            # If the host hasn\u0027t changed, like in the case of resizing to the"},{"line_number":1859,"context_line":"            # same host, there is nothing to do."},{"line_number":1860,"context_line":"            if p.get(\u0027binding:host_id\u0027) !\u003d host:"},{"line_number":1861,"context_line":"                updates[\u0027binding:host_id\u0027] \u003d host"},{"line_number":1862,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ba8a016a_9dfefd69","line":1859,"updated":"2015-11-17 15:30:55.000000000","message":"comments should be updated","commit_id":"89c38393a626ae035e6bfcb841637de175819cc7"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"fb5296437e30111e71f1bd677ee4c649898b644f","unresolved":false,"context_lines":[{"line_number":1856,"context_line":"            updates \u003d {}"},{"line_number":1857,"context_line":""},{"line_number":1858,"context_line":"            # If the host hasn\u0027t changed, like in the case of resizing to the"},{"line_number":1859,"context_line":"            # same host, there is nothing to do."},{"line_number":1860,"context_line":"            if p.get(\u0027binding:host_id\u0027) !\u003d host:"},{"line_number":1861,"context_line":"                updates[\u0027binding:host_id\u0027] \u003d host"},{"line_number":1862,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ba8a016a_b06c8dd1","line":1859,"in_reply_to":"ba8a016a_04e1a6d0","updated":"2015-11-22 22:12:48.000000000","message":"Good point.  I\u0027m going to fix that.","commit_id":"89c38393a626ae035e6bfcb841637de175819cc7"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"761196e804a174f0564e881c4f4309963923a89a","unresolved":false,"context_lines":[{"line_number":1856,"context_line":"            updates \u003d {}"},{"line_number":1857,"context_line":""},{"line_number":1858,"context_line":"            # If the host hasn\u0027t changed, like in the case of resizing to the"},{"line_number":1859,"context_line":"            # same host, there is nothing to do."},{"line_number":1860,"context_line":"            if p.get(\u0027binding:host_id\u0027) !\u003d host:"},{"line_number":1861,"context_line":"                updates[\u0027binding:host_id\u0027] \u003d host"},{"line_number":1862,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ba8a016a_04e1a6d0","line":1859,"in_reply_to":"ba8a016a_5611c702","updated":"2015-11-20 11:37:34.000000000","message":"your comment in L1856-1857 is saying that \nif host hasn\u0027t changed  there is nothing to do\nso why  L1863-L1883 is not under the if in L1860?","commit_id":"89c38393a626ae035e6bfcb841637de175819cc7"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"374b944acc258d9276bd8520eb561fc04774bf68","unresolved":false,"context_lines":[{"line_number":1856,"context_line":"            updates \u003d {}"},{"line_number":1857,"context_line":""},{"line_number":1858,"context_line":"            # If the host hasn\u0027t changed, like in the case of resizing to the"},{"line_number":1859,"context_line":"            # same host, there is nothing to do."},{"line_number":1860,"context_line":"            if p.get(\u0027binding:host_id\u0027) !\u003d host:"},{"line_number":1861,"context_line":"                updates[\u0027binding:host_id\u0027] \u003d host"},{"line_number":1862,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ba8a016a_5611c702","line":1859,"in_reply_to":"ba8a016a_9dfefd69","updated":"2015-11-19 18:58:31.000000000","message":"This small block of code hasn\u0027t changed and is not related to this patch.  Not sure I understand how you would like me to change the comment ?","commit_id":"89c38393a626ae035e6bfcb841637de175819cc7"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"9289742dafe4202504c5536b13a2b9e69175eccc","unresolved":false,"context_lines":[{"line_number":1869,"context_line":"            if (compute and vnic_type in [network_model.VNIC_TYPE_DIRECT,"},{"line_number":1870,"context_line":"                                          network_model.VNIC_TYPE_MACVTAP]):"},{"line_number":1871,"context_line":"                binding_profile \u003d p.get(\u0027binding:profile\u0027, {})"},{"line_number":1872,"context_line":"                pci_request_id \u003d binding_profile.get(\u0027pci_request_id\u0027)"},{"line_number":1873,"context_line":"                pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"},{"line_number":1874,"context_line":"                                                             pci_request_id,"},{"line_number":1875,"context_line":"                                                             compute.id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba8a016a_ddb6c5db","line":1872,"updated":"2015-11-17 15:30:55.000000000","message":"is pci_request_id part of the binding profile now? I don\u0027t recall that\u0027s the case unless it\u0027s done in a different patch","commit_id":"89c38393a626ae035e6bfcb841637de175819cc7"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"b52d96248267f590ec27df096b34f04776284868","unresolved":false,"context_lines":[{"line_number":1869,"context_line":"            if (compute and vnic_type in [network_model.VNIC_TYPE_DIRECT,"},{"line_number":1870,"context_line":"                                          network_model.VNIC_TYPE_MACVTAP]):"},{"line_number":1871,"context_line":"                binding_profile \u003d p.get(\u0027binding:profile\u0027, {})"},{"line_number":1872,"context_line":"                pci_request_id \u003d binding_profile.get(\u0027pci_request_id\u0027)"},{"line_number":1873,"context_line":"                pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"},{"line_number":1874,"context_line":"                                                             pci_request_id,"},{"line_number":1875,"context_line":"                                                             compute.id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a8ffd7b_9ea00ea1","line":1872,"in_reply_to":"9a8ffd7b_df60f937","updated":"2015-11-26 06:53:52.000000000","message":"neutron uses the pci_slot in the SR-IOV agent","commit_id":"89c38393a626ae035e6bfcb841637de175819cc7"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"ba840425dc42e28daba024ac5864492946d1a8a5","unresolved":false,"context_lines":[{"line_number":1869,"context_line":"            if (compute and vnic_type in [network_model.VNIC_TYPE_DIRECT,"},{"line_number":1870,"context_line":"                                          network_model.VNIC_TYPE_MACVTAP]):"},{"line_number":1871,"context_line":"                binding_profile \u003d p.get(\u0027binding:profile\u0027, {})"},{"line_number":1872,"context_line":"                pci_request_id \u003d binding_profile.get(\u0027pci_request_id\u0027)"},{"line_number":1873,"context_line":"                pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"},{"line_number":1874,"context_line":"                                                             pci_request_id,"},{"line_number":1875,"context_line":"                                                             compute.id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a8ffd7b_df60f937","line":1872,"in_reply_to":"ba8a016a_166c9f33","updated":"2015-11-25 15:05:34.000000000","message":"Baoli, I had a closer look at the BP.\n\nI agree that we need to align as much as possible the support of live migration and cold migration for SR-IOV NICs.\n\nI think the only outstanding question here is how to correlate a PCI device with the neutron port:\n\n1) I\u0027m proposing to extend the binding:profile with pci_request_id.  Since the binding:profile is an opaque dictionary, it shouldn\u0027t have an impact of storing some more information in there (at least I haven\u0027t found any yet).  There might only be a small overhead to pass those extra characters in the neutron REST API call/response.\n\n2) You are proposing to use the neutron port id and use it for the pci_request_id.  The good thing about it is that there is no change with the binding:profile.  But I feel that both object are distinct and should maybe have their own unique ID.\n\nI guess both methods are reasonable.  We just need to pick one for consistency.\n\nFor sure, I think there is a discussion that need to take place about long term interaction with neutron.  Some information like the pci_slot is stored in the neutron port even if neutron doesn\u0027t really care about it - neutron shouldn\u0027t be a placeholder for nova\u0027s data (I guess the only think it cares about is the product/vendor ID for the sriov mech driver).\n\nAlso, I like the idea of using the _new flag for distinguishing between PCI device allocated on the incoming compute versus on the migrated compute.  I propose that when this is in place, we modify the code here (and elsewhere) to support it for cold migration as well.","commit_id":"89c38393a626ae035e6bfcb841637de175819cc7"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"9bde3bf6a548ec20130fa9bf53e661d7e5efce58","unresolved":false,"context_lines":[{"line_number":1869,"context_line":"            if (compute and vnic_type in [network_model.VNIC_TYPE_DIRECT,"},{"line_number":1870,"context_line":"                                          network_model.VNIC_TYPE_MACVTAP]):"},{"line_number":1871,"context_line":"                binding_profile \u003d p.get(\u0027binding:profile\u0027, {})"},{"line_number":1872,"context_line":"                pci_request_id \u003d binding_profile.get(\u0027pci_request_id\u0027)"},{"line_number":1873,"context_line":"                pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"},{"line_number":1874,"context_line":"                                                             pci_request_id,"},{"line_number":1875,"context_line":"                                                             compute.id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba8a016a_56103959","line":1872,"in_reply_to":"ba8a016a_405c05ed","updated":"2015-11-18 14:14:37.000000000","message":"Got it. Thanks!\n\nI didn\u0027t track down the cold migration process. So I\u0027m not quite sure saving the pi_request_id in the binding profile would solve the issue in various migration cases: resize, cold or live migrate, etc. The original sriov design didn\u0027t choose to save the pci request id as part of the binding profile.\n\nBy the way, I did track it down for live migration. refer to https://review.openstack.org/#/c/136077/. It dealt with pci request id with a different approach for live migration.","commit_id":"89c38393a626ae035e6bfcb841637de175819cc7"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"374b944acc258d9276bd8520eb561fc04774bf68","unresolved":false,"context_lines":[{"line_number":1869,"context_line":"            if (compute and vnic_type in [network_model.VNIC_TYPE_DIRECT,"},{"line_number":1870,"context_line":"                                          network_model.VNIC_TYPE_MACVTAP]):"},{"line_number":1871,"context_line":"                binding_profile \u003d p.get(\u0027binding:profile\u0027, {})"},{"line_number":1872,"context_line":"                pci_request_id \u003d binding_profile.get(\u0027pci_request_id\u0027)"},{"line_number":1873,"context_line":"                pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"},{"line_number":1874,"context_line":"                                                             pci_request_id,"},{"line_number":1875,"context_line":"                                                             compute.id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba8a016a_166c9f33","line":1872,"in_reply_to":"ba8a016a_56103959","updated":"2015-11-19 18:58:31.000000000","message":"Moshe is right, the pci_request_id is used to correlate the newly claimed PCI Device with the Neutron port.","commit_id":"89c38393a626ae035e6bfcb841637de175819cc7"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"ff255a319c7158cbde16e6726fe791b1e6fcaa5f","unresolved":false,"context_lines":[{"line_number":1869,"context_line":"            if (compute and vnic_type in [network_model.VNIC_TYPE_DIRECT,"},{"line_number":1870,"context_line":"                                          network_model.VNIC_TYPE_MACVTAP]):"},{"line_number":1871,"context_line":"                binding_profile \u003d p.get(\u0027binding:profile\u0027, {})"},{"line_number":1872,"context_line":"                pci_request_id \u003d binding_profile.get(\u0027pci_request_id\u0027)"},{"line_number":1873,"context_line":"                pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"},{"line_number":1874,"context_line":"                                                             pci_request_id,"},{"line_number":1875,"context_line":"                                                             compute.id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba8a016a_405c05ed","line":1872,"in_reply_to":"ba8a016a_ddb6c5db","updated":"2015-11-18 07:04:08.000000000","message":"He update the code to send also the  pci_request_id  in the profile see  L122 in whitelist.py and L771 in this file","commit_id":"89c38393a626ae035e6bfcb841637de175819cc7"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b4ccb35480ee6bc1ed7a2a23006bac5397ecf5a4","unresolved":false,"context_lines":[{"line_number":264,"context_line":"                \u0027pci_request_id\u0027: pci_dev.request_id}"},{"line_number":265,"context_line":"    else:"},{"line_number":266,"context_line":"        raise exception.PciDeviceNotFound(node_id\u003dpci_dev.compute_node_id,"},{"line_number":267,"context_line":"                                      address\u003dpci_dev.address)"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"class API(base_api.NetworkAPI):"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba8a016a_0d7e7bae","line":267,"updated":"2015-11-22 09:04:07.000000000","message":"indentation here is dodgy","commit_id":"7158818c39c487346c960c254ab799c7b01a6b5d"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"dc0f00c153fa2d5fce9f00e6b366b6cf6f1367d2","unresolved":false,"context_lines":[{"line_number":264,"context_line":"                \u0027pci_request_id\u0027: pci_dev.request_id}"},{"line_number":265,"context_line":"    else:"},{"line_number":266,"context_line":"        raise exception.PciDeviceNotFound(node_id\u003dpci_dev.compute_node_id,"},{"line_number":267,"context_line":"                                      address\u003dpci_dev.address)"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"class API(base_api.NetworkAPI):"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba8a016a_dba90626","line":267,"in_reply_to":"ba8a016a_0d7e7bae","updated":"2015-11-22 22:12:29.000000000","message":"Done","commit_id":"7158818c39c487346c960c254ab799c7b01a6b5d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b4ccb35480ee6bc1ed7a2a23006bac5397ecf5a4","unresolved":false,"context_lines":[{"line_number":1850,"context_line":"        pass"},{"line_number":1851,"context_line":""},{"line_number":1852,"context_line":"    def _update_port_binding_for_instance(self, context, instance, host):"},{"line_number":1853,"context_line":"        # Host is None during shelves."},{"line_number":1854,"context_line":"        compute \u003d None"},{"line_number":1855,"context_line":"        if instance.host:"},{"line_number":1856,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba8a016a_4d5b2355","line":1853,"updated":"2015-11-22 09:04:07.000000000","message":"1853 - 1860 should be called after _has_port_binding_extension\n\nIt may also be worthwhile having it as a helper method - then you can test it","commit_id":"7158818c39c487346c960c254ab799c7b01a6b5d"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"dc0f00c153fa2d5fce9f00e6b366b6cf6f1367d2","unresolved":false,"context_lines":[{"line_number":1850,"context_line":"        pass"},{"line_number":1851,"context_line":""},{"line_number":1852,"context_line":"    def _update_port_binding_for_instance(self, context, instance, host):"},{"line_number":1853,"context_line":"        # Host is None during shelves."},{"line_number":1854,"context_line":"        compute \u003d None"},{"line_number":1855,"context_line":"        if instance.host:"},{"line_number":1856,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba8a016a_fba64a52","line":1853,"in_reply_to":"ba8a016a_4d5b2355","updated":"2015-11-22 22:12:29.000000000","message":"Done","commit_id":"7158818c39c487346c960c254ab799c7b01a6b5d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b4ccb35480ee6bc1ed7a2a23006bac5397ecf5a4","unresolved":false,"context_lines":[{"line_number":1899,"context_line":"            if updates:"},{"line_number":1900,"context_line":"                LOG.info(_LI(\"Updating port %(port)s with \""},{"line_number":1901,"context_line":"                             \"attributes %(attributes)s\"),"},{"line_number":1902,"context_line":"                         {\"port\": p[\u0027id\u0027], \"attributes\": updates})"},{"line_number":1903,"context_line":"                try:"},{"line_number":1904,"context_line":"                    neutron.update_port(p[\u0027id\u0027], {\u0027port\u0027: updates})"},{"line_number":1905,"context_line":"                except Exception:"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba8a016a_ed577724","line":1902,"updated":"2015-11-22 09:04:07.000000000","message":"please add instance\u003dinstance here","commit_id":"7158818c39c487346c960c254ab799c7b01a6b5d"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"dc0f00c153fa2d5fce9f00e6b366b6cf6f1367d2","unresolved":false,"context_lines":[{"line_number":1899,"context_line":"            if updates:"},{"line_number":1900,"context_line":"                LOG.info(_LI(\"Updating port %(port)s with \""},{"line_number":1901,"context_line":"                             \"attributes %(attributes)s\"),"},{"line_number":1902,"context_line":"                         {\"port\": p[\u0027id\u0027], \"attributes\": updates})"},{"line_number":1903,"context_line":"                try:"},{"line_number":1904,"context_line":"                    neutron.update_port(p[\u0027id\u0027], {\u0027port\u0027: updates})"},{"line_number":1905,"context_line":"                except Exception:"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba8a016a_bb676224","line":1902,"in_reply_to":"ba8a016a_ed577724","updated":"2015-11-22 22:12:29.000000000","message":"Done","commit_id":"7158818c39c487346c960c254ab799c7b01a6b5d"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"a6bef42dbe289856371b06b86e18edf6a1edcbe1","unresolved":false,"context_lines":[{"line_number":1884,"context_line":"                # allocated on this host."},{"line_number":1885,"context_line":"                vnic_type \u003d p.get(\u0027binding:vnic_type\u0027)"},{"line_number":1886,"context_line":"                if (compute and vnic_type in [network_model.VNIC_TYPE_DIRECT,"},{"line_number":1887,"context_line":"                                          network_model.VNIC_TYPE_MACVTAP]):"},{"line_number":1888,"context_line":"                    binding_profile \u003d p.get(\u0027binding:profile\u0027, {})"},{"line_number":1889,"context_line":"                    pci_request_id \u003d binding_profile.get(\u0027pci_request_id\u0027)"},{"line_number":1890,"context_line":"                    pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a8ffd7b_6a251207","line":1887,"updated":"2015-11-27 17:55:27.000000000","message":"now you can use VNIC_TYPES_SRIOV  for the check\nhttps://github.com/openstack/nova/blob/master/nova/network/model.py#L90","commit_id":"5988f5fed3bab929a63542dffc0573fe9b842f03"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"4190e9ac80cd742d764d0734f66fd14ad78a465a","unresolved":false,"context_lines":[{"line_number":1884,"context_line":"                # allocated on this host."},{"line_number":1885,"context_line":"                vnic_type \u003d p.get(\u0027binding:vnic_type\u0027)"},{"line_number":1886,"context_line":"                if (compute and vnic_type in [network_model.VNIC_TYPE_DIRECT,"},{"line_number":1887,"context_line":"                                          network_model.VNIC_TYPE_MACVTAP]):"},{"line_number":1888,"context_line":"                    binding_profile \u003d p.get(\u0027binding:profile\u0027, {})"},{"line_number":1889,"context_line":"                    pci_request_id \u003d binding_profile.get(\u0027pci_request_id\u0027)"},{"line_number":1890,"context_line":"                    pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a740942_bbf065ff","line":1887,"in_reply_to":"9a8ffd7b_6a251207","updated":"2015-12-07 17:32:08.000000000","message":"Done","commit_id":"5988f5fed3bab929a63542dffc0573fe9b842f03"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"96d5ef815a5f70b65efed0e1568942b3a31c2a41","unresolved":false,"context_lines":[{"line_number":1867,"context_line":"    def _update_port_binding_for_instance(self, context, instance, host):"},{"line_number":1868,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":1869,"context_line":"            return"},{"line_number":1870,"context_line":"        compute \u003d self._get_by_host_and_nodename(context, instance)"},{"line_number":1871,"context_line":"        neutron \u003d get_client(context, admin\u003dTrue)"},{"line_number":1872,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":1873,"context_line":"                       \u0027tenant_id\u0027: instance.project_id}"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa69d971_0abcb7da","line":1870,"range":{"start_line":1870,"start_character":8,"end_line":1870,"end_character":67},"updated":"2016-01-05 15:27:23.000000000","message":"Why do we need to do this if we have the host passed in, we really should not make assumptions here at what point the destination host is set on the instance (as it influences resource tracking quite a bit).\n\nThis code is run on the compute manager always so we have this info and can pass it in.","commit_id":"030e48cff0366ff90d0cb40f75753cb0fb6863b0"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"7cf85c8a5bf29052c054ae945f4430d23deba5a1","unresolved":false,"context_lines":[{"line_number":1867,"context_line":"    def _update_port_binding_for_instance(self, context, instance, host):"},{"line_number":1868,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":1869,"context_line":"            return"},{"line_number":1870,"context_line":"        compute \u003d self._get_by_host_and_nodename(context, instance)"},{"line_number":1871,"context_line":"        neutron \u003d get_client(context, admin\u003dTrue)"},{"line_number":1872,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":1873,"context_line":"                       \u0027tenant_id\u0027: instance.project_id}"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a57f1b5_b95f7c0d","line":1870,"range":{"start_line":1870,"start_character":8,"end_line":1870,"end_character":67},"in_reply_to":"3a57f1b5_b66566e2","updated":"2016-02-10 13:06:14.000000000","message":"It seems like 1 is what we do in other places so probably go with that?","commit_id":"030e48cff0366ff90d0cb40f75753cb0fb6863b0"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"535219517bfb52172ec44783663af1cab88ded10","unresolved":false,"context_lines":[{"line_number":1867,"context_line":"    def _update_port_binding_for_instance(self, context, instance, host):"},{"line_number":1868,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":1869,"context_line":"            return"},{"line_number":1870,"context_line":"        compute \u003d self._get_by_host_and_nodename(context, instance)"},{"line_number":1871,"context_line":"        neutron \u003d get_client(context, admin\u003dTrue)"},{"line_number":1872,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":1873,"context_line":"                       \u0027tenant_id\u0027: instance.project_id}"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a57f1b5_0735e6f5","line":1870,"range":{"start_line":1870,"start_character":8,"end_line":1870,"end_character":67},"in_reply_to":"3a57f1b5_b95f7c0d","updated":"2016-02-11 00:05:34.000000000","message":"Done","commit_id":"030e48cff0366ff90d0cb40f75753cb0fb6863b0"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"bbe24204c9c918f879c28265a59e6cc7780816ad","unresolved":false,"context_lines":[{"line_number":1867,"context_line":"    def _update_port_binding_for_instance(self, context, instance, host):"},{"line_number":1868,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":1869,"context_line":"            return"},{"line_number":1870,"context_line":"        compute \u003d self._get_by_host_and_nodename(context, instance)"},{"line_number":1871,"context_line":"        neutron \u003d get_client(context, admin\u003dTrue)"},{"line_number":1872,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":1873,"context_line":"                       \u0027tenant_id\u0027: instance.project_id}"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a57f1b5_b66566e2","line":1870,"range":{"start_line":1870,"start_character":8,"end_line":1870,"end_character":67},"in_reply_to":"fa69d971_0abcb7da","updated":"2016-02-09 22:42:36.000000000","message":"Good point.\n\nI need to get the corresponding node ID so that I can compare it with the PCI devices (compute_node_id).\nThere are two solutions:\n1) Pass a new node argument in the function.  Then I can resolve the node ID by calling ComputeNode.get_by_host_and_nodename().\n2) Add a new host field in the PciDevice object so that we can compare the host that is being passed here directly with the PCI device without doing an extra database call.\n\nDo you have a preference ?","commit_id":"030e48cff0366ff90d0cb40f75753cb0fb6863b0"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"96d5ef815a5f70b65efed0e1568942b3a31c2a41","unresolved":false,"context_lines":[{"line_number":1893,"context_line":"                    pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"},{"line_number":1894,"context_line":"                                                             pci_request_id,"},{"line_number":1895,"context_line":"                                                             compute.id)"},{"line_number":1896,"context_line":"                    if not pci_devs or len(pci_devs) \u003e 1:"},{"line_number":1897,"context_line":"                        raise exception.PortUpdateFailed(port_id\u003dp[\u0027id\u0027],"},{"line_number":1898,"context_line":"                            reason\u003d_(\"Unable to correlate PCI request ID %s\") %"},{"line_number":1899,"context_line":"                                     pci_request_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa69d971_597cd3b4","line":1896,"range":{"start_line":1896,"start_character":39,"end_line":1896,"end_character":56},"updated":"2016-01-05 15:27:23.000000000","message":"So I really don\u0027t like this. Having more than one device with the same request_id is totally possible, it just never happens with Neutron ports (at the moment!). Having a blanket check like this is bad - it would be better to hide some of that stuff in the get_ method or something like that where we are explicit about what is happening.","commit_id":"030e48cff0366ff90d0cb40f75753cb0fb6863b0"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"535219517bfb52172ec44783663af1cab88ded10","unresolved":false,"context_lines":[{"line_number":1893,"context_line":"                    pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"},{"line_number":1894,"context_line":"                                                             pci_request_id,"},{"line_number":1895,"context_line":"                                                             compute.id)"},{"line_number":1896,"context_line":"                    if not pci_devs or len(pci_devs) \u003e 1:"},{"line_number":1897,"context_line":"                        raise exception.PortUpdateFailed(port_id\u003dp[\u0027id\u0027],"},{"line_number":1898,"context_line":"                            reason\u003d_(\"Unable to correlate PCI request ID %s\") %"},{"line_number":1899,"context_line":"                                     pci_request_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a57f1b5_a73bb2ea","line":1896,"range":{"start_line":1896,"start_character":39,"end_line":1896,"end_character":56},"in_reply_to":"3a57f1b5_195810fa","updated":"2016-02-11 00:05:34.000000000","message":"Done","commit_id":"030e48cff0366ff90d0cb40f75753cb0fb6863b0"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"7cf85c8a5bf29052c054ae945f4430d23deba5a1","unresolved":false,"context_lines":[{"line_number":1893,"context_line":"                    pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"},{"line_number":1894,"context_line":"                                                             pci_request_id,"},{"line_number":1895,"context_line":"                                                             compute.id)"},{"line_number":1896,"context_line":"                    if not pci_devs or len(pci_devs) \u003e 1:"},{"line_number":1897,"context_line":"                        raise exception.PortUpdateFailed(port_id\u003dp[\u0027id\u0027],"},{"line_number":1898,"context_line":"                            reason\u003d_(\"Unable to correlate PCI request ID %s\") %"},{"line_number":1899,"context_line":"                                     pci_request_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a57f1b5_195810fa","line":1896,"range":{"start_line":1896,"start_character":39,"end_line":1896,"end_character":56},"in_reply_to":"3a57f1b5_7fd8211e","updated":"2016-02-10 13:06:14.000000000","message":"Ok I see what you mean. I guess leaving the check makes sense, but we want to hav4e a comment as it seems quite random at the moment.","commit_id":"030e48cff0366ff90d0cb40f75753cb0fb6863b0"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"e43a56aa7c9ad0e4d2a72c0dbc1d25ce15e21a90","unresolved":false,"context_lines":[{"line_number":1893,"context_line":"                    pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"},{"line_number":1894,"context_line":"                                                             pci_request_id,"},{"line_number":1895,"context_line":"                                                             compute.id)"},{"line_number":1896,"context_line":"                    if not pci_devs or len(pci_devs) \u003e 1:"},{"line_number":1897,"context_line":"                        raise exception.PortUpdateFailed(port_id\u003dp[\u0027id\u0027],"},{"line_number":1898,"context_line":"                            reason\u003d_(\"Unable to correlate PCI request ID %s\") %"},{"line_number":1899,"context_line":"                                     pci_request_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a57f1b5_7fd8211e","line":1896,"range":{"start_line":1896,"start_character":39,"end_line":1896,"end_character":56},"in_reply_to":"fa69d971_597cd3b4","updated":"2016-02-09 23:55:41.000000000","message":"What should be the behavior if there are multiple PCI devices associated with a PCI request ?\n\nAs far as I know with neutron ports this is not possible at the moment.  Each \"--nic port-id\" will yield to the creation of one PCI request only (see create_pci_requests_for_sriov_ports).\n\nShould we bother about a scenario that doesn\u0027t exist for the moment ?  Should we tackle this use case if/when ever there is support for that later ?\n\nSo removing the check \u0027len(pci_devs) \u003e 1\u0027 is enough for now ?\n\nI think long term, this is not good to rely on neutron to store this kind of information.  For this reason, I think it\u0027s more reasonable in the short term to not bother about it.","commit_id":"030e48cff0366ff90d0cb40f75753cb0fb6863b0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"89c23941a8d5b68c4808c566f33a3e551ec2a1be","unresolved":false,"context_lines":[{"line_number":1805,"context_line":"    def _update_port_binding_for_instance(self, context, instance, host, node):"},{"line_number":1806,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":1807,"context_line":"            return"},{"line_number":1808,"context_line":"        # compute \u003d self._get_by_host_and_nodename(context, instance)"},{"line_number":1809,"context_line":"        # We need to get the compute node id for comparison with the PCI"},{"line_number":1810,"context_line":"        # devices."},{"line_number":1811,"context_line":"        compute \u003d self._get_by_host_and_nodename(context, host, node)"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a57f1b5_7a2d2194","line":1808,"updated":"2016-02-11 17:08:52.000000000","message":"please remove commented out code","commit_id":"23863dfa5ee6c8b04fa892c3c6d2257d4ac69738"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"84d32bb8323265dc25587486b4837c7a2d8cf787","unresolved":false,"context_lines":[{"line_number":1805,"context_line":"    def _update_port_binding_for_instance(self, context, instance, host, node):"},{"line_number":1806,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":1807,"context_line":"            return"},{"line_number":1808,"context_line":"        # compute \u003d self._get_by_host_and_nodename(context, instance)"},{"line_number":1809,"context_line":"        # We need to get the compute node id for comparison with the PCI"},{"line_number":1810,"context_line":"        # devices."},{"line_number":1811,"context_line":"        compute \u003d self._get_by_host_and_nodename(context, host, node)"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a57f1b5_23fc6471","line":1808,"in_reply_to":"3a57f1b5_7a2d2194","updated":"2016-02-11 18:43:57.000000000","message":"Done","commit_id":"23863dfa5ee6c8b04fa892c3c6d2257d4ac69738"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"89c23941a8d5b68c4808c566f33a3e551ec2a1be","unresolved":false,"context_lines":[{"line_number":1841,"context_line":"                        raise exception.PortUpdateFailed(port_id\u003dp[\u0027id\u0027],"},{"line_number":1842,"context_line":"                            reason\u003d_(\"Unable to correlate PCI request ID %s\") %"},{"line_number":1843,"context_line":"                                     pci_request_id)"},{"line_number":1844,"context_line":""},{"line_number":1845,"context_line":"                    pci_dev \u003d pci_devs.pop()"},{"line_number":1846,"context_line":"                    profile \u003d get_pci_device_profile(pci_dev)"},{"line_number":1847,"context_line":"                    updates[\u0027binding:profile\u0027] \u003d profile"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a57f1b5_dac69599","line":1844,"updated":"2016-02-11 17:08:52.000000000","message":"The nesting level is quite high here. Would it be possible to split out a helper function to reduce the nesting and increase the readability?","commit_id":"23863dfa5ee6c8b04fa892c3c6d2257d4ac69738"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"84d32bb8323265dc25587486b4837c7a2d8cf787","unresolved":false,"context_lines":[{"line_number":1841,"context_line":"                        raise exception.PortUpdateFailed(port_id\u003dp[\u0027id\u0027],"},{"line_number":1842,"context_line":"                            reason\u003d_(\"Unable to correlate PCI request ID %s\") %"},{"line_number":1843,"context_line":"                                     pci_request_id)"},{"line_number":1844,"context_line":""},{"line_number":1845,"context_line":"                    pci_dev \u003d pci_devs.pop()"},{"line_number":1846,"context_line":"                    profile \u003d get_pci_device_profile(pci_dev)"},{"line_number":1847,"context_line":"                    updates[\u0027binding:profile\u0027] \u003d profile"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a57f1b5_a99115f3","line":1844,"in_reply_to":"3a57f1b5_dac69599","updated":"2016-02-11 18:43:57.000000000","message":"Done","commit_id":"23863dfa5ee6c8b04fa892c3c6d2257d4ac69738"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"97db0f26b58f1e86022ea0d8923bc8c7e6d9c699","unresolved":false,"context_lines":[{"line_number":1791,"context_line":"        \"\"\"Cleanup network for specified instance on host.\"\"\""},{"line_number":1792,"context_line":"        pass"},{"line_number":1793,"context_line":""},{"line_number":1794,"context_line":"    def _get_by_host_and_nodename(self, context, host, node):"},{"line_number":1795,"context_line":"        # Host is None during shelves."},{"line_number":1796,"context_line":"        if host and node:"},{"line_number":1797,"context_line":"            try:"},{"line_number":1798,"context_line":"                return objects.ComputeNode.get_by_host_and_nodename(context,"},{"line_number":1799,"context_line":"                                                                    host, node)"},{"line_number":1800,"context_line":"            except exception.NotFound:"},{"line_number":1801,"context_line":"                raise exception.ComputeHostNotFound(host\u003dhost)"},{"line_number":1802,"context_line":"        else:"},{"line_number":1803,"context_line":"            return None"},{"line_number":1804,"context_line":""},{"line_number":1805,"context_line":"    # Update PCI information for SR-IOV devices, correlate based on PCI"},{"line_number":1806,"context_line":"    # Request ID.  In the case of migration, the PCI device that was allocated"}],"source_content_type":"text/x-python","patch_set":13,"id":"7af24918_f2a19447","line":1803,"range":{"start_line":1794,"start_character":8,"end_line":1803,"end_character":23},"updated":"2016-03-03 10:30:11.000000000","message":"I still feel a bit weird that this is ever in the network_api, almost feels we should hide this inside get_instance_pci_devs.\n\n\nThis patch had enough, so when you respin - just add a comment maybe and we can fix it later","commit_id":"b15b53ac95d0f8726d5da11e4dcd458545141d67"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"ea5702e2d45006ccd83ae9a966b0366c2af96d03","unresolved":false,"context_lines":[{"line_number":1791,"context_line":"        \"\"\"Cleanup network for specified instance on host.\"\"\""},{"line_number":1792,"context_line":"        pass"},{"line_number":1793,"context_line":""},{"line_number":1794,"context_line":"    def _get_by_host_and_nodename(self, context, host, node):"},{"line_number":1795,"context_line":"        # Host is None during shelves."},{"line_number":1796,"context_line":"        if host and node:"},{"line_number":1797,"context_line":"            try:"},{"line_number":1798,"context_line":"                return objects.ComputeNode.get_by_host_and_nodename(context,"},{"line_number":1799,"context_line":"                                                                    host, node)"},{"line_number":1800,"context_line":"            except exception.NotFound:"},{"line_number":1801,"context_line":"                raise exception.ComputeHostNotFound(host\u003dhost)"},{"line_number":1802,"context_line":"        else:"},{"line_number":1803,"context_line":"            return None"},{"line_number":1804,"context_line":""},{"line_number":1805,"context_line":"    # Update PCI information for SR-IOV devices, correlate based on PCI"},{"line_number":1806,"context_line":"    # Request ID.  In the case of migration, the PCI device that was allocated"}],"source_content_type":"text/x-python","patch_set":13,"id":"7af24918_f4cdee31","line":1803,"range":{"start_line":1794,"start_character":8,"end_line":1803,"end_character":23},"in_reply_to":"7af24918_f2a19447","updated":"2016-03-03 15:34:29.000000000","message":"Done","commit_id":"b15b53ac95d0f8726d5da11e4dcd458545141d67"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"97db0f26b58f1e86022ea0d8923bc8c7e6d9c699","unresolved":false,"context_lines":[{"line_number":1806,"context_line":"    # Request ID.  In the case of migration, the PCI device that was allocated"},{"line_number":1807,"context_line":"    # on the incoming compute also has the same pci_request_id.  So pick the"},{"line_number":1808,"context_line":"    # one that was allocated on this host."},{"line_number":1809,"context_line":"    def _get_sriov_port_binding_update_profile(self, compute, instance, port):"},{"line_number":1810,"context_line":"        binding_profile \u003d port.get(\u0027binding:profile\u0027, {})"},{"line_number":1811,"context_line":"        pci_request_id \u003d binding_profile.get(\u0027pci_request_id\u0027)"},{"line_number":1812,"context_line":"        pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"}],"source_content_type":"text/x-python","patch_set":13,"id":"7af24918_55d0321f","line":1809,"range":{"start_line":1809,"start_character":8,"end_line":1809,"end_character":46},"updated":"2016-03-03 10:30:11.000000000","message":"I think that this could folded into _populate_neutron_binding_profile by making it a bit more generic, but also something we could do as a follow-up","commit_id":"b15b53ac95d0f8726d5da11e4dcd458545141d67"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"ea5702e2d45006ccd83ae9a966b0366c2af96d03","unresolved":false,"context_lines":[{"line_number":1806,"context_line":"    # Request ID.  In the case of migration, the PCI device that was allocated"},{"line_number":1807,"context_line":"    # on the incoming compute also has the same pci_request_id.  So pick the"},{"line_number":1808,"context_line":"    # one that was allocated on this host."},{"line_number":1809,"context_line":"    def _get_sriov_port_binding_update_profile(self, compute, instance, port):"},{"line_number":1810,"context_line":"        binding_profile \u003d port.get(\u0027binding:profile\u0027, {})"},{"line_number":1811,"context_line":"        pci_request_id \u003d binding_profile.get(\u0027pci_request_id\u0027)"},{"line_number":1812,"context_line":"        pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"}],"source_content_type":"text/x-python","patch_set":13,"id":"7af24918_d5ef0ce7","line":1809,"range":{"start_line":1809,"start_character":8,"end_line":1809,"end_character":46},"in_reply_to":"7af24918_55d0321f","updated":"2016-03-03 15:34:29.000000000","message":"Done","commit_id":"b15b53ac95d0f8726d5da11e4dcd458545141d67"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a60470a8af17644b57e49b4bd78933f90200495b","unresolved":false,"context_lines":[{"line_number":1896,"context_line":"            return"},{"line_number":1897,"context_line":"        # We need to get the compute node id for comparison with the PCI"},{"line_number":1898,"context_line":"        # devices."},{"line_number":1899,"context_line":"        compute \u003d self._get_by_host_and_nodename(context, host, node)"},{"line_number":1900,"context_line":"        neutron \u003d get_client(context, admin\u003dTrue)"},{"line_number":1901,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":1902,"context_line":"                       \u0027tenant_id\u0027: instance.project_id}"}],"source_content_type":"text/x-python","patch_set":15,"id":"5aef4532_97048018","line":1899,"range":{"start_line":1899,"start_character":8,"end_line":1899,"end_character":69},"updated":"2016-03-09 17:07:13.000000000","message":"We could save this call until only when it\u0027s needed...","commit_id":"2e1fd7545acd5035fcd548d8a54da199c914b332"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"d89a4169d372c8693e38630238c3cbd9c37f55a4","unresolved":false,"context_lines":[{"line_number":1896,"context_line":"            return"},{"line_number":1897,"context_line":"        # We need to get the compute node id for comparison with the PCI"},{"line_number":1898,"context_line":"        # devices."},{"line_number":1899,"context_line":"        compute \u003d self._get_by_host_and_nodename(context, host, node)"},{"line_number":1900,"context_line":"        neutron \u003d get_client(context, admin\u003dTrue)"},{"line_number":1901,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":1902,"context_line":"                       \u0027tenant_id\u0027: instance.project_id}"}],"source_content_type":"text/x-python","patch_set":15,"id":"5aef4532_d028c935","line":1899,"range":{"start_line":1899,"start_character":8,"end_line":1899,"end_character":69},"in_reply_to":"5aef4532_97048018","updated":"2016-03-09 18:42:08.000000000","message":"Done","commit_id":"2e1fd7545acd5035fcd548d8a54da199c914b332"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"7cc7b581fb8f7f5c031b1e746ceb49025dfc946c","unresolved":false,"context_lines":[{"line_number":1859,"context_line":""},{"line_number":1860,"context_line":"    # Note(lbeliveau): Move this out (it doesn\u0027t belong in network API)."},{"line_number":1861,"context_line":"    # Perhaps move it in get_instance_pci_devs()."},{"line_number":1862,"context_line":"    def _get_by_host_and_nodename(self, context, host, node):"},{"line_number":1863,"context_line":"        # Host is None during shelves."},{"line_number":1864,"context_line":"        if host and node:"},{"line_number":1865,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":16,"id":"5aef4532_d880b58d","line":1862,"updated":"2016-03-10 16:47:17.000000000","message":"This method does not have to live at all. it\u0027s used one time and actually the method which receive a compute\u0027s ref does not handle it if compute is NULL.\n\nSo should  just to use objects.ComputeNode.get_by_host_and_nodename() and let that ComputeHostNotFound\u0027s exception running. That said I think that we will probably be stopped before running that part of that code is the compute node where we are migrating does not exists.","commit_id":"bee78e3fd482e98f747b815f12e3f8163d52cef6"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"2cd00a6d3ba6fa3fa54a9fb586906d9d42c32221","unresolved":false,"context_lines":[{"line_number":1859,"context_line":""},{"line_number":1860,"context_line":"    # Note(lbeliveau): Move this out (it doesn\u0027t belong in network API)."},{"line_number":1861,"context_line":"    # Perhaps move it in get_instance_pci_devs()."},{"line_number":1862,"context_line":"    def _get_by_host_and_nodename(self, context, host, node):"},{"line_number":1863,"context_line":"        # Host is None during shelves."},{"line_number":1864,"context_line":"        if host and node:"},{"line_number":1865,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":16,"id":"5aef4532_887b76bd","line":1862,"in_reply_to":"5aef4532_d880b58d","updated":"2016-03-10 18:13:24.000000000","message":"Done","commit_id":"bee78e3fd482e98f747b815f12e3f8163d52cef6"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"7cc7b581fb8f7f5c031b1e746ceb49025dfc946c","unresolved":false,"context_lines":[{"line_number":1874,"context_line":"    # Request ID.  In the case of migration, the PCI device that was allocated"},{"line_number":1875,"context_line":"    # on the incoming compute also has the same pci_request_id.  So pick the"},{"line_number":1876,"context_line":"    # one that was allocated on this host."},{"line_number":1877,"context_line":"    # Note(lbeliveau): Consider folding this code into"},{"line_number":1878,"context_line":"    # _populate_neutron_binding_profile() for making it more generic."},{"line_number":1879,"context_line":"    def _get_sriov_port_binding_update_profile(self, compute, instance, port):"},{"line_number":1880,"context_line":"        binding_profile \u003d port.get(\u0027binding:profile\u0027, {})"}],"source_content_type":"text/x-python","patch_set":16,"id":"5aef4532_8366beea","line":1877,"updated":"2016-03-10 16:47:17.000000000","message":"s/Note/TODO","commit_id":"bee78e3fd482e98f747b815f12e3f8163d52cef6"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"2cd00a6d3ba6fa3fa54a9fb586906d9d42c32221","unresolved":false,"context_lines":[{"line_number":1874,"context_line":"    # Request ID.  In the case of migration, the PCI device that was allocated"},{"line_number":1875,"context_line":"    # on the incoming compute also has the same pci_request_id.  So pick the"},{"line_number":1876,"context_line":"    # one that was allocated on this host."},{"line_number":1877,"context_line":"    # Note(lbeliveau): Consider folding this code into"},{"line_number":1878,"context_line":"    # _populate_neutron_binding_profile() for making it more generic."},{"line_number":1879,"context_line":"    def _get_sriov_port_binding_update_profile(self, compute, instance, port):"},{"line_number":1880,"context_line":"        binding_profile \u003d port.get(\u0027binding:profile\u0027, {})"}],"source_content_type":"text/x-python","patch_set":16,"id":"5aef4532_e84cba9f","line":1877,"in_reply_to":"5aef4532_8366beea","updated":"2016-03-10 18:13:24.000000000","message":"Done","commit_id":"bee78e3fd482e98f747b815f12e3f8163d52cef6"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"0afec5b21ac8cb757ff8a0160ce4655593212814","unresolved":false,"context_lines":[{"line_number":1865,"context_line":"    def _get_sriov_port_binding_update_profile(self, compute, instance, port):"},{"line_number":1866,"context_line":"        binding_profile \u003d port.get(\u0027binding:profile\u0027, {})"},{"line_number":1867,"context_line":"        pci_request_id \u003d binding_profile.get(\u0027pci_request_id\u0027)"},{"line_number":1868,"context_line":"        pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"},{"line_number":1869,"context_line":"                                                     pci_request_id,"},{"line_number":1870,"context_line":"                                                     compute.id)"},{"line_number":1871,"context_line":"        # For SRIOV VNIC, there is exactly one PCI request per \"--nic port-id\""},{"line_number":1872,"context_line":"        # (see create_pci_requests_for_sriov_ports())."},{"line_number":1873,"context_line":"        if not pci_devs or len(pci_devs) \u003e 1:"}],"source_content_type":"text/x-python","patch_set":17,"id":"ba0121b8_5c09a6dc","line":1870,"range":{"start_line":1868,"start_character":0,"end_line":1870,"end_character":64},"updated":"2016-03-30 11:44:06.000000000","message":"So the problem is that pci devices are only claim and not allocate at this point and claimed pci devices are not kept in the instance.\n\none way to solve this is to save the claimed pci device in the instance like it done in allocate see \n https://github.com/openstack/nova/blob/master/nova/objects/pci_device.py#L373-L380\n\nother option maybe to change the _claim_instance for an allocate_instance \nhttps://github.com/openstack/nova/blob/master/nova/pci/manager.py#L254,\n\nI am not that familiar with the code so I don\u0027t have an opinion.","commit_id":"695d47c6267b868374910cc34e0a13d48bcfe381"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"accea246da3c1164a37094bc62189a782395bd22","unresolved":false,"context_lines":[{"line_number":1865,"context_line":"    def _get_sriov_port_binding_update_profile(self, compute, instance, port):"},{"line_number":1866,"context_line":"        binding_profile \u003d port.get(\u0027binding:profile\u0027, {})"},{"line_number":1867,"context_line":"        pci_request_id \u003d binding_profile.get(\u0027pci_request_id\u0027)"},{"line_number":1868,"context_line":"        pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"},{"line_number":1869,"context_line":"                                                     pci_request_id,"},{"line_number":1870,"context_line":"                                                     compute.id)"},{"line_number":1871,"context_line":"        # For SRIOV VNIC, there is exactly one PCI request per \"--nic port-id\""},{"line_number":1872,"context_line":"        # (see create_pci_requests_for_sriov_ports())."},{"line_number":1873,"context_line":"        if not pci_devs or len(pci_devs) \u003e 1:"}],"source_content_type":"text/x-python","patch_set":17,"id":"1a122d0e_557c3f20","line":1870,"range":{"start_line":1868,"start_character":0,"end_line":1870,"end_character":64},"in_reply_to":"9a061dce_1d915353","updated":"2016-04-15 13:37:50.000000000","message":"Thanks Yongli.  Once we have \"_new\" working we can re-adjust.","commit_id":"695d47c6267b868374910cc34e0a13d48bcfe381"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"2cb0c7a1a11c1ecec08753815fe97715f09e02fb","unresolved":false,"context_lines":[{"line_number":1865,"context_line":"    def _get_sriov_port_binding_update_profile(self, compute, instance, port):"},{"line_number":1866,"context_line":"        binding_profile \u003d port.get(\u0027binding:profile\u0027, {})"},{"line_number":1867,"context_line":"        pci_request_id \u003d binding_profile.get(\u0027pci_request_id\u0027)"},{"line_number":1868,"context_line":"        pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"},{"line_number":1869,"context_line":"                                                     pci_request_id,"},{"line_number":1870,"context_line":"                                                     compute.id)"},{"line_number":1871,"context_line":"        # For SRIOV VNIC, there is exactly one PCI request per \"--nic port-id\""},{"line_number":1872,"context_line":"        # (see create_pci_requests_for_sriov_ports())."},{"line_number":1873,"context_line":"        if not pci_devs or len(pci_devs) \u003e 1:"}],"source_content_type":"text/x-python","patch_set":17,"id":"1a122d0e_b2e169d3","line":1870,"range":{"start_line":1868,"start_character":0,"end_line":1870,"end_character":64},"in_reply_to":"ba0121b8_5c09a6dc","updated":"2016-04-15 13:36:08.000000000","message":"Thanks again for the help Moshe.\n\nI pushed a new patch to fix this issue: https://review.openstack.org/#/c/305978/1","commit_id":"695d47c6267b868374910cc34e0a13d48bcfe381"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"c2ca53724d9c5958fb0ea29af91374eac6833117","unresolved":false,"context_lines":[{"line_number":1865,"context_line":"    def _get_sriov_port_binding_update_profile(self, compute, instance, port):"},{"line_number":1866,"context_line":"        binding_profile \u003d port.get(\u0027binding:profile\u0027, {})"},{"line_number":1867,"context_line":"        pci_request_id \u003d binding_profile.get(\u0027pci_request_id\u0027)"},{"line_number":1868,"context_line":"        pci_devs \u003d pci_manager.get_instance_pci_devs(instance,"},{"line_number":1869,"context_line":"                                                     pci_request_id,"},{"line_number":1870,"context_line":"                                                     compute.id)"},{"line_number":1871,"context_line":"        # For SRIOV VNIC, there is exactly one PCI request per \"--nic port-id\""},{"line_number":1872,"context_line":"        # (see create_pci_requests_for_sriov_ports())."},{"line_number":1873,"context_line":"        if not pci_devs or len(pci_devs) \u003e 1:"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a061dce_1d915353","line":1870,"range":{"start_line":1868,"start_character":0,"end_line":1870,"end_character":64},"in_reply_to":"ba0121b8_5c09a6dc","updated":"2016-04-08 07:58:28.000000000","message":"this patch focus on resolved sriov port information things during migration. \n\nthe \"new\" request of the pci request missing is actually another problem . there is a bug for that: https://bugs.launchpad.net/nova/+bug/1368201\ni working this bug, the draft patch will release ASAP.","commit_id":"695d47c6267b868374910cc34e0a13d48bcfe381"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"97a9c7c1a11f29ddd1e11578bd124fdc595bd191","unresolved":false,"context_lines":[{"line_number":1891,"context_line":""},{"line_number":1892,"context_line":"            # If the host hasn\u0027t changed, like in the case of resizing to the"},{"line_number":1893,"context_line":"            # same host, there is nothing to do."},{"line_number":1894,"context_line":"            if p.get(\u0027binding:host_id\u0027) !\u003d host:"},{"line_number":1895,"context_line":"                updates[\u0027binding:host_id\u0027] \u003d host"},{"line_number":1896,"context_line":""},{"line_number":1897,"context_line":"                vnic_type \u003d p.get(\u0027binding:vnic_type\u0027)"}],"source_content_type":"text/x-python","patch_set":17,"id":"5aef4532_e17e95e2","line":1894,"range":{"start_line":1894,"start_character":17,"end_line":1894,"end_character":20},"updated":"2016-03-10 19:43:32.000000000","message":"nit: this could be moved outside the for loop","commit_id":"695d47c6267b868374910cc34e0a13d48bcfe381"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"2cb0c7a1a11c1ecec08753815fe97715f09e02fb","unresolved":false,"context_lines":[{"line_number":1891,"context_line":""},{"line_number":1892,"context_line":"            # If the host hasn\u0027t changed, like in the case of resizing to the"},{"line_number":1893,"context_line":"            # same host, there is nothing to do."},{"line_number":1894,"context_line":"            if p.get(\u0027binding:host_id\u0027) !\u003d host:"},{"line_number":1895,"context_line":"                updates[\u0027binding:host_id\u0027] \u003d host"},{"line_number":1896,"context_line":""},{"line_number":1897,"context_line":"                vnic_type \u003d p.get(\u0027binding:vnic_type\u0027)"}],"source_content_type":"text/x-python","patch_set":17,"id":"1a122d0e_35e4230c","line":1894,"range":{"start_line":1894,"start_character":17,"end_line":1894,"end_character":20},"in_reply_to":"5aef4532_e17e95e2","updated":"2016-04-15 13:36:08.000000000","message":"It should be done for each port right ?","commit_id":"695d47c6267b868374910cc34e0a13d48bcfe381"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"536d08c457e05504f852c7cba4df7fb947bfaa38","unresolved":false,"context_lines":[{"line_number":1866,"context_line":""},{"line_number":1867,"context_line":"    # For a migration, get the mapping between the old PCI devices and the new"},{"line_number":1868,"context_line":"    # PCI devices that have been allocated."},{"line_number":1869,"context_line":"    # Returns: dictionnary {\u0027\u003cold pci address\u003e\u0027: \u003cNew PciDevice\u003e}"},{"line_number":1870,"context_line":"    def _get_pci_mapping_for_migration(self, context, instance):"},{"line_number":1871,"context_line":"        migration_context \u003d objects.MigrationContext.get_by_instance_uuid("},{"line_number":1872,"context_line":"            context, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":25,"id":"7aa08908_901d26c0","line":1869,"range":{"start_line":1869,"start_character":15,"end_line":1869,"end_character":26},"updated":"2016-06-05 20:06:32.000000000","message":"s/dictionnary/dictionary","commit_id":"fdd1a0333fb451840d132d02c4c98aef98153f77"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"ed1c124cf4386236b5e84c4af08f1e60120d243a","unresolved":false,"context_lines":[{"line_number":1872,"context_line":"            context, instance.uuid)"},{"line_number":1873,"context_line":"        if migration_context:"},{"line_number":1874,"context_line":"            return {old.address: new"},{"line_number":1875,"context_line":"                    for old in migration_context.old_pci_devices"},{"line_number":1876,"context_line":"                        for new in migration_context.new_pci_devices"},{"line_number":1877,"context_line":"                            if old.request_id \u003d\u003d new.request_id}"},{"line_number":1878,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_40fab043","line":1875,"range":{"start_line":1875,"start_character":31,"end_line":1875,"end_character":64},"updated":"2016-06-06 12:53:37.000000000","message":"we should check that the old_pci_devices and the new_pci_devices are not None before doing the for","commit_id":"7bd57cb26f1e9f5dfb928fdc5e67e5b4b432fad6"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"0bf4fc204da777e5a2f00fd934de79f3f6edd3e5","unresolved":false,"context_lines":[{"line_number":1872,"context_line":"            context, instance.uuid)"},{"line_number":1873,"context_line":"        if migration_context:"},{"line_number":1874,"context_line":"            return {old.address: new"},{"line_number":1875,"context_line":"                    for old in migration_context.old_pci_devices"},{"line_number":1876,"context_line":"                        for new in migration_context.new_pci_devices"},{"line_number":1877,"context_line":"                            if old.request_id \u003d\u003d new.request_id}"},{"line_number":1878,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_48d755ed","line":1875,"range":{"start_line":1875,"start_character":31,"end_line":1875,"end_character":64},"in_reply_to":"7aa08908_40fab043","updated":"2016-06-06 23:47:03.000000000","message":"Done\n\nSee fix in https://review.openstack.org/#/c/326174","commit_id":"7bd57cb26f1e9f5dfb928fdc5e67e5b4b432fad6"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"20d82b5c9002b8b3376b9ac489a9819092716d44","unresolved":false,"context_lines":[{"line_number":1872,"context_line":"            context, instance.uuid)"},{"line_number":1873,"context_line":"        if migration_context:"},{"line_number":1874,"context_line":"            return {old.address: new"},{"line_number":1875,"context_line":"                    for old in migration_context.old_pci_devices"},{"line_number":1876,"context_line":"                        for new in migration_context.new_pci_devices"},{"line_number":1877,"context_line":"                            if old.request_id \u003d\u003d new.request_id}"},{"line_number":1878,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_fe86b8d9","line":1875,"range":{"start_line":1875,"start_character":31,"end_line":1875,"end_character":64},"in_reply_to":"7aa08908_48d755ed","updated":"2016-06-07 02:58:41.000000000","message":"actually, my comment was just to protected against Nullable \nmigration_context.old_pci_devices or migration_context.new_pci_devices.\nSo I would add \nif migration_context and migration_context.old_pci_devices \nand migration_context.new_pci_devices:","commit_id":"7bd57cb26f1e9f5dfb928fdc5e67e5b4b432fad6"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"0f4d008f8b8bc36e830cb033cb656c0e78acbbbf","unresolved":false,"context_lines":[{"line_number":1872,"context_line":"            context, instance.uuid)"},{"line_number":1873,"context_line":"        if migration_context:"},{"line_number":1874,"context_line":"            return {old.address: new"},{"line_number":1875,"context_line":"                    for old in migration_context.old_pci_devices"},{"line_number":1876,"context_line":"                        for new in migration_context.new_pci_devices"},{"line_number":1877,"context_line":"                            if old.request_id \u003d\u003d new.request_id}"},{"line_number":1878,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_7e3f4fd6","line":1875,"range":{"start_line":1875,"start_character":31,"end_line":1875,"end_character":64},"in_reply_to":"7aa08908_fe86b8d9","updated":"2016-06-07 12:17:31.000000000","message":"Done","commit_id":"7bd57cb26f1e9f5dfb928fdc5e67e5b4b432fad6"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"e14e37a3d07b2e6601c1058ae0008973846a162a","unresolved":false,"context_lines":[{"line_number":1868,"context_line":"    # PCI devices that have been allocated."},{"line_number":1869,"context_line":"    # Returns: dictionary {\u0027\u003cold pci address\u003e\u0027: \u003cNew PciDevice\u003e}"},{"line_number":1870,"context_line":"    def _get_pci_mapping_for_migration(self, context, instance):"},{"line_number":1871,"context_line":"        migration_context \u003d objects.MigrationContext.get_by_instance_uuid("},{"line_number":1872,"context_line":"            context, instance.uuid)"},{"line_number":1873,"context_line":"        if migration_context:"},{"line_number":1874,"context_line":"            return {old.address: new"},{"line_number":1875,"context_line":"                    for old in migration_context.old_pci_devices"}],"source_content_type":"text/x-python","patch_set":27,"id":"7aa08908_7eee48b5","line":1872,"range":{"start_line":1871,"start_character":8,"end_line":1872,"end_character":35},"updated":"2016-06-07 02:55:21.000000000","message":"why do we need to query the database?\ncan\u0027t you take the migration context from  instance\nsee https://github.com/openstack/nova/blob/master/nova/objects/instance.py#L199-L200","commit_id":"5d0dea6673ac41d29b893a80dbc4d128f6073e3f"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"0f48017af2b950b25df4e76e8d1ab6f8494417e4","unresolved":false,"context_lines":[{"line_number":1868,"context_line":"    # PCI devices that have been allocated."},{"line_number":1869,"context_line":"    # Returns: dictionary {\u0027\u003cold pci address\u003e\u0027: \u003cNew PciDevice\u003e}"},{"line_number":1870,"context_line":"    def _get_pci_mapping_for_migration(self, context, instance):"},{"line_number":1871,"context_line":"        migration_context \u003d objects.MigrationContext.get_by_instance_uuid("},{"line_number":1872,"context_line":"            context, instance.uuid)"},{"line_number":1873,"context_line":"        if migration_context:"},{"line_number":1874,"context_line":"            return {old.address: new"},{"line_number":1875,"context_line":"                    for old in migration_context.old_pci_devices"}],"source_content_type":"text/x-python","patch_set":27,"id":"7aa08908_9eb79b85","line":1872,"range":{"start_line":1871,"start_character":8,"end_line":1872,"end_character":35},"in_reply_to":"7aa08908_7eee48b5","updated":"2016-06-07 12:17:50.000000000","message":"Yeah, this is what I\u0027ve done in the revert patch ...  Will do it here as well.","commit_id":"5d0dea6673ac41d29b893a80dbc4d128f6073e3f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"094b79462e6459b110db08a92694cbeafac64191","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                \u0027pci_slot\u0027: pci_dev.address,"},{"line_number":132,"context_line":"                \u0027physical_network\u0027:"},{"line_number":133,"context_line":"                    dev_spec.get_tags().get(\u0027physical_network\u0027)}"},{"line_number":134,"context_line":"    else:"},{"line_number":135,"context_line":"        raise exception.PciDeviceNotFound(node_id\u003dpci_dev.compute_node_id,"},{"line_number":136,"context_line":"                                          address\u003dpci_dev.address)"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"7aa08908_87358a47","line":134,"range":{"start_line":134,"start_character":4,"end_line":134,"end_character":8},"updated":"2016-06-11 15:34:03.000000000","message":"style nit: you don\u0027t need the else because if you get into the if above it returns.","commit_id":"acd5ab9f2b71cd4da779181a2c8298a83306a401"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"9bc11db7d154da4f908f9d00df37bbcabbfe897d","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                \u0027pci_slot\u0027: pci_dev.address,"},{"line_number":132,"context_line":"                \u0027physical_network\u0027:"},{"line_number":133,"context_line":"                    dev_spec.get_tags().get(\u0027physical_network\u0027)}"},{"line_number":134,"context_line":"    else:"},{"line_number":135,"context_line":"        raise exception.PciDeviceNotFound(node_id\u003dpci_dev.compute_node_id,"},{"line_number":136,"context_line":"                                          address\u003dpci_dev.address)"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"7aa08908_64a16e46","line":134,"range":{"start_line":134,"start_character":4,"end_line":134,"end_character":8},"in_reply_to":"7aa08908_87358a47","updated":"2016-06-12 18:11:49.000000000","message":"Done","commit_id":"acd5ab9f2b71cd4da779181a2c8298a83306a401"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"094b79462e6459b110db08a92694cbeafac64191","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                \u0027physical_network\u0027:"},{"line_number":133,"context_line":"                    dev_spec.get_tags().get(\u0027physical_network\u0027)}"},{"line_number":134,"context_line":"    else:"},{"line_number":135,"context_line":"        raise exception.PciDeviceNotFound(node_id\u003dpci_dev.compute_node_id,"},{"line_number":136,"context_line":"                                          address\u003dpci_dev.address)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"7aa08908_4779e2fb","line":135,"updated":"2016-06-11 15:34:03.000000000","message":"I don\u0027t see a unit test for this case.","commit_id":"acd5ab9f2b71cd4da779181a2c8298a83306a401"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"9bc11db7d154da4f908f9d00df37bbcabbfe897d","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                \u0027physical_network\u0027:"},{"line_number":133,"context_line":"                    dev_spec.get_tags().get(\u0027physical_network\u0027)}"},{"line_number":134,"context_line":"    else:"},{"line_number":135,"context_line":"        raise exception.PciDeviceNotFound(node_id\u003dpci_dev.compute_node_id,"},{"line_number":136,"context_line":"                                          address\u003dpci_dev.address)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"7aa08908_07322cf2","line":135,"in_reply_to":"7aa08908_4779e2fb","updated":"2016-06-12 18:11:49.000000000","message":"I will move the exception in pci_whitelist.get_pci_device_devspec() so that it is more generic.\n\nIf somehow we have a PCI device but there is no corresponding dev spec, something went really wrong ...","commit_id":"acd5ab9f2b71cd4da779181a2c8298a83306a401"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"094b79462e6459b110db08a92694cbeafac64191","unresolved":false,"context_lines":[{"line_number":1864,"context_line":"        \"\"\"Cleanup network for specified instance on host.\"\"\""},{"line_number":1865,"context_line":"        pass"},{"line_number":1866,"context_line":""},{"line_number":1867,"context_line":"    # For a migration, get the mapping between the old PCI devices and the new"},{"line_number":1868,"context_line":"    # PCI devices that have been allocated."},{"line_number":1869,"context_line":"    # Returns: dictionary {\u0027\u003cold pci address\u003e\u0027: \u003cNew PciDevice\u003e}"},{"line_number":1870,"context_line":"    def _get_pci_mapping_for_migration(self, context, instance):"},{"line_number":1871,"context_line":"        migration_context \u003d instance.migration_context"},{"line_number":1872,"context_line":"        if (migration_context and migration_context.old_pci_devices and"}],"source_content_type":"text/x-python","patch_set":28,"id":"7aa08908_a73a4632","line":1869,"range":{"start_line":1867,"start_character":4,"end_line":1869,"end_character":64},"updated":"2016-06-11 15:34:03.000000000","message":"This would be better as a docstring on the method itself.","commit_id":"acd5ab9f2b71cd4da779181a2c8298a83306a401"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"9bc11db7d154da4f908f9d00df37bbcabbfe897d","unresolved":false,"context_lines":[{"line_number":1864,"context_line":"        \"\"\"Cleanup network for specified instance on host.\"\"\""},{"line_number":1865,"context_line":"        pass"},{"line_number":1866,"context_line":""},{"line_number":1867,"context_line":"    # For a migration, get the mapping between the old PCI devices and the new"},{"line_number":1868,"context_line":"    # PCI devices that have been allocated."},{"line_number":1869,"context_line":"    # Returns: dictionary {\u0027\u003cold pci address\u003e\u0027: \u003cNew PciDevice\u003e}"},{"line_number":1870,"context_line":"    def _get_pci_mapping_for_migration(self, context, instance):"},{"line_number":1871,"context_line":"        migration_context \u003d instance.migration_context"},{"line_number":1872,"context_line":"        if (migration_context and migration_context.old_pci_devices and"}],"source_content_type":"text/x-python","patch_set":28,"id":"7aa08908_e48d5ed4","line":1869,"range":{"start_line":1867,"start_character":4,"end_line":1869,"end_character":64},"in_reply_to":"7aa08908_a73a4632","updated":"2016-06-12 18:11:49.000000000","message":"Done","commit_id":"acd5ab9f2b71cd4da779181a2c8298a83306a401"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"094b79462e6459b110db08a92694cbeafac64191","unresolved":false,"context_lines":[{"line_number":1902,"context_line":"                if vnic_type in network_model.VNIC_TYPES_SRIOV:"},{"line_number":1903,"context_line":"                    binding_profile \u003d p.get(\u0027binding:profile\u0027, {})"},{"line_number":1904,"context_line":"                    pci_slot \u003d binding_profile.get(\u0027pci_slot\u0027)"},{"line_number":1905,"context_line":"                    new_dev \u003d pci_mapping.get(pci_slot)"},{"line_number":1906,"context_line":"                    if new_dev:"},{"line_number":1907,"context_line":"                        updates[\u0027binding:profile\u0027] \u003d \\"},{"line_number":1908,"context_line":"                            get_pci_device_profile(new_dev)"}],"source_content_type":"text/x-python","patch_set":28,"id":"7aa08908_c7267215","line":1905,"range":{"start_line":1905,"start_character":30,"end_line":1905,"end_character":41},"updated":"2016-06-11 15:34:03.000000000","message":"Are we sure this won\u0027t be None?","commit_id":"acd5ab9f2b71cd4da779181a2c8298a83306a401"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"9bc11db7d154da4f908f9d00df37bbcabbfe897d","unresolved":false,"context_lines":[{"line_number":1902,"context_line":"                if vnic_type in network_model.VNIC_TYPES_SRIOV:"},{"line_number":1903,"context_line":"                    binding_profile \u003d p.get(\u0027binding:profile\u0027, {})"},{"line_number":1904,"context_line":"                    pci_slot \u003d binding_profile.get(\u0027pci_slot\u0027)"},{"line_number":1905,"context_line":"                    new_dev \u003d pci_mapping.get(pci_slot)"},{"line_number":1906,"context_line":"                    if new_dev:"},{"line_number":1907,"context_line":"                        updates[\u0027binding:profile\u0027] \u003d \\"},{"line_number":1908,"context_line":"                            get_pci_device_profile(new_dev)"}],"source_content_type":"text/x-python","patch_set":28,"id":"7aa08908_e7b8c013","line":1905,"range":{"start_line":1905,"start_character":30,"end_line":1905,"end_character":41},"in_reply_to":"7aa08908_c7267215","updated":"2016-06-12 18:11:49.000000000","message":"Done","commit_id":"acd5ab9f2b71cd4da779181a2c8298a83306a401"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"094b79462e6459b110db08a92694cbeafac64191","unresolved":false,"context_lines":[{"line_number":1907,"context_line":"                        updates[\u0027binding:profile\u0027] \u003d \\"},{"line_number":1908,"context_line":"                            get_pci_device_profile(new_dev)"},{"line_number":1909,"context_line":"                    else:"},{"line_number":1910,"context_line":"                        raise exception.PortUpdateFailed(port_id\u003dp[\u0027id\u0027],"},{"line_number":1911,"context_line":"                            reason\u003d_(\"Unable to correlate PCI slot %s\") %"},{"line_number":1912,"context_line":"                                     pci_slot)"},{"line_number":1913,"context_line":""},{"line_number":1914,"context_line":"            if updates:"},{"line_number":1915,"context_line":"                LOG.info(_LI(\"Updating port %(port)s with \""}],"source_content_type":"text/x-python","patch_set":28,"id":"7aa08908_670fbe88","line":1912,"range":{"start_line":1910,"start_character":24,"end_line":1912,"end_character":46},"updated":"2016-06-11 15:34:03.000000000","message":"What if we have say 3 ports and we updated one, but failed to find a mapping on the 2nd, should we rollback the update to the first port before raising this up?\n\nAlso, I don\u0027t see a unit test for this case.","commit_id":"acd5ab9f2b71cd4da779181a2c8298a83306a401"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"9bc11db7d154da4f908f9d00df37bbcabbfe897d","unresolved":false,"context_lines":[{"line_number":1907,"context_line":"                        updates[\u0027binding:profile\u0027] \u003d \\"},{"line_number":1908,"context_line":"                            get_pci_device_profile(new_dev)"},{"line_number":1909,"context_line":"                    else:"},{"line_number":1910,"context_line":"                        raise exception.PortUpdateFailed(port_id\u003dp[\u0027id\u0027],"},{"line_number":1911,"context_line":"                            reason\u003d_(\"Unable to correlate PCI slot %s\") %"},{"line_number":1912,"context_line":"                                     pci_slot)"},{"line_number":1913,"context_line":""},{"line_number":1914,"context_line":"            if updates:"},{"line_number":1915,"context_line":"                LOG.info(_LI(\"Updating port %(port)s with \""}],"source_content_type":"text/x-python","patch_set":28,"id":"7aa08908_47d1d456","line":1912,"range":{"start_line":1910,"start_character":24,"end_line":1912,"end_character":46},"in_reply_to":"7aa08908_670fbe88","updated":"2016-06-12 18:11:49.000000000","message":"Done","commit_id":"acd5ab9f2b71cd4da779181a2c8298a83306a401"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"b9d98a1deb7262ef91e271d08aa89a3c7b29657e","unresolved":false,"context_lines":[{"line_number":2142,"context_line":"        \"\"\"Cleanup network for specified instance on host.\"\"\""},{"line_number":2143,"context_line":"        pass"},{"line_number":2144,"context_line":""},{"line_number":2145,"context_line":"    \"\"\" Get the mapping between the old PCI devices and the new PCI devices"},{"line_number":2146,"context_line":"    that have been allocated during this migration."},{"line_number":2147,"context_line":""},{"line_number":2148,"context_line":"    :param context:  The request context."},{"line_number":2149,"context_line":"    :param instance: Get PCI mapping for this instance."},{"line_number":2150,"context_line":"    :Returns: dictionary of mapping {\u0027\u003cold pci address\u003e\u0027: \u003cNew PciDevice\u003e}"},{"line_number":2151,"context_line":"    \"\"\""},{"line_number":2152,"context_line":"    def _get_pci_mapping_for_migration(self, context, instance):"},{"line_number":2153,"context_line":"        migration_context \u003d instance.migration_context"},{"line_number":2154,"context_line":"        if (migration_context and migration_context.old_pci_devices and"}],"source_content_type":"text/x-python","patch_set":38,"id":"1aa78d24_7513efb8","line":2151,"range":{"start_line":2145,"start_character":0,"end_line":2151,"end_character":7},"updated":"2016-07-05 16:23:43.000000000","message":"Shouldn\u0027t this be inside the function? Rebase error?","commit_id":"ac471bfe947327ac5a0437198f84f7864fff2f4a"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"fead441ccde0e475b227d2eca056758d5da9f5a5","unresolved":false,"context_lines":[{"line_number":2142,"context_line":"        \"\"\"Cleanup network for specified instance on host.\"\"\""},{"line_number":2143,"context_line":"        pass"},{"line_number":2144,"context_line":""},{"line_number":2145,"context_line":"    \"\"\" Get the mapping between the old PCI devices and the new PCI devices"},{"line_number":2146,"context_line":"    that have been allocated during this migration."},{"line_number":2147,"context_line":""},{"line_number":2148,"context_line":"    :param context:  The request context."},{"line_number":2149,"context_line":"    :param instance: Get PCI mapping for this instance."},{"line_number":2150,"context_line":"    :Returns: dictionary of mapping {\u0027\u003cold pci address\u003e\u0027: \u003cNew PciDevice\u003e}"},{"line_number":2151,"context_line":"    \"\"\""},{"line_number":2152,"context_line":"    def _get_pci_mapping_for_migration(self, context, instance):"},{"line_number":2153,"context_line":"        migration_context \u003d instance.migration_context"},{"line_number":2154,"context_line":"        if (migration_context and migration_context.old_pci_devices and"}],"source_content_type":"text/x-python","patch_set":38,"id":"1aa78d24_bf21b1b6","line":2151,"range":{"start_line":2145,"start_character":0,"end_line":2151,"end_character":7},"in_reply_to":"1aa78d24_7513efb8","updated":"2016-07-05 17:21:31.000000000","message":"Done","commit_id":"ac471bfe947327ac5a0437198f84f7864fff2f4a"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"b9d98a1deb7262ef91e271d08aa89a3c7b29657e","unresolved":false,"context_lines":[{"line_number":2155,"context_line":"                migration_context.new_pci_devices):"},{"line_number":2156,"context_line":"            old_pci_devices \u003d migration_context.old_pci_devices"},{"line_number":2157,"context_line":"            new_pci_devices \u003d migration_context.new_pci_devices"},{"line_number":2158,"context_line":"            LOG.debug(\"old_pci_devices: %(old)s, new_pci_devices: %(new)s\" %"},{"line_number":2159,"context_line":"                      {\u0027old\u0027: [dev for dev in old_pci_devices],"},{"line_number":2160,"context_line":"                      \u0027new\u0027: [dev for dev in new_pci_devices]})"},{"line_number":2161,"context_line":"            return {old.address: new"},{"line_number":2162,"context_line":"                    for old in old_pci_devices"},{"line_number":2163,"context_line":"                        for new in new_pci_devices"}],"source_content_type":"text/x-python","patch_set":38,"id":"1aa78d24_b58437d4","line":2160,"range":{"start_line":2158,"start_character":12,"end_line":2160,"end_character":63},"updated":"2016-07-05 16:23:43.000000000","message":"Perhaps a little more context would be helpful for operators here?","commit_id":"ac471bfe947327ac5a0437198f84f7864fff2f4a"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"fead441ccde0e475b227d2eca056758d5da9f5a5","unresolved":false,"context_lines":[{"line_number":2155,"context_line":"                migration_context.new_pci_devices):"},{"line_number":2156,"context_line":"            old_pci_devices \u003d migration_context.old_pci_devices"},{"line_number":2157,"context_line":"            new_pci_devices \u003d migration_context.new_pci_devices"},{"line_number":2158,"context_line":"            LOG.debug(\"old_pci_devices: %(old)s, new_pci_devices: %(new)s\" %"},{"line_number":2159,"context_line":"                      {\u0027old\u0027: [dev for dev in old_pci_devices],"},{"line_number":2160,"context_line":"                      \u0027new\u0027: [dev for dev in new_pci_devices]})"},{"line_number":2161,"context_line":"            return {old.address: new"},{"line_number":2162,"context_line":"                    for old in old_pci_devices"},{"line_number":2163,"context_line":"                        for new in new_pci_devices"}],"source_content_type":"text/x-python","patch_set":38,"id":"1aa78d24_1f31e505","line":2160,"range":{"start_line":2158,"start_character":12,"end_line":2160,"end_character":63},"in_reply_to":"1aa78d24_b58437d4","updated":"2016-07-05 17:21:31.000000000","message":"Done","commit_id":"ac471bfe947327ac5a0437198f84f7864fff2f4a"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c572162967693e68eede973073c7d243257e499f","unresolved":false,"context_lines":[{"line_number":898,"context_line":"        if pci_request_id:"},{"line_number":899,"context_line":"            pci_dev \u003d pci_manager.get_instance_pci_devs("},{"line_number":900,"context_line":"                instance, pci_request_id).pop()"},{"line_number":901,"context_line":"            profile \u003d get_pci_device_profile(pci_dev)"},{"line_number":902,"context_line":"            port_req_body[\u0027port\u0027][\u0027binding:profile\u0027] \u003d profile"},{"line_number":903,"context_line":""},{"line_number":904,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":39,"id":"1aa78d24_11d39160","line":901,"updated":"2016-07-11 16:03:08.000000000","message":"The above changes will cause port_req_body[\u0027port\u0027][\u0027binding:profile\u0027] to be set to None if pci_whitelist.get_pci_device_devspec() returns None. This is a change in behaviour from the previous code, which would have raised an AttributeError upon previous line 896\u0027s call to devspec.get_tags(). Is this intended? Does Neutron appropriately handle the setting of binding:profile to None? If not, are we handling any error returned from the neutronclient?","commit_id":"f30d393849912cfbbd4d8fbd01ec46053b7deefe"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"35ab0b5ce43566188c11dd4f716e7cfd0a61f575","unresolved":false,"context_lines":[{"line_number":898,"context_line":"        if pci_request_id:"},{"line_number":899,"context_line":"            pci_dev \u003d pci_manager.get_instance_pci_devs("},{"line_number":900,"context_line":"                instance, pci_request_id).pop()"},{"line_number":901,"context_line":"            profile \u003d get_pci_device_profile(pci_dev)"},{"line_number":902,"context_line":"            port_req_body[\u0027port\u0027][\u0027binding:profile\u0027] \u003d profile"},{"line_number":903,"context_line":""},{"line_number":904,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":39,"id":"1aa78d24_5b3234f3","line":901,"in_reply_to":"1aa78d24_11d39160","updated":"2016-07-12 07:53:02.000000000","message":"Yes will should probably handle this in Nova anyway. We should never be in this situation.","commit_id":"f30d393849912cfbbd4d8fbd01ec46053b7deefe"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c572162967693e68eede973073c7d243257e499f","unresolved":false,"context_lines":[{"line_number":2156,"context_line":"        if (migration_context and migration_context.old_pci_devices and"},{"line_number":2157,"context_line":"                migration_context.new_pci_devices):"},{"line_number":2158,"context_line":"            old_pci_devices \u003d migration_context.old_pci_devices"},{"line_number":2159,"context_line":"            new_pci_devices \u003d migration_context.new_pci_devices"},{"line_number":2160,"context_line":"            LOG.debug(\"Determining PCI devices mapping using migration\""},{"line_number":2161,"context_line":"                      \"context: old_pci_devices: %(old)s, \""},{"line_number":2162,"context_line":"                      \"new_pci_devices: %(new)s\" %"}],"source_content_type":"text/x-python","patch_set":39,"id":"1aa78d24_71cad5a2","line":2159,"updated":"2016-07-11 16:03:08.000000000","message":"You could rewrite the above 5 lines of code to make things a bit more readable like so:\n\n migration_context \u003d instance.migration_context\n if not migration_context:\n     return {}\n\n old_pci_devices \u003d migration_context.old_pci_devices\n new_pci_devices \u003d migration_context.new_pci_devices\n if old_pci_devices and new_pci_devices:\n     ...","commit_id":"f30d393849912cfbbd4d8fbd01ec46053b7deefe"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"3415859c6067e43221797e1231dd4cdc01e95603","unresolved":false,"context_lines":[{"line_number":2156,"context_line":"        if (migration_context and migration_context.old_pci_devices and"},{"line_number":2157,"context_line":"                migration_context.new_pci_devices):"},{"line_number":2158,"context_line":"            old_pci_devices \u003d migration_context.old_pci_devices"},{"line_number":2159,"context_line":"            new_pci_devices \u003d migration_context.new_pci_devices"},{"line_number":2160,"context_line":"            LOG.debug(\"Determining PCI devices mapping using migration\""},{"line_number":2161,"context_line":"                      \"context: old_pci_devices: %(old)s, \""},{"line_number":2162,"context_line":"                      \"new_pci_devices: %(new)s\" %"}],"source_content_type":"text/x-python","patch_set":39,"id":"1aa78d24_6e55ab4e","line":2159,"in_reply_to":"1aa78d24_71cad5a2","updated":"2016-07-14 13:29:54.000000000","message":"Done","commit_id":"f30d393849912cfbbd4d8fbd01ec46053b7deefe"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c572162967693e68eede973073c7d243257e499f","unresolved":false,"context_lines":[{"line_number":2205,"context_line":"            port_updates.append((p[\u0027id\u0027], updates))"},{"line_number":2206,"context_line":""},{"line_number":2207,"context_line":"        # Avoid rolling back updates if we catch an error above."},{"line_number":2208,"context_line":"        # TODO(lbeliveau): Serialize the port updates in one neutron call."},{"line_number":2209,"context_line":"        for port_id, updates in port_updates:"},{"line_number":2210,"context_line":"            if updates:"},{"line_number":2211,"context_line":"                LOG.info(_LI(\"Updating port %(port)s with \""}],"source_content_type":"text/x-python","patch_set":39,"id":"1aa78d24_51cd19b6","line":2208,"updated":"2016-07-11 16:03:08.000000000","message":"s/Serialize/Batch up/ :)","commit_id":"f30d393849912cfbbd4d8fbd01ec46053b7deefe"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"3415859c6067e43221797e1231dd4cdc01e95603","unresolved":false,"context_lines":[{"line_number":2205,"context_line":"            port_updates.append((p[\u0027id\u0027], updates))"},{"line_number":2206,"context_line":""},{"line_number":2207,"context_line":"        # Avoid rolling back updates if we catch an error above."},{"line_number":2208,"context_line":"        # TODO(lbeliveau): Serialize the port updates in one neutron call."},{"line_number":2209,"context_line":"        for port_id, updates in port_updates:"},{"line_number":2210,"context_line":"            if updates:"},{"line_number":2211,"context_line":"                LOG.info(_LI(\"Updating port %(port)s with \""}],"source_content_type":"text/x-python","patch_set":39,"id":"1aa78d24_ae4b13b0","line":2208,"in_reply_to":"1aa78d24_51cd19b6","updated":"2016-07-14 13:29:54.000000000","message":"Done","commit_id":"f30d393849912cfbbd4d8fbd01ec46053b7deefe"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"e19f33645dda9e3e2fbda8df0a92ee9a31573687","unresolved":false,"context_lines":[{"line_number":178,"context_line":""},{"line_number":179,"context_line":"def get_pci_device_profile(pci_dev):"},{"line_number":180,"context_line":"    dev_spec \u003d pci_whitelist.get_pci_device_devspec(pci_dev)"},{"line_number":181,"context_line":"    if dev_spec:"},{"line_number":182,"context_line":"        return {\u0027pci_vendor_info\u0027: \"%s:%s\" %"},{"line_number":183,"context_line":"                    (pci_dev.vendor_id, pci_dev.product_id),"},{"line_number":184,"context_line":"                \u0027pci_slot\u0027: pci_dev.address,"}],"source_content_type":"text/x-python","patch_set":40,"id":"1aa78d24_3ea46ca4","line":181,"updated":"2016-07-12 11:13:32.000000000","message":"As Jay mentioned we should handle the case where dev_spec is None - That should never happen but in such case I\u0027d recommend to raise a NovaException or a more specific DeviceNotFound exception. \n\nThe method update_port_for_instance is going to catch it and start a rollback process.","commit_id":"ff948916a20d9750504698f1a3ffa24511d7b454"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"6b0e0a241205d2b7e2f8347e0c912ace049afd86","unresolved":false,"context_lines":[{"line_number":178,"context_line":""},{"line_number":179,"context_line":"def get_pci_device_profile(pci_dev):"},{"line_number":180,"context_line":"    dev_spec \u003d pci_whitelist.get_pci_device_devspec(pci_dev)"},{"line_number":181,"context_line":"    if dev_spec:"},{"line_number":182,"context_line":"        return {\u0027pci_vendor_info\u0027: \"%s:%s\" %"},{"line_number":183,"context_line":"                    (pci_dev.vendor_id, pci_dev.product_id),"},{"line_number":184,"context_line":"                \u0027pci_slot\u0027: pci_dev.address,"}],"source_content_type":"text/x-python","patch_set":40,"id":"1aa78d24_ab9a6a6c","line":181,"in_reply_to":"1aa78d24_3ea46ca4","updated":"2016-07-14 13:29:43.000000000","message":"Done","commit_id":"ff948916a20d9750504698f1a3ffa24511d7b454"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"b926095ae08f5c6ff8c9e1ca38e614e2b6f43a31","unresolved":false,"context_lines":[{"line_number":2142,"context_line":"        \"\"\"Cleanup network for specified instance on host.\"\"\""},{"line_number":2143,"context_line":"        pass"},{"line_number":2144,"context_line":""},{"line_number":2145,"context_line":"    def _get_pci_mapping_for_migration(self, context, instance):"},{"line_number":2146,"context_line":"        \"\"\"Get the mapping between the old PCI devices and the new PCI"},{"line_number":2147,"context_line":"        devices that have been allocated during this migration.  The"},{"line_number":2148,"context_line":"        correlation is based on PCI request ID which is unique per PCI"}],"source_content_type":"text/x-python","patch_set":40,"id":"1aa78d24_5c4060a5","line":2145,"updated":"2016-07-12 11:57:49.000000000","message":"I\u0027d be happy to see a specific test for this method even if we can see that a test is validating the behavior. This method is going to be updated for the next patch serie so I guess it\u0027s something we can do.","commit_id":"ff948916a20d9750504698f1a3ffa24511d7b454"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"6b0e0a241205d2b7e2f8347e0c912ace049afd86","unresolved":false,"context_lines":[{"line_number":2142,"context_line":"        \"\"\"Cleanup network for specified instance on host.\"\"\""},{"line_number":2143,"context_line":"        pass"},{"line_number":2144,"context_line":""},{"line_number":2145,"context_line":"    def _get_pci_mapping_for_migration(self, context, instance):"},{"line_number":2146,"context_line":"        \"\"\"Get the mapping between the old PCI devices and the new PCI"},{"line_number":2147,"context_line":"        devices that have been allocated during this migration.  The"},{"line_number":2148,"context_line":"        correlation is based on PCI request ID which is unique per PCI"}],"source_content_type":"text/x-python","patch_set":40,"id":"1aa78d24_2b867adb","line":2145,"in_reply_to":"1aa78d24_5c4060a5","updated":"2016-07-14 13:29:43.000000000","message":"Done","commit_id":"ff948916a20d9750504698f1a3ffa24511d7b454"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e22248feb23623fd968fca600591d35d48c2a7d8","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                \u0027pci_slot\u0027: pci_dev.address,"},{"line_number":185,"context_line":"                \u0027physical_network\u0027:"},{"line_number":186,"context_line":"                    dev_spec.get_tags().get(\u0027physical_network\u0027)}"},{"line_number":187,"context_line":"    raise exception.PciDeviceNotFound(node_id\u003dpci_dev.compute_node_id,"},{"line_number":188,"context_line":"                                      address\u003dpci_dev.address)"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":""}],"source_content_type":"text/x-python","patch_set":42,"id":"dada55a8_6997533a","line":187,"updated":"2016-07-20 21:10:57.000000000","message":"This isn\u0027t handled anywhere in here, but looking at the call stack I think what happens is we deallocate/unbind ports and then reraise it, where the compute manager doesn\u0027t handle it and just reschedules, right?","commit_id":"dfdae01bd03f522ffab7876b253ec41641934702"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"2c50daec3e7658fe60e3691999b2c8c1dda7e3ae","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                \u0027pci_slot\u0027: pci_dev.address,"},{"line_number":185,"context_line":"                \u0027physical_network\u0027:"},{"line_number":186,"context_line":"                    dev_spec.get_tags().get(\u0027physical_network\u0027)}"},{"line_number":187,"context_line":"    raise exception.PciDeviceNotFound(node_id\u003dpci_dev.compute_node_id,"},{"line_number":188,"context_line":"                                      address\u003dpci_dev.address)"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":""}],"source_content_type":"text/x-python","patch_set":42,"id":"dada55a8_6cdbe14f","line":187,"in_reply_to":"dada55a8_6997533a","updated":"2016-07-20 21:31:55.000000000","message":"You are right, the ports are deallocated/unbinded in case of errors.  But I\u0027m not too sure if the instance gets re-scheduled.  Actually I think it will just go in error state.\n\nSimilarly, get_tags() can throw an exception if \"physical_network\" was not defined in the pci whitelist.  So this patch shouldn\u0027t change the current behavior regarding exception handling.","commit_id":"dfdae01bd03f522ffab7876b253ec41641934702"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e3cbf08acbeec4cf19e957006cc18e62cbb0252f","unresolved":false,"context_lines":[{"line_number":2182,"context_line":"            return {old.address: new"},{"line_number":2183,"context_line":"                    for old in old_pci_devices"},{"line_number":2184,"context_line":"                        for new in new_pci_devices"},{"line_number":2185,"context_line":"                            if old.request_id \u003d\u003d new.request_id}"},{"line_number":2186,"context_line":"        return {}"},{"line_number":2187,"context_line":""},{"line_number":2188,"context_line":"    def _update_port_binding_for_instance(self, context, instance, host):"}],"source_content_type":"text/x-python","patch_set":42,"id":"dada55a8_ac0e7938","line":2185,"range":{"start_line":2185,"start_character":28,"end_line":2185,"end_character":63},"updated":"2016-07-20 21:49:34.000000000","message":"break the loop?","commit_id":"dfdae01bd03f522ffab7876b253ec41641934702"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"b7a08e5e4c7db0f27ff2696b5ef7c330e3be9012","unresolved":false,"context_lines":[{"line_number":2182,"context_line":"            return {old.address: new"},{"line_number":2183,"context_line":"                    for old in old_pci_devices"},{"line_number":2184,"context_line":"                        for new in new_pci_devices"},{"line_number":2185,"context_line":"                            if old.request_id \u003d\u003d new.request_id}"},{"line_number":2186,"context_line":"        return {}"},{"line_number":2187,"context_line":""},{"line_number":2188,"context_line":"    def _update_port_binding_for_instance(self, context, instance, host):"}],"source_content_type":"text/x-python","patch_set":42,"id":"dada55a8_4ca9b88f","line":2185,"range":{"start_line":2185,"start_character":28,"end_line":2185,"end_character":63},"in_reply_to":"dada55a8_1d6091a4","updated":"2016-07-21 00:11:59.000000000","message":"Right, we could change the logic in the resource tracker (and pci tracker) to manage the mappings and avoid any looping (like you are suggesting).  But currently, we are creating new PCI requests (based on the new flavour and existing SR-IOV ports) and are re-allocating new PCI devices based on the new requests (meaning we don\u0027t iterate through each individual PCI devices and re-allocate PCI device one by one).\n\nWe would also need to store the mapping in the MigrationContext object.\n\nSee https://github.com/openstack/nova/blob/master/nova/compute/resource_tracker.py#L179\n\nI\u0027m up to looking into this kind of optimizations once all the bugs related to migration are fixed.","commit_id":"dfdae01bd03f522ffab7876b253ec41641934702"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"acf31be445ce5bab05e4452efaf0d04c595c2880","unresolved":false,"context_lines":[{"line_number":2182,"context_line":"            return {old.address: new"},{"line_number":2183,"context_line":"                    for old in old_pci_devices"},{"line_number":2184,"context_line":"                        for new in new_pci_devices"},{"line_number":2185,"context_line":"                            if old.request_id \u003d\u003d new.request_id}"},{"line_number":2186,"context_line":"        return {}"},{"line_number":2187,"context_line":""},{"line_number":2188,"context_line":"    def _update_port_binding_for_instance(self, context, instance, host):"}],"source_content_type":"text/x-python","patch_set":42,"id":"dada55a8_b7c36656","line":2185,"range":{"start_line":2185,"start_character":28,"end_line":2185,"end_character":63},"in_reply_to":"dada55a8_ac0e7938","updated":"2016-07-20 21:59:07.000000000","message":"Yes.  This means we have a match on request_id and we\u0027ll use \"new\" for the mapping of this device.\n\nAs mentioned in the comments above, request_id is unique per SR-IOV devices.","commit_id":"dfdae01bd03f522ffab7876b253ec41641934702"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2dae571a323be9f9f8515c72e425a3dbf7ba5327","unresolved":false,"context_lines":[{"line_number":2182,"context_line":"            return {old.address: new"},{"line_number":2183,"context_line":"                    for old in old_pci_devices"},{"line_number":2184,"context_line":"                        for new in new_pci_devices"},{"line_number":2185,"context_line":"                            if old.request_id \u003d\u003d new.request_id}"},{"line_number":2186,"context_line":"        return {}"},{"line_number":2187,"context_line":""},{"line_number":2188,"context_line":"    def _update_port_binding_for_instance(self, context, instance, host):"}],"source_content_type":"text/x-python","patch_set":42,"id":"dada55a8_1d6091a4","line":2185,"range":{"start_line":2185,"start_character":28,"end_line":2185,"end_character":63},"in_reply_to":"dada55a8_b7c36656","updated":"2016-07-20 22:52:15.000000000","message":"Yeah, but my point is once we find the match we don\u0027t need to keep looping, we could break the loop. That could be a later optimisation though. We could have also created a mapping of the request_id to the new device before this, then we wouldn\u0027t need the nested loops, but meh.","commit_id":"dfdae01bd03f522ffab7876b253ec41641934702"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2b79db940f5a2dd6c1cb5c223b853df3a766c542","unresolved":false,"context_lines":[{"line_number":2192,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":2193,"context_line":"                       \u0027tenant_id\u0027: instance.project_id}"},{"line_number":2194,"context_line":"        data \u003d neutron.list_ports(**search_opts)"},{"line_number":2195,"context_line":"        pci_mapping \u003d self._get_pci_mapping_for_migration(context, instance)"},{"line_number":2196,"context_line":"        port_updates \u003d []"},{"line_number":2197,"context_line":"        ports \u003d data[\u0027ports\u0027]"},{"line_number":2198,"context_line":"        for p in ports:"}],"source_content_type":"text/x-python","patch_set":42,"id":"dada55a8_5bbcb0ba","line":2195,"updated":"2016-07-21 13:53:25.000000000","message":"We won\u0027t use this if vnic_type is not in network_model.VNIC_TYPES_SRIOV, so we could optimize to only get this mapping once if needed, but that could be a later optimisation.","commit_id":"dfdae01bd03f522ffab7876b253ec41641934702"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2b79db940f5a2dd6c1cb5c223b853df3a766c542","unresolved":false,"context_lines":[{"line_number":2233,"context_line":"                    neutron.update_port(port_id, {\u0027port\u0027: updates})"},{"line_number":2234,"context_line":"                except Exception:"},{"line_number":2235,"context_line":"                    with excutils.save_and_reraise_exception():"},{"line_number":2236,"context_line":"                        LOG.exception(_LE(\"Unable to update host of port %s\"),"},{"line_number":2237,"context_line":"                                      port_id, instance\u003dinstance)"},{"line_number":2238,"context_line":""},{"line_number":2239,"context_line":"    def update_instance_vnic_index(self, context, instance, vif, index):"}],"source_content_type":"text/x-python","patch_set":42,"id":"dada55a8_7b15349a","line":2236,"range":{"start_line":2236,"start_character":60,"end_line":2236,"end_character":64},"updated":"2016-07-21 13:53:25.000000000","message":"nit: it\u0027s more than just the host potentially. We should probably say \"Unable to update binding details for port %s\". But that could come in a separate change.","commit_id":"dfdae01bd03f522ffab7876b253ec41641934702"}],"nova/pci/manager.py":[{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"522b59faf1c95f5e4d1740b548e63273f285f0b8","unresolved":false,"context_lines":[{"line_number":298,"context_line":"      soft_reboot and hard_boot of \u0027xen\u0027 instances."},{"line_number":299,"context_line":"    \"\"\""},{"line_number":300,"context_line":"    pci_devices \u003d inst.pci_devices"},{"line_number":301,"context_line":"    return [device for device in pci_devices if"},{"line_number":302,"context_line":"                   (device.request_id \u003d\u003d request_id or request_id \u003d\u003d \u0027all\u0027) and"},{"line_number":303,"context_line":"                   (compute_id is None or"},{"line_number":304,"context_line":"                    device.compute_node_id \u003d\u003d compute_id)]"}],"source_content_type":"text/x-python","patch_set":17,"id":"1af94dfe_53bf28d0","line":304,"range":{"start_line":301,"start_character":0,"end_line":304,"end_character":58},"updated":"2016-03-15 21:03:38.000000000","message":"not sure if it help, but the inst.pci_devices on the source node has the same inst.pci_devices on the destination node.\nsee http://paste.openstack.org/show/490598/\nI am not familiar with the implementation but because this code run on the compute I would assume that the inst.pci_devices will be updated with the destination pci_device chosen by the scheduler/conductor so adding \ndevice.compute_node_id \u003d\u003d compute_id just seem wrong.","commit_id":"695d47c6267b868374910cc34e0a13d48bcfe381"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"2cb0c7a1a11c1ecec08753815fe97715f09e02fb","unresolved":false,"context_lines":[{"line_number":298,"context_line":"      soft_reboot and hard_boot of \u0027xen\u0027 instances."},{"line_number":299,"context_line":"    \"\"\""},{"line_number":300,"context_line":"    pci_devices \u003d inst.pci_devices"},{"line_number":301,"context_line":"    return [device for device in pci_devices if"},{"line_number":302,"context_line":"                   (device.request_id \u003d\u003d request_id or request_id \u003d\u003d \u0027all\u0027) and"},{"line_number":303,"context_line":"                   (compute_id is None or"},{"line_number":304,"context_line":"                    device.compute_node_id \u003d\u003d compute_id)]"}],"source_content_type":"text/x-python","patch_set":17,"id":"1a122d0e_55ceff83","line":304,"range":{"start_line":301,"start_character":0,"end_line":304,"end_character":58},"in_reply_to":"1af94dfe_53bf28d0","updated":"2016-04-15 13:36:08.000000000","message":"Done","commit_id":"695d47c6267b868374910cc34e0a13d48bcfe381"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"604ed02e8b799d114406d2dd49fd35e774e22e16","unresolved":false,"context_lines":[{"line_number":298,"context_line":"      soft_reboot and hard_boot of \u0027xen\u0027 instances."},{"line_number":299,"context_line":"    \"\"\""},{"line_number":300,"context_line":"    pci_devices \u003d inst.pci_devices"},{"line_number":301,"context_line":"    return [device for device in pci_devices if"},{"line_number":302,"context_line":"                   (device.request_id \u003d\u003d request_id or request_id \u003d\u003d \u0027all\u0027) and"},{"line_number":303,"context_line":"                   (compute_id is None or"},{"line_number":304,"context_line":"                    device.compute_node_id \u003d\u003d compute_id)]"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa0719c6_7c3651e8","line":304,"range":{"start_line":301,"start_character":0,"end_line":304,"end_character":58},"in_reply_to":"1af94dfe_53bf28d0","updated":"2016-03-22 07:17:11.000000000","message":"we need this. because on destination, instance pci_devices contain all device allocated to it, include the old pci_devices in the source machine.","commit_id":"695d47c6267b868374910cc34e0a13d48bcfe381"}],"nova/pci/whitelist.py":[{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"6327b5fa203f4eaa33379f132ea9ea9707bc7a24","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                \u0027physical_network\u0027:"},{"line_number":121,"context_line":"                    dev_spec.get_tags().get(\u0027physical_network\u0027),"},{"line_number":122,"context_line":"                \u0027pci_request_id\u0027: pci_dev.request_id}"},{"line_number":123,"context_line":"    return None"}],"source_content_type":"text/x-python","patch_set":5,"id":"da85f559_6f67edb7","line":123,"updated":"2015-11-13 23:39:56.000000000","message":"you can remove the return None. python will return none even when you don\u0027t return a value. \nI would prefer you change it to throw an exception","commit_id":"77587a616f4bbb9f40418dd6b4b230257a752f27"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"ebf4b0d7f3b846b3ae5fbd4bbf8fcbaaa88a6a05","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                \u0027physical_network\u0027:"},{"line_number":121,"context_line":"                    dev_spec.get_tags().get(\u0027physical_network\u0027),"},{"line_number":122,"context_line":"                \u0027pci_request_id\u0027: pci_dev.request_id}"},{"line_number":123,"context_line":"    return None"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_5c69ba8a","line":123,"in_reply_to":"da85f559_6f67edb7","updated":"2015-11-16 14:07:30.000000000","message":"Done","commit_id":"77587a616f4bbb9f40418dd6b4b230257a752f27"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"9289742dafe4202504c5536b13a2b9e69175eccc","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    return dev_filter.get_devspec(pci_dev)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"def get_pci_device_profile(pci_dev):"},{"line_number":115,"context_line":"    dev_spec \u003d get_pci_device_devspec(pci_dev)"},{"line_number":116,"context_line":"    if dev_spec:"},{"line_number":117,"context_line":"        return {\u0027pci_vendor_info\u0027: \"%s:%s\" %"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba8a016a_fda4e9b9","line":114,"updated":"2015-11-17 15:30:55.000000000","message":"I don\u0027t believe that this method belongs here. This is network specific method, and should stay in neutronv2/api.py","commit_id":"89c38393a626ae035e6bfcb841637de175819cc7"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"374b944acc258d9276bd8520eb561fc04774bf68","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    return dev_filter.get_devspec(pci_dev)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"def get_pci_device_profile(pci_dev):"},{"line_number":115,"context_line":"    dev_spec \u003d get_pci_device_devspec(pci_dev)"},{"line_number":116,"context_line":"    if dev_spec:"},{"line_number":117,"context_line":"        return {\u0027pci_vendor_info\u0027: \"%s:%s\" %"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba8a016a_f6e0fb2a","line":114,"in_reply_to":"ba8a016a_fda4e9b9","updated":"2015-11-19 18:58:31.000000000","message":"Done","commit_id":"89c38393a626ae035e6bfcb841637de175819cc7"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c572162967693e68eede973073c7d243257e499f","unresolved":false,"context_lines":[{"line_number":3656,"context_line":"                          self.api._update_port_binding_for_instance,"},{"line_number":3657,"context_line":"                          self.context,"},{"line_number":3658,"context_line":"                          instance,"},{"line_number":3659,"context_line":"                          instance.host)"},{"line_number":3660,"context_line":""},{"line_number":3661,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.compute_utils\u0027)"},{"line_number":3662,"context_line":"    def test_get_preexisting_port_ids(self, mocked_comp_utils):"}],"source_content_type":"text/x-python","patch_set":39,"id":"1aa78d24_31d04d53","line":3659,"updated":"2016-07-11 16:03:08.000000000","message":"Due to the changed behaviour in the get_pci_dev_profile() function, you need to add a unit test that stresses when None is returned from get_pci_device_devspec() returns None, since you will now be sending neutron a binding:profile key with value None in it...","commit_id":"f30d393849912cfbbd4d8fbd01ec46053b7deefe"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"7a9993a01fc84a86c7824bb584e8024428a87b6b","unresolved":false,"context_lines":[{"line_number":3681,"context_line":""},{"line_number":3682,"context_line":"        pci_mapping \u003d self.api._get_pci_mapping_for_migration("},{"line_number":3683,"context_line":"            self.context, instance)"},{"line_number":3684,"context_line":"        self.assertEqual({\u00270000:0a:00.1\u0027: new_pci_devices[0]}, pci_mapping)"},{"line_number":3685,"context_line":""},{"line_number":3686,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.compute_utils\u0027)"},{"line_number":3687,"context_line":"    def test_get_preexisting_port_ids(self, mocked_comp_utils):"}],"source_content_type":"text/x-python","patch_set":41,"id":"dada55a8_8ef1496d","line":3684,"updated":"2016-07-19 11:44:59.000000000","message":"nit: maybe it is more clear to see: s/\u00270000:0a:00.1\u0027/old_pci_devices[0].address","commit_id":"be69f354818e94e2b9938c9efd3f13e5278ed918"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"04710a47013b337bfb1f4a38fd1d8d3f0be979d5","unresolved":false,"context_lines":[{"line_number":3681,"context_line":""},{"line_number":3682,"context_line":"        pci_mapping \u003d self.api._get_pci_mapping_for_migration("},{"line_number":3683,"context_line":"            self.context, instance)"},{"line_number":3684,"context_line":"        self.assertEqual({\u00270000:0a:00.1\u0027: new_pci_devices[0]}, pci_mapping)"},{"line_number":3685,"context_line":""},{"line_number":3686,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.compute_utils\u0027)"},{"line_number":3687,"context_line":"    def test_get_preexisting_port_ids(self, mocked_comp_utils):"}],"source_content_type":"text/x-python","patch_set":41,"id":"dada55a8_f48258ff","line":3684,"in_reply_to":"dada55a8_8ef1496d","updated":"2016-07-19 13:44:40.000000000","message":"Done","commit_id":"be69f354818e94e2b9938c9efd3f13e5278ed918"}]}
