systemd: Accept multiple files for service_extra_in/socket_extra_in

Now that the underlying script is able to merge an arbitrary
number of units into the base template, expose this possibility
in the build system.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Andrea Bolognani 2023-09-28 11:43:31 +02:00
parent b1aeca5db0
commit c8ae549cd5
9 changed files with 33 additions and 15 deletions

View File

@ -60,7 +60,9 @@ if conf.has('WITH_CH')
virt_daemon_units += {
'service': 'virtchd',
'name': 'Cloud Hypervisor',
'service_extra_in': files('virtchd.service.extra.in'),
'service_extra_in': [
files('virtchd.service.extra.in'),
],
}
virt_install_dirs += [

View File

@ -67,8 +67,12 @@ if conf.has('WITH_LIBXL')
virt_daemon_units += {
'service': 'virtxend',
'name': 'Xen',
'service_extra_in': files('virtxend.service.extra.in'),
'socket_extra_in': files('virtxend.socket.extra.in'),
'service_extra_in': [
files('virtxend.service.extra.in'),
],
'socket_extra_in': [
files('virtxend.socket.extra.in'),
],
}
openrc_init_files += {

View File

@ -165,7 +165,9 @@ if conf.has('WITH_LXC')
virt_daemon_units += {
'service': 'virtlxcd',
'name': 'LXC',
'service_extra_in': files('virtlxcd.service.extra.in'),
'service_extra_in': [
files('virtlxcd.service.extra.in'),
],
}
openrc_init_files += {

View File

@ -199,8 +199,8 @@ guest_unit_files = []
# * sockets - array of additional sockets (optional, default [ 'main', 'ro', 'admin' ])
# * service_in - service source file (optional, default virtd.service.in)
# * socket_$name_in - additional socket source files (optional, default virtd.socket.in or virtd-$name.socket.in)
# * service_extra_in - unit to merge with service_in (optional, default None)
# * socket_extra_in - unit to merge with socket_$name_in (optional, default None)
# * service_extra_in - units to merge with service_in (optional, default [])
# * socket_extra_in - units to merge with socket_$name_in (optional, default [])
virt_daemon_units = []
# openrc_init_files
@ -824,9 +824,9 @@ if conf.has('WITH_LIBVIRTD')
if 'service_extra_in' in unit
service_in = configure_file(
input: [ service_in, unit['service_extra_in'] ],
input: [ service_in ] + unit['service_extra_in'],
output: '@0@.in'.format(service_out),
command: [ merge_systemd_units_prog, '@INPUT0@', '@INPUT1@' ],
command: [ merge_systemd_units_prog, '@INPUT@' ],
capture: true,
)
endif
@ -852,9 +852,9 @@ if conf.has('WITH_LIBVIRTD')
if 'socket_extra_in' in unit
socket_in = configure_file(
input: [ socket_in, unit['socket_extra_in'] ],
input: [ socket_in ] + unit['socket_extra_in'],
output: '@0@.in'.format(socket_out),
command: [ merge_systemd_units_prog, '@INPUT0@', '@INPUT1@' ],
command: [ merge_systemd_units_prog, '@INPUT@' ],
capture: true,
)
endif

View File

@ -63,7 +63,9 @@ if conf.has('WITH_NETWORK')
virt_daemon_units += {
'service': 'virtnetworkd',
'name': 'network',
'service_extra_in': files('virtnetworkd.service.extra.in'),
'service_extra_in': [
files('virtnetworkd.service.extra.in'),
],
}
openrc_init_files += {

View File

@ -184,7 +184,9 @@ if conf.has('WITH_QEMU')
virt_daemon_units += {
'service': 'virtqemud',
'name': 'QEMU',
'service_extra_in': files('virtqemud.service.extra.in'),
'service_extra_in': [
files('virtqemud.service.extra.in'),
],
}
openrc_init_files += {

View File

@ -112,7 +112,9 @@ if conf.has('WITH_STORAGE')
virt_daemon_units += {
'service': 'virtstoraged',
'name': 'storage',
'service_extra_in': files('virtstoraged.service.extra.in'),
'service_extra_in': [
files('virtstoraged.service.extra.in'),
],
}
openrc_init_files += {

View File

@ -58,7 +58,9 @@ if conf.has('WITH_VBOX')
virt_daemon_units += {
'service': 'virtvboxd',
'name': 'VirtualBox',
'service_extra_in': files('virtvboxd.service.extra.in'),
'service_extra_in': [
files('virtvboxd.service.extra.in'),
],
}
openrc_init_files += {

View File

@ -49,7 +49,9 @@ if conf.has('WITH_VZ')
virt_daemon_units += {
'service': 'virtvzd',
'name': 'vz',
'service_extra_in': files('virtvzd.service.extra.in'),
'service_extra_in': [
files('virtvzd.service.extra.in'),
],
}
openrc_init_files += {