libxl: add libxl_device_pci_assignable_list_free()...
authorPaul Durrant <pdurrant@amazon.com>
Tue, 8 Dec 2020 19:30:21 +0000 (19:30 +0000)
committerWei Liu <wl@xen.org>
Tue, 15 Dec 2020 16:24:23 +0000 (16:24 +0000)
commitc00da823550d0ff63d99b1b48effd6728bee156e
tree9d6150c73cac6516e225e55dff723af56613dedc
parent7499b22ba1f68237c201da8534706dbe430987d5
libxl: add libxl_device_pci_assignable_list_free()...

... to be used by callers of libxl_device_pci_assignable_list().

Currently there is no API for callers of libxl_device_pci_assignable_list()
to free the list. The xl function pciassignable_list() calls
libxl_device_pci_dispose() on each element of the returned list, but
libxl_pci_assignable() in libxl_pci.c does not. Neither does the implementation
of libxl_device_pci_assignable_list() call libxl_device_pci_init().

This patch adds the new API function, makes sure it is used everywhere and
also modifies libxl_device_pci_assignable_list() to initialize list
entries rather than just zeroing them.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Acked-by: Wei Liu <wl@xen.org>
tools/include/libxl.h
tools/libs/light/libxl_pci.c
tools/ocaml/libs/xl/xenlight_stubs.c
tools/xl/xl_pci.c