]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virschematest: Don't bother checking symlinked XMLs
authorPeter Krempa <pkrempa@redhat.com>
Tue, 23 Jan 2024 12:59:11 +0000 (13:59 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 24 Jan 2024 08:19:27 +0000 (09:19 +0100)
There's plenty symlinks in qemuxml2argvdata and qemuxml2xmlout
directories pointing to other files in the same directory. It makes no
sense to check those files twice, thus we can simply skip symlinks.

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

index 1d122a9bc9f21a81e6938e6b9fb18e3edde6ff46..1e911cd68e4ff17c173ce23deb8b71d02a2fd6a7 100644 (file)
@@ -118,11 +118,15 @@ testSchemaDir(const char *schema,
     while ((rc = virDirRead(dir, &ent, dir_path)) > 0) {
         g_autofree char *xml_path = NULL;
         bool exception = false;
+        GStatBuf sb;
 
         if (!virStringHasSuffix(ent->d_name, ".xml"))
             continue;
         if (ent->d_name[0] == '.')
             continue;
+        if (g_lstat(ent->d_name, &sb) >= 0 &&
+            S_ISLNK(sb.st_mode))
+            continue;
         if (filter &&
             !g_regex_match(filter, ent->d_name, 0, NULL))
             continue;