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>
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>
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>
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>