Skip to content
  • Alex Williamson's avatar
    PCI: Bus number from the bridge, not the device · 7f5feab4
    Alex Williamson authored
    
    
    pcibus_dev_print() was erroneously retrieving the device bus
    number from the secondary bus number offset of the device
    instead of the bridge above the device.  This ends of landing
    in the 2nd byte of the 3rd BAR for devices, which thankfully
    is usually zero.
    
    Note: pcibus_get_dev_path() copied this code,
    inheriting the same bug.  pcibus_get_dev_path() is used for
    ramblock naming, so changing it can effect migration.  However,
    I've only seen this byte be non-zero for an assigned device,
    which can't migrate anyway, so hopefully we won't run into
    any issues.
    
    This patch does not touch pcibus_get_dev_path, as
    bus number is guest assigned for nested buses,
    so using it for migration is broken anyway.
    Fix it properly later.
    
    Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    7f5feab4