libxl: generalise 'driver_path' xenstore access functions in libxl_pci.c
authorPaul Durrant <pdurrant@amazon.com>
Tue, 8 Dec 2020 19:30:17 +0000 (19:30 +0000)
committerWei Liu <wl@xen.org>
Tue, 15 Dec 2020 16:24:23 +0000 (16:24 +0000)
commitfe91a3aadc038adbc2954e9a66e88493121a232e
treecd38d7d6ddc0aa2a5e496738aaaf7af9a7395afd
parentb5429d65e1827c4086b2195f594574abd65eb46d
libxl: generalise 'driver_path' xenstore access functions in libxl_pci.c

For the purposes of re-binding a device to its previous driver
libxl__device_pci_assignable_add() writes the driver path into xenstore.
This path is then read back in libxl__device_pci_assignable_remove().

The functions that support this writing to and reading from xenstore are
currently dedicated for this purpose and hence the node name 'driver_path'
is hard-coded. This patch generalizes these utility functions and passes
'driver_path' as an argument. Subsequent patches will invoke them to
access other nodes.

NOTE: Because functions will have a broader use (other than storing a
      driver path in lieu of pciback) the base xenstore path is also
      changed from '/libxl/pciback' to '/libxl/pci'.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Acked-by: Wei Liu <wl@xen.org>
tools/libs/light/libxl_pci.c