[virt-tools-list] [libosinfo] Improve list API

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Mon Dec 10 22:53:05 UTC 2012


On Mon, Dec 10, 2012 at 11:14 PM, Zeeshan Ali (Khattak)
<zeeshanak at gnome.org> wrote:
> On Fri, Dec 7, 2012 at 4:06 PM, Zeeshan Ali (Khattak)
> <zeeshanak at gnome.org> wrote:
>> On Fri, Dec 7, 2012 at 11:34 AM, Christophe Fergeau <cfergeau at redhat.com> wrote:
>>> Hi,
>>>
>>> libosinfo has various *List classes which basically are a GObject class
>>> wrapping a hash table of objects of a specific type. Each of these classes
>>> implements osinfo_list_new_filtered, osinfo_list_new_copy, ... probably
>>> because of c&p.
>
> I don't think that is the case. The issue is that these functions
> should have been virtual so if you call osinfo_list_new_*() on an
> instance of subclass, you get an instance of subclass (although in the
> form of OsinfoList). Now with these method deprecated in subclasses,
> apps now have to deal with different classes depending on whether or
> not they needed to call any of these methods (e.g whether or not they
> needed to filter a list).
>
> This Boxes patch should give you an idea of the issue I'm talking
> about: http://bugzilla-attachments.gnome.org/attachment.cgi?id=231171
>
> Now the problem is that we can't make these methods virtual without
> breaking the ABI. Which is where another of our failures show-up. To
> avoid ABI breakage, its really important to keep redudant padding in
> class structs and we never added those before declaring libosinfo ABI
> stable. :(

NM everything I said in first 3 paragraphs above. You ensured that we
return list of the correct type. I only saw it in the code after you
pointed it out on IRC..

-- 
Regards,

Zeeshan Ali (Khattak)
FSF member#5124




More information about the virt-tools-list mailing list