1027f34 hw/pci-bridge: fix QEMU crash because of pcie-root-port

1 file Authored by Marcel Apfelbaum 6 years ago, Committed by Michael Roth 6 years ago,
    hw/pci-bridge: fix QEMU crash because of pcie-root-port
    
    If we try to use more pcie_root_ports then available slots
    and an IO hint is passed to the port, QEMU crashes because
    we try to init the "IO hint" capability even if the device
    is not created.
    Fix it by checking for error before adding the capability,
    so QEMU can fail gracefully.
    
    Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit fced4d00e68e7559c73746d963265f7fd0b6abf9)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>