mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 04:09:46 +00:00
Merge pull request #4020 from brauner/2021-10-28.fixes
build & mainloop: fixes
This commit is contained in:
commit
7f71fbfd76
33
meson.build
33
meson.build
@ -59,6 +59,7 @@ logpath = get_option('log-path')
|
|||||||
lxcpathprefix = get_option('config-path')
|
lxcpathprefix = get_option('config-path')
|
||||||
rootfsmount = get_option('rootfs-mount-dir')
|
rootfsmount = get_option('rootfs-mount-dir')
|
||||||
runtimepath = join_paths(prefixdir, get_option('runtime-path'))
|
runtimepath = join_paths(prefixdir, get_option('runtime-path'))
|
||||||
|
wants_io_uring = get_option('io-uring-event-loop')
|
||||||
|
|
||||||
conf.set_quoted('BINDIR', bindir)
|
conf.set_quoted('BINDIR', bindir)
|
||||||
conf.set_quoted('DATADIR', datadir)
|
conf.set_quoted('DATADIR', datadir)
|
||||||
@ -279,6 +280,11 @@ foreach ident : [
|
|||||||
conf.set10('HAVE_' + ident[0].to_upper(), have)
|
conf.set10('HAVE_' + ident[0].to_upper(), have)
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
|
if wants_io_uring == true
|
||||||
|
liburing = dependency('liburing')
|
||||||
|
conf.set10('HAVE_LIBURING', liburing.found())
|
||||||
|
endif
|
||||||
|
|
||||||
sh = find_program('sh')
|
sh = find_program('sh')
|
||||||
git = find_program('git', required : false)
|
git = find_program('git', required : false)
|
||||||
time_epoch = run_command(sh, '-c', 'echo "$SOURCE_DATE_EPOCH"').stdout().strip()
|
time_epoch = run_command(sh, '-c', 'echo "$SOURCE_DATE_EPOCH"').stdout().strip()
|
||||||
@ -383,6 +389,17 @@ subdir('src/include')
|
|||||||
subdir('src/lxc/tools/include')
|
subdir('src/lxc/tools/include')
|
||||||
subdir('src/lxc')
|
subdir('src/lxc')
|
||||||
|
|
||||||
|
liblxc_dependencies = [threads,
|
||||||
|
libseccomp,
|
||||||
|
libcap,
|
||||||
|
libopenssl,
|
||||||
|
libselinux,
|
||||||
|
libapparmor]
|
||||||
|
|
||||||
|
if wants_io_uring == true
|
||||||
|
liblxc_dependencies += [liburing]
|
||||||
|
endif
|
||||||
|
|
||||||
liblxc = shared_library(
|
liblxc = shared_library(
|
||||||
'lxc',
|
'lxc',
|
||||||
version : liblxc_version,
|
version : liblxc_version,
|
||||||
@ -390,22 +407,12 @@ liblxc = shared_library(
|
|||||||
link_args : ['-DPIC'],
|
link_args : ['-DPIC'],
|
||||||
c_args : ['-DPIC'],
|
c_args : ['-DPIC'],
|
||||||
link_whole : [liblxc_static],
|
link_whole : [liblxc_static],
|
||||||
dependencies : [threads,
|
dependencies: liblxc_dependencies,
|
||||||
libseccomp,
|
|
||||||
libcap,
|
|
||||||
libopenssl,
|
|
||||||
libselinux,
|
|
||||||
libapparmor],
|
|
||||||
install : true)
|
install : true)
|
||||||
|
|
||||||
liblxc_dep = declare_dependency(
|
liblxc_dep = declare_dependency(
|
||||||
link_with: liblxc,
|
link_with: liblxc,
|
||||||
dependencies : [threads,
|
dependencies: liblxc_dependencies)
|
||||||
libseccomp,
|
|
||||||
libcap,
|
|
||||||
libopenssl,
|
|
||||||
libselinux,
|
|
||||||
libapparmor])
|
|
||||||
|
|
||||||
dummy_config_data = configuration_data()
|
dummy_config_data = configuration_data()
|
||||||
dummy_config_data.set_quoted('DUMMY_VARIABLE', '1')
|
dummy_config_data.set_quoted('DUMMY_VARIABLE', '1')
|
||||||
@ -541,7 +548,9 @@ foreach tuple : [
|
|||||||
['SECCOMP'],
|
['SECCOMP'],
|
||||||
['SELinux'],
|
['SELinux'],
|
||||||
['libcap'],
|
['libcap'],
|
||||||
|
['static libcap'],
|
||||||
['openssl'],
|
['openssl'],
|
||||||
|
['liburing'],
|
||||||
]
|
]
|
||||||
|
|
||||||
if tuple.length() >= 2
|
if tuple.length() >= 2
|
||||||
|
@ -36,3 +36,6 @@ option('user-network-conf', type : 'string', value : 'lxc/lxc-usernet',
|
|||||||
|
|
||||||
option('user-network-db', type : 'string', value : 'lxc/nics',
|
option('user-network-db', type : 'string', value : 'lxc/nics',
|
||||||
description : 'user network database')
|
description : 'user network database')
|
||||||
|
|
||||||
|
option('io-uring-event-loop', type : 'boolean', value: 'false',
|
||||||
|
description : 'enable io-uring based event loop')
|
||||||
|
@ -515,8 +515,10 @@ void lxc_mainloop_close(struct lxc_async_descr *descr)
|
|||||||
|
|
||||||
if (descr->type == LXC_MAINLOOP_IO_URING) {
|
if (descr->type == LXC_MAINLOOP_IO_URING) {
|
||||||
#if HAVE_LIBURING
|
#if HAVE_LIBURING
|
||||||
io_uring_queue_exit(descr->ring);
|
if (descr->ring) {
|
||||||
munmap(descr->ring, sizeof(struct io_uring));
|
io_uring_queue_exit(descr->ring);
|
||||||
|
munmap(descr->ring, sizeof(struct io_uring));
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
ERROR("Unsupported io_uring mainloop");
|
ERROR("Unsupported io_uring mainloop");
|
||||||
#endif
|
#endif
|
||||||
|
@ -629,7 +629,8 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
|
|||||||
TRACE("Mainloop is ready");
|
TRACE("Mainloop is ready");
|
||||||
|
|
||||||
ret = lxc_mainloop(&descr, -1);
|
ret = lxc_mainloop(&descr, -1);
|
||||||
close_prot_errno_disarm(descr.epfd);
|
if (descr.type == LXC_MAINLOOP_EPOLL)
|
||||||
|
close_prot_errno_disarm(descr.epfd);
|
||||||
if (ret < 0 || !handler->init_died)
|
if (ret < 0 || !handler->init_died)
|
||||||
goto out_mainloop_console;
|
goto out_mainloop_console;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user