]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuxmlconftest: Check also output files for usage
authorPeter Krempa <pkrempa@redhat.com>
Tue, 23 Jan 2024 12:44:50 +0000 (13:44 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 24 Jan 2024 08:19:27 +0000 (09:19 +0100)
Include also the output files in the validation of used files.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
tests/qemuxmlconftest.c

index c3acfb59d583163507ab806a12585bcf855b1373..cb19e7b27dde58c9b93b223b8b0b20b9cbaffeda 100644 (file)
@@ -633,6 +633,12 @@ testQemuConfXMLCommon(testQemuInfo *info,
 
     /* mark test case as used */
     ignore_value(g_hash_table_remove(info->conf->existingTestCases, info->infile));
+    if (info->outfile)
+        ignore_value(g_hash_table_remove(info->conf->existingTestCases, info->outfile));
+    if (info->errfile)
+        ignore_value(g_hash_table_remove(info->conf->existingTestCases, info->errfile));
+    if (info->out_xml_inactive)
+        ignore_value(g_hash_table_remove(info->conf->existingTestCases, info->out_xml_inactive));
 
     if (testQemuInfoInitArgs((testQemuInfo *) info) < 0)
         goto cleanup;
@@ -925,7 +931,7 @@ testConfXMLCheck(GHashTable *existingTestCases)
         if (ret == 0)
             fprintf(stderr, "\n");
 
-        fprintf(stderr, "unused input file: %s\n", (const char *) items[i].key);
+        fprintf(stderr, "unused file: %s\n", (const char *) items[i].key);
         ret = -1;
     }
 
@@ -949,7 +955,9 @@ testConfXMLEnumerate(GHashTable *existingTestCases)
         return -1;
 
     while ((rc = virDirRead(dir, &ent, abs_srcdir "/qemuxml2argvdata")) > 0) {
-        if (virStringHasSuffix(ent->d_name, ".xml")) {
+        if (virStringHasSuffix(ent->d_name, ".xml") ||
+            virStringHasSuffix(ent->d_name, ".args") ||
+            virStringHasSuffix(ent->d_name, ".err")) {
             g_hash_table_insert(existingTestCases,
                                 g_strdup_printf(abs_srcdir "/qemuxml2argvdata/%s", ent->d_name),
                                 NULL);