Commit Graph

5 Commits

Author SHA1 Message Date
Thomas Lamprecht
ccf9e2f2a3 api: pci hardware: code/indentation style clean-ups
The endpoint name is mostly used for calling the API methods as first
class perl method through autoloader, but manager is a leaf node
w.r.t. dependencies and there is no existing call for either of the
two.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-30 10:45:19 +01:00
Dominik Csapak
8b33297c6e api/ui: improve mdev listing for pci mappings
Currently, when we have a PCI resource mapping, we manually check only
the available models for the first PCI entry. This often works, but not
always, since one could have completely different devices in one
mapping, or with the new NVIDIA sysfs api we don't get the generally
available models.

To improve this, extend the parameter for the PCI ID to accept both,
PCI IDs or named mappings, and for the latter mappings, iterate over
all local PCI devices in it and extract the mdev types.

Rename also the parameter to better reflect what it accepts. While the
this is changing a API parameter, it's not a breaking change in this
specific case because the parameter is derived from the URL path, and
any attempt to include the parameter with a name manually is not
possible and  will result in an error:

  duplicate parameter (already defined in URI) with conflicting values!

Since we cannot reach the API handler without giving the parameter
already via the URL, there is no way to give it via name.

Accepting named mappings directly in this API endpoint also vastly
simplifies the UI code, since we now only have to give the mapping to
the selector instead of an (arbitrarily selected) PCI id from that
mapping.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ TL: also split pciid into pci-id for readability and reword message
   slightly ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-30 10:38:46 +01:00
Thomas Lamprecht
65cbfe79e4 fix #4245: api: node HW: allow to get PCI info with Sys.Audit on /
keep Sys.Modify only for backward compat, as it does not make really
much sense to ask for that on an informative GET call.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-20 13:29:58 +01:00
Dominik Csapak
e8300c39df fix #3490: show more pci devices by default
we filtered out devices which belong into the 'Generic System Peripheral'
category, but this can contain actual useful pci devices
users want to pass through, so simply do not filter it by default.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-07 18:37:07 +02:00
Thomas Lamprecht
523d5f486b api: move PCI from Scan to Hardware path
as discussed[0] lets move this to /nodes/{node}/hardware/pci

Put this in its own subfolder and adapt module names and paths in UI.

[0]: https://pve.proxmox.com/pipermail/pve-devel/2018-November/034694.html
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-22 14:20:09 +01:00