]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuxml2argvtest: Remove cpu model faking for fake-caps tests
authorPeter Krempa <pkrempa@redhat.com>
Thu, 31 Aug 2023 20:38:48 +0000 (22:38 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 6 Sep 2023 12:09:46 +0000 (14:09 +0200)
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 <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemuxml2argvtest.c

index 99e0d3aa0deaf0dd5ffd7f7256cdc362d2ea7b2d..2d06e2a0d1d91940bd8858c16ba427426fd09e67 100644 (file)
@@ -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)