generation of virtproxd socket files

Martin Kletzander mkletzan at redhat.com
Tue Feb 9 13:56:36 UTC 2021


On Mon, Feb 08, 2021 at 04:09:16PM -0700, Jim Fehlig wrote:
>Hi All,
>
>I received a report [1] and verified that virtproxyd*.socket files have broken
>syntax. E.g. from virtproxyd.socket
>
>[Unit]
>Description=Libvirt proxy local socket
>Before=virtproxyd.service
>libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket libvirtd-tcp.socket
>libvirtd-tls.socket
>
>virtproxyd.socket should 'Conflicts' with the libvirtd sockets. I suspect this
>regressed in the switch to meson. I checked a libvirt 6.0.0 installation and
>indeed it has
>
>Conflicts=libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket
>libvirtd-tcp.socket libvirtd-tls.socket
>

It looks like the issue might have various root causes as I am unsure myself
about what exactly was the idea behind some of the actions in the code.  But all
the .socket files are generated from `src/remote/libvirtd.socket.in` and the line which causes trouble for you is probably this one:

   https://gitlab.com/libvirt/libvirt/-/blob/a619e28dba8c/src/remote/libvirtd.socket.in#L4

This is used in `src/meson.build` to generate socket files for all the services:

   https://gitlab.com/libvirt/libvirt/-/blob/a619e28dba8c/src/meson.build#L792-833

The proxy daemon service lists the other sockets as dependencies here (even though it uses variable clearly named `*_conflicts`):

   https://gitlab.com/libvirt/libvirt/-/blob/a619e28dba8c/src/remote/meson.build#L233

and I'm not sure whether that should be prefixed with "Conflicts=" or whether
the `conflicts` field should come into play, although it looks like it is not
used anywhere else:

   https://gitlab.com/libvirt/libvirt/-/blob/a619e28dba8c/src/meson.build#L204

So long story short: I do not have a right solution for you, but I hope this can
help you figure out where to go from here.

Actually, let me check if the `deps` are used anywhere else for a unit... yep,
it is, for virtxend and it actually uses it for the whole line it needs in that
context.  So maybe a simple patch like this could help?

diff --git i/src/remote/meson.build w/src/remote/meson.build
index 9ad2f6ab1c26..0a188268b58b 100644
--- i/src/remote/meson.build
+++ w/src/remote/meson.build
@@ -230,7 +230,7 @@ if conf.has('WITH_REMOTE')
        'name': 'Libvirt proxy',
        'sockprefix': 'libvirt',
        'sockets': [ 'main', 'ro', 'admin', 'tcp', 'tls' ],
-      'deps': libvirtd_socket_conflicts,
+      'deps': 'Conflicts=' + libvirtd_socket_conflicts,
      }

      openrc_init_files += {
--

I'm not well versed in the systemd unit files, so feel free to adjust for
whatever feels right.

I hope that helps, have a nice day.
Martin

>I blame it on Monday and my mind stuck in the weekend, but I spent too much time
>trying to figure out how those socket files are generated before writing this
>mail. It would be much appreciated if someone can give me a nudge in the right
>direction :-).
>
>Regards,
>Jim
>
>[1] https://bugzilla.opensuse.org/show_bug.cgi?id=1181838
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210209/c9000a22/attachment-0001.sig>


More information about the libvir-list mailing list