[PATCH 2/4] loader: don't print warnings about unreferenced entities on error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If we abort loading the database due to some error, we still
print warnings about unreferenced entities. These warnings are
bogus - we know there are unreferenced entities, since we
aborted loading before we'd finished.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 osinfo/osinfo_loader.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index 159d25d..2dc29c4 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -2145,9 +2145,11 @@ static void osinfo_loader_process_list(OsinfoLoader *loader,
         }
     }
 
-    g_hash_table_iter_init(&iter, loader->priv->entity_refs);
-    while (g_hash_table_iter_next(&iter, &key, &value)) {
-        g_warning("Entity %s referenced but not defined", (const char *)key);
+    if (!lerr) {
+        g_hash_table_iter_init(&iter, loader->priv->entity_refs);
+        while (g_hash_table_iter_next(&iter, &key, &value)) {
+            g_warning("Entity %s referenced but not defined", (const char *)key);
+        }
     }
 
  cleanup:
-- 
2.4.3

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux