]> xenbits.xensource.com Git - libvirt.git/commitdiff
systemd: Make @sockprefix@ optional
authorAndrea Bolognani <abologna@redhat.com>
Tue, 19 Sep 2023 15:25:27 +0000 (17:25 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 26 Sep 2023 14:57:50 +0000 (16:57 +0200)
For most services, the socket paths can be derived trivially from
the name of the daemon: for virtqemud, for example, they will be

  /run/libvirt/virtqemud-sock
  /run/libvirt/virtqemud-sock-ro
  /run/libvirt/virtqemud-admin-sock

libvirtd and virtproxyd are the exceptions, since their socket
paths will be

  /run/libvirt/libvirt-sock
  /run/libvirt/libvirt-sock-ro
  /run/libvirt/libvirt-admin-sock

So we still need to be able to provide a custom @sockprefix@ in
those cases, but in the most common scenario we can do away with
the requirement by introducing a sensible default.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/meson.build

index 9d5085a8aa02e7c7b36fead4dbb885bcf903ec54..6c85cc9b9bea64bc1bccd3d01df7a28525f2e2e8 100644 (file)
@@ -196,7 +196,7 @@ guest_unit_files = []
 #   * service - name of the service (required)
 #   * service_in - service source file (required)
 #   * name - socket description (required)
-#   * sockprefix - socket prefix name (required)
+#   * sockprefix - socket prefix name (optional, default unit['service'])
 #   * sockets - array of additional sockets (optional, default [ 'main', 'ro', 'admin' ])
 #   * socket_$name_in - additional socket source files (optional, default remote/libvirtd.socket.in )
 #   * deps - socket dependencies (optional, default '')
@@ -811,7 +811,7 @@ if conf.has('WITH_LIBVIRTD')
         'initconfdir': initconfdir,
         'name': unit['name'],
         'service': unit['service'],
-        'sockprefix': unit['sockprefix'],
+        'sockprefix': unit.get('sockprefix', unit['service']),
         'deps': unit.get('deps', ''),
         'sockmode': sockmode,
       })