libxl: Make sure devices added by pci-attach are reflected in the config
authorPaul Durrant <pdurrant@amazon.com>
Tue, 8 Dec 2020 19:30:12 +0000 (19:30 +0000)
committerWei Liu <wl@xen.org>
Tue, 15 Dec 2020 16:24:23 +0000 (16:24 +0000)
commit0fdb48ffe7a1a56745b999506bf572e260e8ae0a
treea3f9c717bee55662f33c7caba2267f579df34476
parentfce69998edd7583417c833fe1bf3347efcdc93e7
libxl: Make sure devices added by pci-attach are reflected in the config

Currently libxl__device_pci_add_xenstore() is broken in that does not
update the domain's configuration for the first device added (which causes
creation of the overall backend area in xenstore). This can be easily observed
by running 'xl list -l' after adding a single device: the device will be
missing.

This patch fixes the problem and adds a DEBUG log line to allow easy
verification that the domain configuration is being modified. Also, the use
of libxl__device_generic_add() is dropped as it leads to a confusing situation
where only partial backend information is written under the xenstore
'/libxl' path. For LIBXL__DEVICE_KIND_PCI devices the only definitive
information in xenstore is under '/local/domain/0/backend' (the '0' being
hard-coded).

NOTE: This patch includes a whitespace in add_pcis_done().

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