From a8120481a9b7d8faa7783965f01e694bf389fec3 Mon Sep 17 00:00:00 2001 From: Anushree Mathur Date: Wed, 25 Nov 2026 12:11:14 +0530 Subject: [PATCH] pci_passthrough: add negative_split_iommu_group variant The tp-libvirt libvirt_pci_passthrough test gained a negative_split_iommu_group variant. It assigns only one device of a multi-function IOMMU group to the guest while the remaining members of the group stay bound to their host driver. VFIO requires all devices of an IOMMU group to be owned by vfio-pci, so the guest must fail to start, and the test passes only if the failure contains the expected error. Add a negative_split_iommu_group entry to pci_passthrough.cfg so the new test is picked up when this suite is run. It selects libvirt_pci_passthrough.negative_split_iommu_group and declares the parameters the test reads: split_pci PCI address of ONE device of an IOMMU group whose other members are not bound to vfio-pci. This is system specific, so it is an "ENTER.YOUR.PCI.LABEL" placeholder with an example, like the other PCI labels in this file. negative_split_expected_err error expected when the guest fails to start ("is not viable") The variant is placed before guest_remove, since guest_remove deletes the guest that the test needs. Depends on the tp-libvirt change for the negative_split_iommu_group test in libvirt_pci_passthrough. Signed-off-by: Anushree Mathur --- config/tests/guest/libvirt/pci_passthrough.cfg | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config/tests/guest/libvirt/pci_passthrough.cfg b/config/tests/guest/libvirt/pci_passthrough.cfg index 5f59324f..9458def4 100644 --- a/config/tests/guest/libvirt/pci_passthrough.cfg +++ b/config/tests/guest/libvirt/pci_passthrough.cfg @@ -90,5 +90,18 @@ variants: - pci_passthrough_eeh: only libvirt_pci_passthrough_eeh + - negative_split_iommu_group: + only libvirt_pci_passthrough.negative_split_iommu_group + # Negative test: assign only ONE device of a multi-function IOMMU + # group to the guest while the other members of the group stay bound + # to their host driver. The guest must fail to start because the + # IOMMU group is not viable. + # PCI address of ONE device of such an IOMMU group. The group must + # contain other devices that are not bound to vfio-pci. + # Eg: 0000:05:00.0 + split_pci = "ENTER.YOUR.PCI.LABEL" + # Error expected from libvirt/QEMU when the guest fails to start + negative_split_expected_err = "is not viable" + - guest_remove: only remove_guest.without_disk