libxl: s/pcidev/pci and remove DEFINE_DEVICE_TYPE_STRUCT_X
authorPaul Durrant <pdurrant@amazon.com>
Tue, 8 Dec 2020 19:30:09 +0000 (19:30 +0000)
committerWei Liu <wl@xen.org>
Tue, 15 Dec 2020 16:24:16 +0000 (16:24 +0000)
commite43780f15f13216c1ccef0bf143e089522661c21
treef7c40cddb9412748b28a83ddcfdf244c68f2a79b
parent8862cb679cc23cb02fceaa897215f2ba58b3bed6
libxl: s/pcidev/pci and remove DEFINE_DEVICE_TYPE_STRUCT_X

The seemingly arbitrary use of 'pci' and 'pcidev' in the code in libxl_pci.c
is confusing and also compromises use of some macros used for other device
types. Indeed it seems that DEFINE_DEVICE_TYPE_STRUCT_X exists solely because
of this duality.

This patch purges use of 'pcidev' from the libxl internal code, but
unfortunately the 'pcidevs' and 'num_pcidevs' fields in 'libxl_domain_config'
are part of the API and need to be retained to avoid breaking callers,
particularly libvirt.

DEFINE_DEVICE_TYPE_STRUCT_X is still removed to avoid the special case in
libxl_pci.c but DEFINE_DEVICE_TYPE_STRUCT is given an extra 'array' argument
which is used to identify the fields in 'libxl_domain_config' relating to
the device type.

NOTE: Some of the more gross formatting errors (such as lack of spaces after
      keywords) that came into context have been fixed in libxl_pci.c.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Wei Liu <wl@xen.org>
15 files changed:
tools/include/libxl.h
tools/libs/light/libxl_9pfs.c
tools/libs/light/libxl_console.c
tools/libs/light/libxl_create.c
tools/libs/light/libxl_disk.c
tools/libs/light/libxl_internal.h
tools/libs/light/libxl_nic.c
tools/libs/light/libxl_pci.c
tools/libs/light/libxl_pvcalls.c
tools/libs/light/libxl_usb.c
tools/libs/light/libxl_vdispl.c
tools/libs/light/libxl_vkb.c
tools/libs/light/libxl_vsnd.c
tools/libs/light/libxl_vtpm.c
tools/libs/util/libxlu_pci.c