[pve-devel] applied: [PATCH guest-common v5 1/1] add PCI/USB Mapping configs

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Jun 7 19:17:53 CEST 2023


Am 06/06/2023 um 15:52 schrieb Dominik Csapak:
> adds a config file for each type of resource (usb/pci) by using a 'map'
> array propertystring for each node mapping
> 
> in each mapping we save the path(s) and some other information to detect
> hardware changes (if possible) like the vendor/device id
> 
> both configs have custom header parser/formatter to omit the type (since
> we only want one type per config here)
> 
> also each config has some helpers like find_on_current_node
> 
> the resulting config (e.g. for pci) would look like this:
> 
> ---
> some-pci-device
>     description some device
>     map node=node1,path=0000:00:01.0,id=1234:1234,iommugroup=4
>     map node=node2,path=0000:01:01.0,id=1234:1234,iommugroup=5
>     map node=node3,path=0000:02:01.0,id=1234:1234,iommugroup=6
> ---
> 
> some special notes:
> * mdev is a per config entry, since it does not make sense to mix mdev
>   and non-mdev devices
> * to have multiple mappings for a node (for choosing a single one during
>   vm startup), the config has a 'map' line for each such mapping
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> changes from v4:
> * rename s/resource/mapping/i
> 
>  src/Makefile           |   3 +
>  src/PVE/Mapping/PCI.pm | 226 +++++++++++++++++++++++++++++++++++++++++
>  src/PVE/Mapping/USB.pm | 183 +++++++++++++++++++++++++++++++++
>  3 files changed, 412 insertions(+)
>  create mode 100644 src/PVE/Mapping/PCI.pm
>  create mode 100644 src/PVE/Mapping/USB.pm
> 
>

applied, thanks!

Albeit, I have to admit that I only skimmed it due to assuming that we can iron
out anything problematic in the next few weeks with not having to bother too much
for breaking stuff temporarily.





More information about the pve-devel mailing list