Re: [libosinfo 3/3] Implement osinfo_platform_get_all_devices()

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

 



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@xxxxxxxxxx> 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>.
OSes use <clones> in addition to these 2, which I don't think make sense
for platforms. OSes don't follow <upgrades> as devices working for OS N-1
may no longer work in OS N.

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

Once again, sorry for missing this review before pushing,

Christophe

Attachment: pgpPKa7uzaeuP.pgp
Description: PGP signature

_______________________________________________
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