From 14106524cc98dc67b81d77ecdf157116fd7fe514 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 31 Aug 2023 22:38:48 +0200 Subject: [PATCH] qemuxml2argvtest: Remove cpu model faking for fake-caps tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that all fake-caps testing was removed we can also remove the filling of the fake caps by cpu models. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- tests/qemuxml2argvtest.c | 49 ---------------------------------------- 1 file changed, 49 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 99e0d3aa0d..2d06e2a0d1 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -256,32 +256,6 @@ static virNWFilterDriver fakeNWFilterDriver = { }; -static int -testAddCPUModels(virQEMUCaps *caps) -{ - virArch arch = virQEMUCapsGetArch(caps); - const char *x86Models[] = { - "n270", "athlon", "pentium3", "pentium2", "pentium", - "486", "coreduo", "kvm32", "qemu32", "kvm64", - "core2duo", "phenom", "qemu64", - "Opteron_G3", "Opteron_G2", "Opteron_G1", - "Nehalem", "Penryn", "Conroe", - "Haswell-noTSX", "Haswell", - }; - - if (ARCH_IS_X86(arch)) { - if (virQEMUCapsAddCPUDefinitions(caps, VIR_DOMAIN_VIRT_KVM, x86Models, - G_N_ELEMENTS(x86Models), - VIR_DOMCAPS_CPU_USABLE_UNKNOWN) < 0 || - virQEMUCapsAddCPUDefinitions(caps, VIR_DOMAIN_VIRT_QEMU, x86Models, - G_N_ELEMENTS(x86Models), - VIR_DOMCAPS_CPU_USABLE_UNKNOWN) < 0) - return -1; - } - - return 0; -} - static void testUpdateQEMUCapsHostCPUModel(virQEMUCaps *qemuCaps, virArch hostArch) { @@ -289,24 +263,6 @@ testUpdateQEMUCapsHostCPUModel(virQEMUCaps *qemuCaps, virArch hostArch) virQEMUCapsUpdateHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_QEMU); } -static int -testUpdateQEMUCaps(const struct testQemuInfo *info, - virArch arch, - virCaps *caps) -{ - if (!caps) - return -1; - - virQEMUCapsSetArch(info->qemuCaps, arch); - - if (testAddCPUModels(info->qemuCaps) < 0) - return -1; - - testUpdateQEMUCapsHostCPUModel(info->qemuCaps, caps->host.arch); - - return 0; -} - static int testCheckExclusiveFlags(int flags) @@ -554,11 +510,6 @@ testCompareXMLToArgv(const void *data) if (arch == VIR_ARCH_NONE) arch = virArchFromHost(); - if (!(info->flags & FLAG_REAL_CAPS)) { - if (testUpdateQEMUCaps(info, arch, driver.caps) < 0) - goto cleanup; - } - virFileCacheClear(driver.qemuCapsCache); if (qemuTestCapsCacheInsert(driver.qemuCapsCache, info->qemuCaps) < 0)