libxl / libxlu: support 'xl pci-attach/detach' by name
authorPaul Durrant <pdurrant@amazon.com>
Tue, 5 Jan 2021 17:46:42 +0000 (17:46 +0000)
committerWei Liu <wl@xen.org>
Thu, 21 Jan 2021 15:20:40 +0000 (15:20 +0000)
commit9cd5bbf5369d520aacca9a1b141e9a84f62d507d
tree5e8974967fa844ec077d15500ca54653266f6dde
parentd288f62da14d45b127508236d20385f64924e1f6
libxl / libxlu: support 'xl pci-attach/detach' by name

This patch modifies libxlu_pci_parse_spec_string() to parse the new 'name'
parameter of PCI_SPEC_STRING detailed in the updated documention in
xl-pci-configuration(5) and populate the 'name' field of 'libxl_device_pci'.

If the 'name' field is non-NULL then both libxl_device_pci_add() and
libxl_device_pci_remove() will use it to look up the device BDF in
the list of assignable devices.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Wei Liu <wl@xen.org>
tools/libs/light/libxl_pci.c
tools/libs/util/libxlu_pci.c