On Mon, Feb 28, 2022 at 08:05:52PM +0100, Nicolas Saenz Julienne wrote: > On Thu, 2022-02-24 at 09:48 +0000, Stefan Hajnoczi wrote: > > On Mon, Feb 21, 2022 at 06:08:43PM +0100, Nicolas Saenz Julienne wrote: > > > diff --git a/qom/meson.build b/qom/meson.build > > > index 062a3789d8..c20e5dd1cb 100644 > > > --- a/qom/meson.build > > > +++ b/qom/meson.build > > > @@ -4,6 +4,7 @@ qom_ss.add(files( > > > 'object.c', > > > 'object_interfaces.c', > > > 'qom-qobject.c', > > > + '../util/event-loop.c', > > > > This looks strange. I expected util/event-loop.c to be in > > util/meson.build and added to the util_ss SourceSet instead of qom_ss. > > > > What is the reason for this? > > Sorry I meant to move it into the qom directory while cleaning up the series > but forgot about it. > > That said, I can see how moving 'event-loop-backend' in qom_ss isn't the > cleanest.
Yes, qom/ is meant for the QEMU Object Model infrastructure itself, not for all the QOM classes that rely on it. > So I tried moving it into util_ss, but for some reason nobody is calling > 'type_init(even_loop_register_type)'. My guess is there's some compilation > quirk I'm missing. Maybe the issue is that libqemuutil.a (util_ss) object files are linked on demand. If there are no symbol dependencies in the main QEMU code to event-loop.o then it won't be linked into the executable. That may be why event_loop_register_type() isn't being called (it's set up by an __attribute__((constructor)) function in event-loop.o so it doesn't help create a symbol dependency). > Any suggestions? I wonder if util_ss is the right spot for > 'event-loop-backend' > anyway, but I don't have a better idea. What Paolo suggested sounds good: move event-loop.c next to iothread.c in the top-level source directory. Stefan
signature.asc
Description: PGP signature