mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-03-18 10:44:10 +00:00
Replace hardcoded NVIDIA vendor ID (0x10de) and class (0x030) checks with a vendor-agnostic lookup table (cdiDeviceKind) that maps PCI vendor/class pairs to CDI device kinds. This makes it straightforward to add support for new device types by adding entries to the table. Refactor siblingAnnotation to resolve device BDFs once upfront and reuse them for both CDI type detection and sibling matching, eliminating redundant sysfs reads. Devices not in the lookup table (e.g. NVSwitches) are skipped with errNoSiblingFound, while known device types that fail to match a sibling produce a hard error. Consolidate the hot-plug and cold-plug device loops into a single loop over extracted container paths, removing duplicated filtering logic. Export GetPCIDeviceProperty from the device drivers package to allow vendor/class lookup from sysfs in the container annotation path. Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>