[Libosinfo] [libosinfo] Don't ignore vendor/device name in pci/usb id parser

Christophe Fergeau cfergeau at redhat.com
Tue Mar 12 16:16:12 UTC 2013


These values were parsed but ignored using ignore_value(), leading
to very incomplete data when the data from pci.ids/usb.ids is used.
As generally this data is complemented by <device> nodes in
libosinfo database, and as this data takes precedence over
the pci.ids/usb.ids data, this is not visible without removing
the additional <device> data.
---
 osinfo/osinfo_loader.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index b6d8401..7ed86f9 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -1622,7 +1622,6 @@ osinfo_loader_process_file_reg_ids(OsinfoLoader *loader,
                 WANT_ID(device_id);
                 WANT_REST(device);
                 SAVE_BUF(device_buf);
-                ignore_value(device);
 
                 gchar *id = g_strdup_printf("%s/%s/%s",
                                             baseURI, vendor_id, device_id);
@@ -1632,9 +1631,15 @@ osinfo_loader_process_file_reg_ids(OsinfoLoader *loader,
                                         OSINFO_DEVICE_PROP_VENDOR_ID,
                                         vendor_id);
                 osinfo_entity_set_param(OSINFO_ENTITY(dev),
+                                        OSINFO_DEVICE_PROP_VENDOR,
+                                        vendor);
+                osinfo_entity_set_param(OSINFO_ENTITY(dev),
                                         OSINFO_DEVICE_PROP_PRODUCT_ID,
                                         device_id);
                 osinfo_entity_set_param(OSINFO_ENTITY(dev),
+                                        OSINFO_DEVICE_PROP_PRODUCT,
+                                        device);
+                osinfo_entity_set_param(OSINFO_ENTITY(dev),
                                         OSINFO_DEVICE_PROP_BUS_TYPE,
                                         busType);
                 g_free(id);
@@ -1644,7 +1649,6 @@ osinfo_loader_process_file_reg_ids(OsinfoLoader *loader,
             WANT_ID(vendor_id);
             WANT_REST(vendor);
             SAVE_BUF(vendor_buf);
-            ignore_value(vendor);
         }
 
     done:
-- 
1.8.1.4




More information about the Libosinfo mailing list