mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-01 13:14:33 +00:00
tests/vfio: Accept single device in vfio group for CLH
cloud hypervisor does not emulate pcie switches or pci bridges, so we need to accept a lonely device. Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
parent
df3dc1105c
commit
faee59b520
@ -113,9 +113,13 @@ check_vfio() {
|
||||
# There should be two devices in the IOMMU group: the ethernet
|
||||
# device we care about, plus the PCIe to PCI bridge device
|
||||
devs="$(get_ctr_cmd_output "${cid}" ls /sys/kernel/iommu_groups/"${group}"/devices)"
|
||||
if [ $(echo "${devs}" | wc -w) != "2" ] ; then
|
||||
num_devices=$(echo "${devs}" | wc -w)
|
||||
if [ "${HYPERVISOR}" = "qemu" ] && [ "${num_devices}" != "2" ] ; then
|
||||
die "Expected exactly two devices got: ${devs}"
|
||||
fi
|
||||
if [ "${HYPERVISOR}" = "clh" ] && [ "${num_devices}" != "1" ] ; then
|
||||
die "Expected exactly one device got: ${devs}"
|
||||
fi
|
||||
|
||||
# The bridge device will always sort first, because it is on
|
||||
# bus zero, whereas the NIC will be on a non-zero bus
|
||||
|
Loading…
Reference in New Issue
Block a user