@@ -3512,15 +3512,15 @@ def _get_pci_mapping_for_migration(self, instance, migration):
35123512 migration .get ('status' ) == 'reverted' )
35133513 return instance .migration_context .get_pci_mapping_for_migration (revert )
35143514
3515- def _get_port_pci_slot (self , context , instance , port ):
3516- """Find the PCI address of the device corresponding to the port.
3515+ def _get_port_pci_dev (self , context , instance , port ):
3516+ """Find the PCI device corresponding to the port.
35173517 Assumes the port is an SRIOV one.
35183518
35193519 :param context: The request context.
35203520 :param instance: The instance to which the port is attached.
35213521 :param port: The Neutron port, as obtained from the Neutron API
35223522 JSON form.
3523- :return: The PCI address as a string , or None if unable to find.
3523+ :return: The PciDevice object , or None if unable to find.
35243524 """
35253525 # Find the port's PCIRequest, or return None
35263526 for r in instance .pci_requests .requests :
@@ -3540,8 +3540,7 @@ def _get_port_pci_slot(self, context, instance, port):
35403540 LOG .debug ('No PCI device found for request %s' ,
35413541 request .request_id , instance = instance )
35423542 return None
3543- # Return the device's PCI address
3544- return device .address
3543+ return device
35453544
35463545 def _update_port_binding_for_instance (
35473546 self , context , instance , host , migration = None ,
@@ -3609,9 +3608,11 @@ def _update_port_binding_for_instance(
36093608 # need to figure out the pci_slot from the InstancePCIRequest
36103609 # and PciDevice objects.
36113610 else :
3612- pci_slot = self ._get_port_pci_slot (context , instance , p )
3613- if pci_slot :
3614- binding_profile .update ({'pci_slot' : pci_slot })
3611+ pci_dev = self ._get_port_pci_dev (context , instance , p )
3612+ if pci_dev :
3613+ binding_profile .update (
3614+ self ._get_pci_device_profile (pci_dev )
3615+ )
36153616 updates [constants .BINDING_PROFILE ] = binding_profile
36163617
36173618 # NOTE(gibi): during live migration the conductor already sets the
0 commit comments