From f997fcca71a16b102e6ee663a3fb86bed8de9d7d Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 23 Jan 2024 13:59:11 +0100 Subject: [PATCH] virschematest: Don't bother checking symlinked XMLs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- tests/virschematest.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/virschematest.c b/tests/virschematest.c index 1d122a9bc9..1e911cd68e 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -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;