]> git.proxmox.com Git - pve-common.git/commit
SysFSTools.pm: improve and extend lspci
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 20 Nov 2018 16:13:38 +0000 (17:13 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Nov 2018 10:11:20 +0000 (11:11 +0100)
commita70972cd0590efb73c13d427324459f4a0952394
treebdb5904b6a8f7b079e34d283489176afea302e03
parent44a4db5b60b8a69e28d764682ffdb9874e67aba3
SysFSTools.pm: improve and extend lspci

this implements following improvements and optimizations for lspci

* removes the unecessary split between id and function
  since everywhere we need that information, we stitch them together
  anyway. to preserve ordering, simply order by id with string
  comparison 'cmp' (this is important for the shorthand syntax '00:01' in
  the config)
* returns now a list directly, instead of an hash with lists
* returns now always the vendor/device id and class[1]
* filter is now either a string (matches the id partially), or a
  sub, which filters the device out if it returns a falsy value
* adds a verbose flag to include more information about the device,
  such as device/vendor name, iommu-group, mdev support, etc.
  this will be used for the pci scan api call for the gui

1: https://pci-ids.ucw.cz/read/PD/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/SysFSTools.pm