[pve-devel] applied: [PATCH manager v2] api/ui: improve mdev listing for pci mappings

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Oct 30 10:48:42 CET 2024


Am 30/10/2024 um 09:59 schrieb Dominik Csapak:
> 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 'pciid' regex to include pciids or mapping
> names, and for mappings, iterate over all local pci devices in it and
> extract the mdev types.
> 
> Rename also the parameter to better reflect what it is. This is OK here,
> because it's a parameter that's deduced via the url path, and any
> attempt to include the parameter with a name manually 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.
> 
> This also vastly simplifies the ui code, since we only have to give the
> mapping to the selector instead of an (arbitrarily selected) pci id.
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> changes since v1:
> * improved commit message to tell why it's ok to rename the parameter
>   here and still have backwards compatibility.
> 
>  PVE/API2/Hardware/PCI.pm     | 45 +++++++++++++++++++++++++++++-------
>  www/manager6/qemu/PCIEdit.js | 12 +---------
>  2 files changed, 38 insertions(+), 19 deletions(-)
> 
>

applied, thanks!

FYI: I fleeced in a small change for s/pciid/pci-id/ for slightly improve
readability while this name was touched anyway.




More information about the pve-devel mailing list