On Tue, Sep 26, 2023 at 01:14:33PM +0100, Daniel P. Berrangé wrote:
On Tue, Sep 26, 2023 at 07:02:19AM -0500, Andrea Bolognani wrote:
> I don't think it helps much with not storing additional data inside
> the build system, unless we want to store the contents of the various
> common snippets in separate files? Something like
>
> common_service = fs.read('common_service.inc')
> unit_conf = configuration_data({
> 'common_service' = common_service,
> })
>
> We'd have to fake fs.read() because it was introduced in 0.57 though.
> And we'd have to run the contents of the common parts through
> variable substitution anyway, because they will contain a bunch of
> lines like
>
> Also=@service@.socket
> Also=@service(a)-ro.socket
> Also=@service(a)-admin.socket
>
> I'm not sure the result would look much better, but I can give it a
> try.
Don't try to do any of this in meson. We should just have a standalone
python script that can combine the daemon specific unit file contents
with the common unit file contents. eg
scripts/merge-unit-file.py \
src/qemu/virtqemud.service.in \
src/rpc/virtd.service.in \
build/src/virtqemud.service
It feels a bit silly to shell out to Python to perform what is
ultimately a bunch of variable substitutions, as if that wasn't part
of Meson's core feature set... But I'll give it a try and see how it
turns out.
Can you please take a look at the remaining patches in the meantime,
and provide feedback on the changes that are made to the various
services and sockets as part of them? Thanks in advance :)
--
Andrea Bolognani / Red Hat / Virtualization