From c915018b403455a944f4fb9ea05442f4e7bc0736 Mon Sep 17 00:00:00 2001 From: Meina Li Date: Fri, 20 Dec 2024 02:28:01 -0500 Subject: [PATCH] SRIOV: fix "Login timeout expired" because of 256 vcpus The numbers of guest vcpu is better little than the host vcpus' number. But we don't have this host to match 256 cpus. So after discussing we decided to use the same host cpus' number to test guest vcpus. Signed-off-by: Meina Li --- .../cfg/sriov/vIOMMU/intel_iommu_with_dma_translation.cfg | 1 - .../src/sriov/vIOMMU/intel_iommu_with_dma_translation.py | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libvirt/tests/cfg/sriov/vIOMMU/intel_iommu_with_dma_translation.cfg b/libvirt/tests/cfg/sriov/vIOMMU/intel_iommu_with_dma_translation.cfg index ed796ca749..15411a02ec 100644 --- a/libvirt/tests/cfg/sriov/vIOMMU/intel_iommu_with_dma_translation.cfg +++ b/libvirt/tests/cfg/sriov/vIOMMU/intel_iommu_with_dma_translation.cfg @@ -13,5 +13,4 @@ with_more_vcpus = "yes" dma_translation = "off" eim_dict = {'eim': 'on'} - guest_vcpus = 256 iommu_dict = {'model': 'intel', 'driver': {'intremap': 'on', 'caching_mode': 'on', 'iotlb': 'on', 'dma_translation': '${dma_translation}'}} diff --git a/libvirt/tests/src/sriov/vIOMMU/intel_iommu_with_dma_translation.py b/libvirt/tests/src/sriov/vIOMMU/intel_iommu_with_dma_translation.py index 4b057ed484..4039d71345 100644 --- a/libvirt/tests/src/sriov/vIOMMU/intel_iommu_with_dma_translation.py +++ b/libvirt/tests/src/sriov/vIOMMU/intel_iommu_with_dma_translation.py @@ -1,3 +1,4 @@ +from avocado.utils import process from virttest import virsh from virttest.libvirt_xml import vm_xml @@ -23,6 +24,9 @@ def run(test, params, env): test_obj.setup_iommu_test(iommu_dict=iommu_dict) if with_more_vcpus: vmxml = vm_xml.VMXML.new_from_dumpxml(vm_name) + cpu_cmd = "lscpu | grep '^CPU(s):'" + vcpus_output = process.run(cpu_cmd, shell=True, ignore_status=False).stdout_text + guest_vcpus = vcpus_output.split(' ')[-1] vmxml.vcpu = int(guest_vcpus) vmxml.sync() test.log.info("TEST STEP2: Start the guest.")