Closed tmakatos closed 4 years ago
Ideally we'd like to have a flexible array member at the end of lm_dev_info_t
for each capability, where each element of the array would be a union of all possible capability types. However I don't think this is possible as there can be vendor-specific capabillities of unknown size. Therefore the more realistic option would be to introduce a function e.g. lm_pci_cap_add
that adds a capability to an existing context. @franciozzy thoughts?
Actually I think the current implementation can work, either way the user will be maintaining a pointer to their capability, so all we need to do is to replace the fn
field with a buf
field in lm_cap_t
.
I'm looking at the PCI specification and I'm not sure how much of it we can handle in the library we need to go through the spec very thoroughly.
I've moved handling of PCI capabilities into MUSER in my vfio-over-socket branch. Capabilities are still maintained in a list which I think need to be replaced by keeping them in a buffer.
fixed in vfio-user branch
Currently handling of standard PCI capabilities is left to the device implementation, however that shouldn't be the case as it's the same for all kinds of devices.