2020-07-27 06:26:42 +00:00
|
|
|
remote_driver_sources = [
|
|
|
|
'remote_driver.c',
|
|
|
|
]
|
|
|
|
|
|
|
|
remote_driver_generated = []
|
|
|
|
|
|
|
|
foreach name : [ 'remote', 'qemu', 'lxc' ]
|
|
|
|
client_bodies_h = '@0@_client_bodies.h'.format(name)
|
|
|
|
protocol_c = '@0@_protocol.c'.format(name)
|
|
|
|
protocol_h = '@0@_protocol.h'.format(name)
|
|
|
|
protocol_x = '@0@_protocol.x'.format(name)
|
|
|
|
|
|
|
|
remote_driver_generated += custom_target(
|
|
|
|
client_bodies_h,
|
|
|
|
input: protocol_x,
|
|
|
|
output: client_bodies_h,
|
|
|
|
command: [
|
|
|
|
gendispatch_prog, '--mode=client', name, name.to_upper(), '@INPUT@',
|
|
|
|
],
|
|
|
|
capture: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
remote_driver_generated += custom_target(
|
|
|
|
protocol_h,
|
|
|
|
input: protocol_x,
|
|
|
|
output: protocol_h,
|
|
|
|
command: [
|
|
|
|
genprotocol_prog, rpcgen_prog, '-h', '@INPUT@', '@OUTPUT@',
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
remote_driver_generated += custom_target(
|
|
|
|
protocol_c,
|
|
|
|
input: protocol_x,
|
|
|
|
output: protocol_c,
|
|
|
|
command: [
|
|
|
|
genprotocol_prog, rpcgen_prog, '-c', '@INPUT@', '@OUTPUT@',
|
|
|
|
],
|
|
|
|
)
|
2020-07-27 07:12:34 +00:00
|
|
|
|
|
|
|
rpc_probe_files += files(protocol_x)
|
2020-07-27 06:26:42 +00:00
|
|
|
endforeach
|
|
|
|
|
2020-07-27 06:44:33 +00:00
|
|
|
remote_daemon_sources = files(
|
|
|
|
'remote_daemon.c',
|
|
|
|
'remote_daemon_config.c',
|
|
|
|
'remote_daemon_dispatch.c',
|
|
|
|
'remote_daemon_stream.c',
|
|
|
|
)
|
|
|
|
|
|
|
|
remote_daemon_generated = []
|
|
|
|
|
|
|
|
foreach name : [ 'remote', 'qemu', 'lxc' ]
|
|
|
|
protocol_x = '@0@_protocol.x'.format(name)
|
|
|
|
dispatch_h = '@0@_daemon_dispatch_stubs.h'.format(name)
|
|
|
|
|
|
|
|
remote_daemon_generated += custom_target(
|
|
|
|
dispatch_h,
|
|
|
|
input: protocol_x,
|
|
|
|
output: dispatch_h,
|
|
|
|
command: [
|
|
|
|
gendispatch_prog, '--mode=server', name, name.to_upper(), '@INPUT@',
|
|
|
|
],
|
|
|
|
capture: true,
|
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
|
2020-07-27 06:51:29 +00:00
|
|
|
# libvirt_conf_files:
|
|
|
|
# Generate libvirtd and virtd template files that are used to generate
|
|
|
|
# daemon configuration files.
|
|
|
|
# Each entry is a dictionary with following items:
|
|
|
|
# * input: source config file (required)
|
|
|
|
# * libvirtd: libvirtd config output template file (required)
|
|
|
|
# * virtd: virtd config output template file (required)
|
|
|
|
libvirt_conf_files = [
|
|
|
|
{
|
|
|
|
'input':'libvirtd.conf.in',
|
|
|
|
'libvirtd':'libvirtd.conf.tmp',
|
|
|
|
'virtd':'virtd.conf.tmp',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'input':'libvirtd.aug.in',
|
|
|
|
'libvirtd':'libvirtd.aug.tmp',
|
|
|
|
'virtd':'virtd.aug.tmp',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'input':'test_libvirtd.aug.in',
|
|
|
|
'libvirtd':'test_libvirtd.aug.tmp',
|
|
|
|
'virtd':'test_virtd.aug.tmp',
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
foreach name : libvirt_conf_files
|
|
|
|
tmp = configure_file(
|
|
|
|
input: name['input'],
|
|
|
|
output: name['libvirtd'],
|
|
|
|
command: [ 'sed', '-e', '/[@]CUT_ENABLE_IP[@]/d', '-e', '/[@]END[@]/d', '@INPUT@' ],
|
|
|
|
capture: true,
|
|
|
|
)
|
|
|
|
set_variable(name['libvirtd'].underscorify(), tmp)
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
foreach name : libvirt_conf_files
|
|
|
|
tmp = configure_file(
|
|
|
|
input: name['input'],
|
|
|
|
output: name['virtd'],
|
|
|
|
command: [ 'sed', '-e', '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d', '@INPUT@' ],
|
|
|
|
capture: true,
|
|
|
|
)
|
|
|
|
set_variable(name['virtd'].underscorify(), tmp)
|
|
|
|
endforeach
|
|
|
|
|
2020-07-27 07:03:25 +00:00
|
|
|
libvirtd_socket_unit_files = [
|
|
|
|
'libvirtd.socket',
|
|
|
|
'libvirtd-ro.socket',
|
|
|
|
'libvirtd-admin.socket',
|
|
|
|
'libvirtd-tcp.socket',
|
|
|
|
'libvirtd-tls.socket',
|
|
|
|
]
|
|
|
|
|
|
|
|
libvirtd_socket_conflicts = ' '.join(libvirtd_socket_unit_files)
|
|
|
|
|
2020-07-27 07:06:59 +00:00
|
|
|
logrotate_files = [
|
|
|
|
'libvirtd.qemu',
|
|
|
|
'libvirtd.lxc',
|
|
|
|
'libvirtd.libxl',
|
|
|
|
'libvirtd',
|
|
|
|
]
|
|
|
|
|
2020-07-27 06:26:42 +00:00
|
|
|
if conf.has('WITH_REMOTE')
|
|
|
|
remote_driver_lib = static_library(
|
|
|
|
'virt_remote_driver',
|
|
|
|
[
|
|
|
|
remote_driver_sources,
|
|
|
|
remote_driver_generated,
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
rpc_dep,
|
|
|
|
sasl_dep,
|
|
|
|
src_dep,
|
|
|
|
xdr_dep,
|
|
|
|
],
|
|
|
|
include_directories: [
|
|
|
|
conf_inc_dir,
|
|
|
|
],
|
|
|
|
)
|
2020-07-27 06:39:38 +00:00
|
|
|
|
2020-07-28 11:50:04 +00:00
|
|
|
check_protocols += {
|
|
|
|
'name': 'remote_protocol',
|
|
|
|
'lib': remote_driver_lib,
|
|
|
|
}
|
|
|
|
|
|
|
|
check_protocols += {
|
|
|
|
'name': 'qemu_protocol',
|
|
|
|
'lib': remote_driver_lib,
|
|
|
|
}
|
|
|
|
|
|
|
|
check_protocols += {
|
|
|
|
'name': 'lxc_protocol',
|
|
|
|
'lib': remote_driver_lib,
|
|
|
|
}
|
|
|
|
|
2020-07-27 06:39:38 +00:00
|
|
|
libvirt_libs += remote_driver_lib
|
2020-06-22 14:51:20 +00:00
|
|
|
|
|
|
|
if conf.has('WITH_LIBVIRTD')
|
2020-07-27 07:03:25 +00:00
|
|
|
guest_unit_files += files('virt-guest-shutdown.target')
|
|
|
|
|
2020-06-22 14:51:20 +00:00
|
|
|
virt_daemons += {
|
|
|
|
'name': 'libvirtd',
|
|
|
|
'c_args': [
|
|
|
|
'-DSOCK_PREFIX="libvirt"',
|
|
|
|
'-DDAEMON_NAME="libvirtd"',
|
|
|
|
'-DWITH_IP',
|
|
|
|
'-DLIBVIRTD',
|
|
|
|
],
|
|
|
|
}
|
2020-06-22 14:53:51 +00:00
|
|
|
|
2020-07-28 09:54:39 +00:00
|
|
|
virt_daemon_confs += {
|
|
|
|
'name': 'libvirtd',
|
|
|
|
'with_ip': true,
|
|
|
|
}
|
|
|
|
|
2020-07-27 07:03:25 +00:00
|
|
|
virt_daemon_units += {
|
|
|
|
'service': 'libvirtd',
|
|
|
|
'service_in': files('libvirtd.service.in'),
|
|
|
|
'name': 'Libvirt',
|
2020-08-03 15:20:59 +00:00
|
|
|
'sockprefix': 'libvirt',
|
2020-07-27 07:03:25 +00:00
|
|
|
'sockets': [ 'main', 'ro', 'admin', 'tcp', 'tls' ],
|
|
|
|
}
|
|
|
|
|
2020-07-28 10:11:31 +00:00
|
|
|
openrc_init_files += {
|
|
|
|
'name': 'libvirtd',
|
|
|
|
'in_file': files('libvirtd.init.in'),
|
|
|
|
'confd': files('libvirtd.confd'),
|
|
|
|
}
|
|
|
|
|
2020-06-25 15:46:33 +00:00
|
|
|
sysconf_files += {
|
|
|
|
'name': 'libvirtd',
|
|
|
|
'file': files('libvirtd.sysconf'),
|
|
|
|
}
|
|
|
|
|
2020-06-22 14:53:51 +00:00
|
|
|
virt_daemons += {
|
|
|
|
'name': 'virtproxyd',
|
|
|
|
'c_args': [
|
|
|
|
'-DSOCK_PREFIX="libvirt"',
|
|
|
|
'-DDAEMON_NAME="virtproxyd"',
|
|
|
|
'-DWITH_IP',
|
|
|
|
'-DVIRTPROXYD',
|
|
|
|
],
|
|
|
|
}
|
2020-07-28 09:54:39 +00:00
|
|
|
|
|
|
|
virt_daemon_confs += {
|
|
|
|
'name': 'virtproxyd',
|
|
|
|
'with_ip': true,
|
|
|
|
}
|
2020-07-27 07:03:25 +00:00
|
|
|
|
|
|
|
virt_daemon_units += {
|
|
|
|
'service': 'virtproxyd',
|
|
|
|
'service_in': files('virtproxyd.service.in'),
|
|
|
|
'name': 'Libvirt proxy',
|
2020-08-03 15:20:59 +00:00
|
|
|
'sockprefix': 'libvirt',
|
2020-07-27 07:03:25 +00:00
|
|
|
'sockets': [ 'main', 'ro', 'admin', 'tcp', 'tls' ],
|
|
|
|
'deps': libvirtd_socket_conflicts,
|
|
|
|
}
|
2020-07-28 10:11:31 +00:00
|
|
|
|
|
|
|
openrc_init_files += {
|
|
|
|
'name': 'virtproxyd',
|
|
|
|
'in_file': files('virtproxyd.init.in'),
|
|
|
|
'confd': files('virtproxyd.confd'),
|
|
|
|
}
|
2020-06-25 15:46:33 +00:00
|
|
|
|
|
|
|
sysconf_files += {
|
|
|
|
'name': 'virtproxyd',
|
|
|
|
'file': files('virtproxyd.sysconf'),
|
|
|
|
}
|
2020-07-23 10:41:32 +00:00
|
|
|
|
|
|
|
virt_install_dirs += [
|
|
|
|
localstatedir / 'log' / 'libvirt',
|
|
|
|
]
|
2020-07-27 07:06:59 +00:00
|
|
|
|
|
|
|
logrotate_conf = configuration_data()
|
|
|
|
logrotate_conf.set('localstatedir', localstatedir)
|
|
|
|
|
|
|
|
foreach name : logrotate_files
|
|
|
|
log_file = configure_file(
|
|
|
|
input: '@0@.logrotate.in'.format(name),
|
|
|
|
output: '@0@.logrotate'.format(name),
|
|
|
|
configuration: logrotate_conf,
|
|
|
|
)
|
|
|
|
install_data(
|
|
|
|
log_file,
|
|
|
|
install_dir: sysconfdir / 'logrotate.d',
|
|
|
|
rename: [ name ],
|
|
|
|
)
|
|
|
|
endforeach
|
2020-06-23 11:55:37 +00:00
|
|
|
|
|
|
|
if conf.has('WITH_SYSCTL')
|
|
|
|
# Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on
|
|
|
|
# /usr/lib/sysctl.d/ even when libdir is /usr/lib64
|
|
|
|
install_data(
|
|
|
|
'libvirtd.sysctl',
|
|
|
|
install_dir: prefix / 'lib' / 'sysctl.d',
|
|
|
|
rename: [ '60-libvirtd.conf' ],
|
|
|
|
)
|
|
|
|
endif
|
2020-06-17 23:38:17 +00:00
|
|
|
|
|
|
|
if conf.has('WITH_POLKIT')
|
|
|
|
polkitdir = datadir / 'polkit-1'
|
|
|
|
install_data(
|
|
|
|
'libvirtd.policy',
|
|
|
|
install_dir: polkitdir / 'actions',
|
|
|
|
rename: [ 'org.libvirt.unix.policy' ],
|
|
|
|
)
|
|
|
|
install_data(
|
|
|
|
'libvirtd.rules',
|
|
|
|
install_dir: polkitdir / 'rules.d',
|
|
|
|
rename: [ '50-libvirt.rules' ],
|
|
|
|
)
|
|
|
|
endif
|
2020-06-22 14:51:20 +00:00
|
|
|
endif
|
2020-07-27 06:26:42 +00:00
|
|
|
endif
|
2020-07-27 06:35:58 +00:00
|
|
|
|
|
|
|
if conf.has('WITH_REMOTE')
|
|
|
|
used_sym_files += 'libvirt_remote.syms'
|
|
|
|
else
|
|
|
|
sym_files += 'libvirt_remote.syms'
|
|
|
|
endif
|
2020-07-27 06:41:59 +00:00
|
|
|
|
2020-06-23 12:09:16 +00:00
|
|
|
# This is needed for clients too, so can't wrap in
|
|
|
|
# the WITH_LIBVIRTD conditional
|
|
|
|
if conf.has('WITH_SASL')
|
|
|
|
install_data(
|
|
|
|
'libvirtd.sasl',
|
|
|
|
install_dir: sysconfdir / 'sasl2',
|
|
|
|
rename: [ 'libvirt.conf' ],
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2020-07-27 06:41:59 +00:00
|
|
|
remote_inc_dir = include_directories('.')
|