Skip to content

Commit b0e7864

Browse files
committed
Simplify SR-IOV VFIO driver check logic
- Remove unnecessary conditional check in sriov_attach_detach_device_vfio_variant_driver.py - The check_vfio_pci function can handle None values for exp_driver parameter - Reduces code complexity from 4 lines to 1 line Signed-off-by: hholoubk <[email protected]> AI assisted code and commit. Human reviewed.
1 parent ab57225 commit b0e7864

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

libvirt/tests/src/sriov/plug_unplug/sriov_attach_detach_device_vfio_variant_driver.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,7 @@ def parse_iface_dict(pf_pci):
8181
test.log.debug(f"Actual XML: {actual_vm_hostdev}")
8282
if act_hostdev_dict.get("driver")["driver_attr"].get("name") != "vfio":
8383
test.fail("The hostdev driver is not set to VFIO.")
84-
if expr_driver:
85-
libvirt_vfio.check_vfio_pci(vf_pci, exp_driver=expr_driver)
86-
else:
87-
libvirt_vfio.check_vfio_pci(vf_pci)
84+
libvirt_vfio.check_vfio_pci(vf_pci, exp_driver=expr_driver)
8885

8986
test.log.info("TEST_STEP: ping test from VM to outside")
9087
if sriov_vfio.is_linked(pf_name=test_pf) and ping_dest:

0 commit comments

Comments
 (0)