[Libosinfo] [libosinfo 3/3] Implement osinfo_platform_get_all_devices()

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Wed Apr 3 16:03:49 UTC 2013


On Wed, Apr 3, 2013 at 6:38 PM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> On Tue, Apr 02, 2013 at 05:39:47PM +0300, Zeeshan Ali (Khattak) wrote:
>> On Tue, Apr 2, 2013 at 12:17 PM, Christophe Fergeau <cfergeau at redhat.com> wrote:
>> > +static void get_all_devices_cb(OsinfoProduct *product, gpointer user_data)
>> > +{
>> > +    OsinfoDeviceList *devices;
>> > +    OsinfoList *tmp_list;
>> > +    struct GetAllDevicesData *foreach_data = (struct GetAllDevicesData *)user_data;
>> > +
>> > +    g_return_if_fail(OSINFO_IS_PLATFORM(product));
>> > +
>> > +    devices = osinfo_platform_get_devices(OSINFO_PLATFORM(product),
>> > +                                          foreach_data->filter);
>> > +    tmp_list = osinfo_list_new_union(OSINFO_LIST(foreach_data->devices),
>> > +                                     OSINFO_LIST(devices));
>> > +    g_object_unref(foreach_data->devices);
>> > +    g_object_unref(devices);
>> > +    foreach_data->devices = OSINFO_DEVICELIST(tmp_list);
>> > +}
>>
>> Some docs would be nice.
>
> About to send a patch adding this.
>
>>
>> > +OsinfoDeviceList *osinfo_platform_get_all_devices(OsinfoPlatform *platform,
>> > +                                                  OsinfoFilter *filter)
>> > +{
>> > +    struct GetAllDevicesData foreach_data = {
>> > +        .filter = filter,
>> > +        .devices = osinfo_devicelist_new()
>> > +    };
>> > +
>> > +    osinfo_product_foreach_related(OSINFO_PRODUCT(platform),
>> > +                                   OSINFO_PRODUCT_FOREACH_FLAG_UPGRADES,
>> > +                                   get_all_devices_cb,
>> > +                                   &foreach_data);
>>
>> Seems in _os_get_all_devices() we are looking for  `DERIVES_FROM |
>> CLONES`, Some reasoning for this contrast would be nice.
>
> First note, this was missing OSINFO_PRODUCT_FOREACH_FLAG_DERIVES_FROM
> Reason is that the platforms we currently have use <upgrades> and
> <derives-from>.

So shouldn't this be then 'DERIVES_FROM | UPGRADES' ?

> I'm not sure if you want the reasoning in answer to this email, or added to
> some place in the commit?

No, just to list is fine but in commit log would have been even better.

--
Regards,

Zeeshan Ali (Khattak)
FSF member#5124




More information about the Libosinfo mailing list