]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
testQemuGetRealCaps: Strip the default machine alias before insertion into cache
authorPeter Krempa <pkrempa@redhat.com>
Mon, 3 Jul 2023 12:41:38 +0000 (14:41 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 20 Jul 2023 13:22:40 +0000 (15:22 +0200)
Expand the default machine type alias of the 'latest' capabilities for
an architecture before caching it rather than after copying it, so that
we don't duplicate the work all the time.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/testutilsqemu.c

index b75241d5456f0b42ba5dc4f3b6fe689bb4a6c4ad..40c2cb8bba15b725c6a3027ffd3bbdde56f1a567 100644 (file)
@@ -931,14 +931,14 @@ testQemuGetRealCaps(const char *arch,
             return NULL;
         }
 
+        if (stripmachinealiases)
+            virQEMUCapsStripMachineAliases(cachedcaps);
+
         g_hash_table_insert(capsCache, g_strdup(capsfile), cachedcaps);
     }
 
     ret = virQEMUCapsNewCopy(cachedcaps);
 
-    if (stripmachinealiases)
-        virQEMUCapsStripMachineAliases(ret);
-
     /* strip 'xml' suffix so that we can format the file to '.replies' */
     capsfile[strlen(capsfile) - 3] = '\0';