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

Daniel P. Berrange berrange at redhat.com
Tue Oct 20 13:02:34 UTC 2015


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 at redhat.com>
---
 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




More information about the Libosinfo mailing list