[Libosinfo] [libosinfo PATCH 1/2] loader: Properly load the arch value for images

Fabiano Fidêncio fidencio at redhat.com
Wed Apr 10 11:53:41 UTC 2019


osinfo_loader_image() has been considering the XML tag for the
images' architecture was "architecture", while it actually is "arch".

By trying to read the wrong tag, no arch was loaded, causing then any
image load to fail with:
CRITICAL **: 13:30:06.539: osinfo_entity_set_param: assertion 'value != NULL' failed

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 osinfo/osinfo_loader.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index e30148b..84c25e5 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -1312,8 +1312,7 @@ static OsinfoImage *osinfo_loader_image(OsinfoLoader *loader,
         { NULL, G_TYPE_INVALID }
     };
 
-    gchar *arch = (gchar *)xmlGetProp(root,
-                                      BAD_CAST OSINFO_IMAGE_PROP_ARCHITECTURE);
+    gchar *arch = (gchar *)xmlGetProp(root, BAD_CAST "arch");
     gchar *format = (gchar *)xmlGetProp(root,
                                         BAD_CAST OSINFO_IMAGE_PROP_FORMAT);
     gchar *cloud_init = (gchar *)xmlGetProp(root,
-- 
2.20.1




More information about the Libosinfo mailing list