On 11/10/2019 10.56, Stefan Hajnoczi wrote: > VIRTIO 1.0 PCI devices have multiple PCI_CAP_ID_VNDR capabilities so we > need a way to iterate over them. Extend qpci_find_capability() to take > the last address. > > Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com> > --- > tests/libqos/pci.h | 2 +- > tests/libqos/pci.c | 18 ++++++++++++------ > 2 files changed, 13 insertions(+), 7 deletions(-) > > diff --git a/tests/libqos/pci.h b/tests/libqos/pci.h > index a5389a5845..590c175190 100644 > --- a/tests/libqos/pci.h > +++ b/tests/libqos/pci.h > @@ -86,7 +86,7 @@ bool qpci_has_buggy_msi(QPCIDevice *dev); > bool qpci_check_buggy_msi(QPCIDevice *dev); > > void qpci_device_enable(QPCIDevice *dev); > -uint8_t qpci_find_capability(QPCIDevice *dev, uint8_t id); > +uint8_t qpci_find_capability(QPCIDevice *dev, uint8_t id, uint8_t > start_addr);
In case you respin, I'd like to suggest to add a comment in front of that prototype, explaining how the start_addr is meant to work (but the source code is trivial enough, so there's no need to respin just because of this, IMHO). Reviewed-by: Thomas Huth <th...@redhat.com>