On Thu, Dec 03, 2020 at 02:25:30PM +0000, Paul Durrant wrote: > From: Paul Durrant <pdurr...@amazon.com> > > ... to use 'libxl_pci_bdf' rather than 'libxl_device_pci'. > > This patch modifies the API and callers accordingly. It also modifies > several internal functions in libxl_pci.c that support the API to also use > 'libxl_pci_bdf'. > > NOTE: The OCaml bindings are adjusted to contain the interface change. It > should therefore not affect compatibility with OCaml-based utilities. > > Signed-off-by: Paul Durrant <pdurr...@amazon.com> > Acked-by: Christian Lindig <christian.lin...@citrix.com>
> --- > Cc: Ian Jackson <i...@xenproject.org> > Cc: Wei Liu <w...@xen.org> > Cc: David Scott <d...@recoil.org> > Cc: Anthony PERARD <anthony.per...@citrix.com> > --- > tools/include/libxl.h | 15 +- > tools/libs/light/libxl_pci.c | 213 +++++++++++++++------------ > tools/ocaml/libs/xl/xenlight_stubs.c | 15 +- > tools/xl/xl_pci.c | 32 ++-- > 4 files changed, 156 insertions(+), 119 deletions(-) > > diff --git a/tools/include/libxl.h b/tools/include/libxl.h > index 5edacccbd1da..5703fdf367c5 100644 > --- a/tools/include/libxl.h > +++ b/tools/include/libxl.h > @@ -469,6 +469,13 @@ > */ > #define LIBXL_HAVE_PCI_BDF 1 > > +/* > + * LIBXL_HAVE_PCI_ASSIGNABLE_BDF indicates that the > + * libxl_device_pci_assignable_add/remove/list/list_free() functions all > + * use the 'libxl_pci_bdf' type rather than 'libxl_device_pci' type. > + */ > +#define LIBXL_HAVE_PCI_ASSIGNABLE_BDF 1 > + > /* > * libxl ABI compatibility > * > @@ -2378,10 +2385,10 @@ int libxl_device_events_handler(libxl_ctx *ctx, > * added or is not bound, the functions will emit a warning but return > * SUCCESS. > */ > -int libxl_device_pci_assignable_add(libxl_ctx *ctx, libxl_device_pci *pci, > int rebind); > -int libxl_device_pci_assignable_remove(libxl_ctx *ctx, libxl_device_pci > *pci, int rebind); > -libxl_device_pci *libxl_device_pci_assignable_list(libxl_ctx *ctx, int *num); > -void libxl_device_pci_assignable_list_free(libxl_device_pci *list, int num); > +int libxl_device_pci_assignable_add(libxl_ctx *ctx, libxl_pci_bdf *pcibdf, > int rebind); > +int libxl_device_pci_assignable_remove(libxl_ctx *ctx, libxl_pci_bdf > *pcibdf, int rebind); > +libxl_pci_bdf *libxl_device_pci_assignable_list(libxl_ctx *ctx, int *num); > +void libxl_device_pci_assignable_list_free(libxl_pci_bdf *list, int num); Given these APIs are visible to external callers, you will need to provide fallbacks for the old APIs. Wei.