]> xenbits.xensource.com Git - xen.git/commit
libxlu: introduce xlu_pci_parse_spec_string()
authorPaul Durrant <pdurrant@amazon.com>
Tue, 8 Dec 2020 19:30:27 +0000 (19:30 +0000)
committerWei Liu <wl@xen.org>
Tue, 15 Dec 2020 16:24:23 +0000 (16:24 +0000)
commit96ed6ff29741df820217b6b744eb0fa2d76b50f3
tree3da1186e05ff927d8a6415bdc4883aa33f52cd45
parent929f23114061a0089e6d63d109cf6a1d03d35c71
libxlu: introduce xlu_pci_parse_spec_string()

This patch largely re-writes the code to parse a PCI_SPEC_STRING and enters
it via the newly introduced function. The new parser also deals with 'bdf'
and 'vslot' as non-positional paramaters, as per the documentation in
xl-pci-configuration(5).

The existing xlu_pci_parse_bdf() function remains, but now strictly parses
BDF values. Some existing callers of xlu_pci_parse_bdf() are
modified to call xlu_pci_parse_spec_string() as per the documentation in xl(1).

NOTE: Usage text in xl_cmdtable.c and error messages are also modified
      appropriately.
      As a side-effect this patch also fixes a bug where using '*' to specify
      all functions would lead to an assertion failure at the end of
      xlu_pci_parse_bdf().

Fixes: d25cc3ec93eb ("libxl: workaround gcc 10.2 maybe-uninitialized warning")
Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Wei Liu <wl@xen.org>
tools/include/libxlutil.h
tools/libs/util/libxlu_pci.c
tools/xl/xl_cmdtable.c
tools/xl/xl_parse.c
tools/xl/xl_pci.c