libvirt: resolve passthrough BDFs from visible devices#4371
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Improves libvirt PCI passthrough robustness in nested scenarios by resolving runbook-requested BDFs to PCI devices actually visible on the libvirt host before building IOMMU-backed pools, and aligns functional validation to read sysfs from the resolved device.
Changes:
- Add BDF resolution logic for PCI BDF-based pools, including candidate discovery via host-visible passthrough devices.
- Tolerate non-PCI-backed management NICs when computing the “primary NIC” IOMMU exclusion set.
- Update device passthrough functional validation to use the same BDF resolution path before reading vendor/device IDs from sysfs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lisa/sut_orchestrator/libvirt/libvirt_device_pool.py | Resolve requested BDFs to host-visible devices; cache IOMMU device paths; improve IOMMU-group lookup error reporting; tolerate non-PCI management NICs. |
| lisa/microsoft/testsuites/device_passthrough/functional_tests.py | Resolve BDFs before sysfs vendor/device reads for BDF-only pools to match libvirt host-visible devices. |
1f877e6 to
d1707a9
Compare
d1707a9 to
c5e6b2c
Compare
anirudhrb
requested changes
Mar 24, 2026
c5e6b2c to
b36f91e
Compare
b36f91e to
aaa53f7
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
lisa/sut_orchestrator/util/device_pool.py:10
DeviceLocationPathIdentifieris imported fromlisa.sut_orchestrator.util.schema, but that symbol doesn't exist in that module (schema.py currently defines only VendorDeviceIdIdentifier/PciAddressIdentifier/etc.). This will raise an ImportError at runtime and prevent any platform from loadingBaseDevicePool. Either add/restoreDeviceLocationPathIdentifiertoutil/schema.py(and updateHostDevicePoolSchema.devicesaccordingly), or remove this import/type check and rely on the dictlocation_pathhandling that already exists in_configure_dict_identifier_pool.
from lisa.sut_orchestrator.util.schema import (
DeviceLocationPathIdentifier,
HostDevicePoolSchema,
HostDevicePoolType,
PciAddressIdentifier,
VendorDeviceIdIdentifier,
)
anirudhrb
previously approved these changes
Mar 25, 2026
1c69897 to
1e69b75
Compare
1e69b75 to
edd7fc9
Compare
c189dce to
9c49751
Compare
9c49751 to
8fd4f92
Compare
Collaborator
Author
|
@anirudhrb Fixed some lint issues. please approve again. |
anirudhrb
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve libvirt PCI passthrough handling by resolving requested BDFs to visible nested devices before building IOMMU-backed pools.
This commit also tolerates non-PCI management NICs when determining the primary NIC exclusion set and reuses the same BDF resolution path in device passthrough functional validation for BDF-only pools so host sysfs lookup follows the resolved passthrough device.
Description
Related Issue
Type of Change
Checklist
Test Validation
Key Test Cases:
verify_device_passthrough_on_guest
Impacted LISA Features:
NIC Passthrough
Tested Azure Marketplace Images:
-Local HyperV VHD
Test Results
verify_device_passthrough_on_guest