Hi Daniel, Paolo and Thomas,

> > > I suggested this solution to Kohei because it's easy to check that
we're
> > > converting all users and not introducing new ones in the future (see
> > > poisoning in patch 10).
> >
> > It is easy to check this /one/ example, but this pattern of bad casts
> > is typical in glib with likely many more examples, so avoidance in this
> > way does not feel like a sustainable long term strategy to me.
>
> If you refer to the general case of function casting then yes, I agree
that there could be other problems in the future but that would have to be
solved in glib.
>
> However QEMU's use of glib is overall relatively limited and for now this
seems to be the only case we hit. What this patch is doing is both
effective at solving the immediate issue, and future proof.

The current patch addresses the cases we've encountered so far, and the
poisoning will help catch the usage of them in future development.

That said, it's worth continuing to explore a more robust solution. I've
submitted an issue to the GLib repository to investigate a long-term fix[1].

[1] https://gitlab.gnome.org/GNOME/glib/-/issues/3670

Reply via email to