]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
2 years agotests: use busybox in lxc-test-unpriv
Christian Brauner [Mon, 16 Aug 2021 15:44:54 +0000 (17:44 +0200)]
tests: use busybox in lxc-test-unpriv

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agotests: use busybox in lxc-test-no-new-privs
Christian Brauner [Mon, 16 Aug 2021 15:40:45 +0000 (17:40 +0200)]
tests: use busybox in lxc-test-no-new-privs

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agotest: use busybox in lxc-test-autostart
Christian Brauner [Mon, 16 Aug 2021 15:40:04 +0000 (17:40 +0200)]
test: use busybox in lxc-test-autostart

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agotest: use busybox in lxc-test-apparmor-mount
Christian Brauner [Mon, 16 Aug 2021 15:38:49 +0000 (17:38 +0200)]
test: use busybox in lxc-test-apparmor-mount

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agotest: use busybox in lxc-test-apparmor-generated
Christian Brauner [Mon, 16 Aug 2021 15:33:59 +0000 (17:33 +0200)]
test: use busybox in lxc-test-apparmor-generated

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agotests: fix order in sys_mixed
Christian Brauner [Tue, 17 Aug 2021 10:14:53 +0000 (12:14 +0200)]
tests: fix order in sys_mixed

We need to set the config item after we loaded the config obviously.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: allow for tty allocation even when container did not request separate devpts...
Christian Brauner [Tue, 17 Aug 2021 09:38:11 +0000 (11:38 +0200)]
conf: allow for tty allocation even when container did not request separate devpts instance

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agobusybox: simplify
Christian Brauner [Tue, 17 Aug 2021 09:03:17 +0000 (11:03 +0200)]
busybox: simplify

Start relying on autodev for busybox template and wipe all the device
creation.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agobusybox: mount sys:ro
Christian Brauner [Tue, 17 Aug 2021 09:07:38 +0000 (11:07 +0200)]
busybox: mount sys:ro

There's no udev so sys doesn't need to be read-write.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoterminal: use /dev/ptmx when allocating pty devices from devpts instances we didn...
Christian Brauner [Tue, 17 Aug 2021 08:43:34 +0000 (10:43 +0200)]
terminal: use /dev/ptmx when allocating pty devices from devpts instances we didn't mount ourselves

When we aren't told what devpts instance to allocate from we assume it
is the one in the caller's mount namespace.
This poses a slight complication, a lot of distros will change
permissions on /dev/ptmx so it can be opened by unprivileged users but
will not change permissions on /dev/pts/ptmx itself. In addition,
/dev/ptmx can either be a symlink, a bind-mount, or a separate device
node. So we need to allow for fairly lax lookup.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agofile_utils: add same_device() helper
Christian Brauner [Tue, 17 Aug 2021 08:38:44 +0000 (10:38 +0200)]
file_utils: add same_device() helper

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3938 from brauner/2021-08-16.fixes
Stéphane Graber [Mon, 16 Aug 2021 16:35:46 +0000 (12:35 -0400)]
Merge pull request #3938 from brauner/2021-08-16.fixes

cgroups: simplify offline and isolated cpumask handling

2 years agoMerge pull request #3939 from Cypresslin/fix-test-exec-bit
Christian Brauner [Mon, 16 Aug 2021 10:06:16 +0000 (12:06 +0200)]
Merge pull request #3939 from Cypresslin/fix-test-exec-bit

tests: set lxc-test-automount/createconfig/snapdeps as executable

2 years agotests: set lxc-test-automount/createconfig/snapdeps as executable
Po-Hsu Lin [Mon, 16 Aug 2021 09:32:24 +0000 (17:32 +0800)]
tests: set lxc-test-automount/createconfig/snapdeps as executable

The debian/tests/exercise script will skip those non-executable tests
in src/test, thus these three tests were never get tested.

Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
2 years agocgroups: simplify offline and isolated cpu handling
Christian Brauner [Mon, 16 Aug 2021 09:11:43 +0000 (11:11 +0200)]
cgroups: simplify offline and isolated cpu handling

Don't create separate cpumask arrays for them. Just clear the ones that
are set in the original cpumask array.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agocgroups: use semantically clean check in cpuset1_cpus_initialize()
Christian Brauner [Mon, 16 Aug 2021 08:56:51 +0000 (10:56 +0200)]
cgroups: use semantically clean check in cpuset1_cpus_initialize()

The variable is a pointer not a integer.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3937 from brauner/2021-08-13.fixes
Stéphane Graber [Sat, 14 Aug 2021 15:12:27 +0000 (11:12 -0400)]
Merge pull request #3937 from brauner/2021-08-13.fixes

cgroups: cpumask fixes

2 years agocgroups: fix cpumask handling
Christian Brauner [Fri, 13 Aug 2021 22:36:21 +0000 (00:36 +0200)]
cgroups: fix cpumask handling

Link: https://discuss.linuxcontainers.org/t/lxc-4-0-9-lxc-start-sigabrt-on-systems-with-defined-offline-cpus-and-a-total-number-of-cpus-divisible-by-32
Signed-off-by: Jim Ferrigno <jim.ferrigno@oracle.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agocgroups: fix comments in cpuset1_initialize()
Christian Brauner [Fri, 13 Aug 2021 19:37:02 +0000 (21:37 +0200)]
cgroups: fix comments in cpuset1_initialize()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoRevert "cgroups: fix cpu bitmasks"
Christian Brauner [Fri, 13 Aug 2021 19:35:30 +0000 (21:35 +0200)]
Revert "cgroups: fix cpu bitmasks"

This reverts commit e0f7296a6d537f0d2eb5fbc6d7f9e007d11d516a.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3934 from brauner/2021-08-12.fixes
Christian Brauner [Thu, 12 Aug 2021 08:12:45 +0000 (10:12 +0200)]
Merge pull request #3934 from brauner/2021-08-12.fixes

cgroups: cpumask fixes

2 years agocgroups: s/calloc/zalloc/g
Christian Brauner [Thu, 12 Aug 2021 07:00:00 +0000 (09:00 +0200)]
cgroups: s/calloc/zalloc/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agocgroups: fix cpu bitmasks
Jim Ferrigno [Wed, 11 Aug 2021 18:44:32 +0000 (14:44 -0400)]
cgroups: fix cpu bitmasks

Link: https://discuss.linuxcontainers.org/t/lxc-4-0-9-lxc-start-sigabrt-on-systems-with-defined-offline-cpus-and-a-total-number-of-cpus-divisible-by-32
Signed-off-by: Jim Ferrigno <jim.ferrigno@oracle.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3899 from denisfa/master
Stéphane Graber [Wed, 11 Aug 2021 17:42:18 +0000 (13:42 -0400)]
Merge pull request #3899 from denisfa/master

Improve bash completion experience.

2 years agoMerge pull request #3932 from brauner/2021-08-11.fixes
Stéphane Graber [Wed, 11 Aug 2021 17:22:48 +0000 (13:22 -0400)]
Merge pull request #3932 from brauner/2021-08-11.fixes

mainloop: further io_uring fixes

2 years agomainloop: disable IORING_SETUP_SQPOLL for now
Christian Brauner [Wed, 11 Aug 2021 15:46:54 +0000 (17:46 +0200)]
mainloop: disable IORING_SETUP_SQPOLL for now

It's a bit more complicated to use then I envisioned here.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agomainloop: add comments about multishot and oneshot cleanup
Christian Brauner [Wed, 11 Aug 2021 14:54:34 +0000 (16:54 +0200)]
mainloop: add comments about multishot and oneshot cleanup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agomainloop: s/handler_name/name/g
Christian Brauner [Wed, 11 Aug 2021 13:58:58 +0000 (15:58 +0200)]
mainloop: s/handler_name/name/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3931 from brauner/2021-08-11.fixes
Stéphane Graber [Wed, 11 Aug 2021 14:58:21 +0000 (10:58 -0400)]
Merge pull request #3931 from brauner/2021-08-11.fixes

memory_utils: make cleanup handler as unused

2 years agomainloop: move variables into tighter scope
Christian Brauner [Wed, 11 Aug 2021 13:52:12 +0000 (15:52 +0200)]
mainloop: move variables into tighter scope

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agomemory_utils: make cleanup handler as unused
Christian Brauner [Wed, 11 Aug 2021 13:43:18 +0000 (15:43 +0200)]
memory_utils: make cleanup handler as unused

They are sometimes used to just clean something up automatically at end
of scope but the variables themselves might not be actually used.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3930 from brauner/2021-08-10.fixes
Stéphane Graber [Wed, 11 Aug 2021 13:08:09 +0000 (09:08 -0400)]
Merge pull request #3930 from brauner/2021-08-10.fixes

mainloop: io_uring cleanup handling fixes

2 years agomainloop: fix io_uring cleanup handling
Christian Brauner [Wed, 11 Aug 2021 09:03:13 +0000 (11:03 +0200)]
mainloop: fix io_uring cleanup handling

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agomainloop: remove CANCEL_RAISE flag
Christian Brauner [Tue, 10 Aug 2021 15:57:26 +0000 (17:57 +0200)]
mainloop: remove CANCEL_RAISE flag

This is really not needed since we're not checking it anywhere anyway.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agomainloop: minor fixes
Christian Brauner [Tue, 10 Aug 2021 15:42:41 +0000 (17:42 +0200)]
mainloop: minor fixes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3928 from simondeziel/download-user-agent
Christian Brauner [Tue, 10 Aug 2021 15:09:06 +0000 (17:09 +0200)]
Merge pull request #3928 from simondeziel/download-user-agent

lxc-download: customize the user-agent to include LXC package version and compat level

2 years agoMerge pull request #3929 from tych0/fix-sys-poll-warning
Christian Brauner [Tue, 10 Aug 2021 15:07:19 +0000 (17:07 +0200)]
Merge pull request #3929 from tych0/fix-sys-poll-warning

mainloop: s,sys/poll,poll

2 years agomainloop: s,sys/poll,poll
Tycho Andersen [Tue, 10 Aug 2021 14:45:21 +0000 (08:45 -0600)]
mainloop: s,sys/poll,poll

I get the following warning (which then fails the build because of
-Werror):

In file included from mainloop.c:11:
/usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Werror=cpp]
    1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
      |  ^~~~~~~

Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
2 years agolxc-download: add LXC version/compat level to user-agent
Simon Deziel [Tue, 10 Aug 2021 14:35:12 +0000 (10:35 -0400)]
lxc-download: add LXC version/compat level to user-agent

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
2 years agoMerge pull request #3924 from brauner/2021-06-04.io_uring
Stéphane Graber [Tue, 10 Aug 2021 14:01:55 +0000 (10:01 -0400)]
Merge pull request #3924 from brauner/2021-06-04.io_uring

mainloop: io_uring support

2 years agomainloop: add io_uring support
Christian Brauner [Fri, 4 Jun 2021 16:21:04 +0000 (18:21 +0200)]
mainloop: add io_uring support

Users can choose to compile liblxc with io_uring support. This will
cause LXC to use io_uring instead of epoll.
We're using both, io_uring's one-shot and multi-shot poll mode depending
on the type of handler.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3927 from tomponline/tp-nic-address-broadcast
Christian Brauner [Tue, 10 Aug 2021 11:03:10 +0000 (13:03 +0200)]
Merge pull request #3927 from tomponline/tp-nic-address-broadcast

doc: Adds mention of ability to specify manual IPv4 broadcast address

2 years agodoc: Adds mention of ability to specify manual IPv4 broadcast address
Thomas Parrott [Tue, 10 Aug 2021 10:32:30 +0000 (11:32 +0100)]
doc: Adds mention of ability to specify manual IPv4 broadcast address

See also https://github.com/lxc/lxd/pull/9103

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2 years agotree-wide: s/lxc_epoll_descr/lxc_async_descr/g
Christian Brauner [Fri, 4 Jun 2021 13:13:14 +0000 (15:13 +0200)]
tree-wide: s/lxc_epoll_descr/lxc_async_descr/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: log session keyring failure on WARN level
Christian Brauner [Fri, 6 Aug 2021 07:45:33 +0000 (09:45 +0200)]
conf: log session keyring failure on WARN level

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agocgroups: log at warning instead of error level
Christian Brauner [Wed, 4 Aug 2021 10:31:07 +0000 (12:31 +0200)]
cgroups: log at warning instead of error level

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3926 from stgraber/master
Christian Brauner [Mon, 9 Aug 2021 17:41:40 +0000 (19:41 +0200)]
Merge pull request #3926 from stgraber/master

doc/api-extensions: Grammar fix

2 years agodoc/api-extensions: Grammar fix
Stéphane Graber [Mon, 9 Aug 2021 17:18:44 +0000 (13:18 -0400)]
doc/api-extensions: Grammar fix

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2 years agoMerge pull request #3925 from brauner/2021-08-09.fixes
Stéphane Graber [Mon, 9 Aug 2021 14:25:07 +0000 (10:25 -0400)]
Merge pull request #3925 from brauner/2021-08-09.fixes

lsm/apparmor: small fixes

2 years agolsm/apparmor: use cleanup macro
Christian Brauner [Mon, 9 Aug 2021 13:59:26 +0000 (15:59 +0200)]
lsm/apparmor: use cleanup macro

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agolsm/apparmor: log failure to write AppArmor profile
Christian Brauner [Mon, 9 Aug 2021 13:58:53 +0000 (15:58 +0200)]
lsm/apparmor: log failure to write AppArmor profile

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3923 from brauner/2021-08-05.fixes
Stéphane Graber [Thu, 5 Aug 2021 15:41:23 +0000 (11:41 -0400)]
Merge pull request #3923 from brauner/2021-08-05.fixes

network: fix container with empty network namespaces

2 years agonetwork: fix container with empty network namespaces
Christian Brauner [Thu, 5 Aug 2021 14:16:33 +0000 (16:16 +0200)]
network: fix container with empty network namespaces

Fixes: #3922
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3921 from brauner/2021-08-03.fixes
Stéphane Graber [Tue, 3 Aug 2021 14:02:27 +0000 (10:02 -0400)]
Merge pull request #3921 from brauner/2021-08-03.fixes

conf: rootfs mount option fixes

2 years agotests: add test for rootfs mount options
Christian Brauner [Tue, 3 Aug 2021 12:40:28 +0000 (14:40 +0200)]
tests: add test for rootfs mount options

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: allow mount options for rootfs when using new mount api
Christian Brauner [Tue, 3 Aug 2021 11:16:45 +0000 (13:16 +0200)]
conf: allow mount options for rootfs when using new mount api

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agomount_utils: make some mount helpers static inline
Christian Brauner [Tue, 3 Aug 2021 10:51:24 +0000 (12:51 +0200)]
mount_utils: make some mount helpers static inline

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: let parse_vfs_attr() handle legacy mount flags as well
Christian Brauner [Tue, 3 Aug 2021 10:13:01 +0000 (12:13 +0200)]
conf: let parse_vfs_attr() handle legacy mount flags as well

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: log failure to create tty mountpoint
Christian Brauner [Tue, 3 Aug 2021 07:22:46 +0000 (09:22 +0200)]
conf: log failure to create tty mountpoint

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3920 from brauner/2021-08-02.fixes
Stéphane Graber [Mon, 2 Aug 2021 18:33:37 +0000 (14:33 -0400)]
Merge pull request #3920 from brauner/2021-08-02.fixes

mount_utils: introduce mount_at()

2 years agoconf: refactor lxc_recv_ttys_from_child()
Christian Brauner [Mon, 2 Aug 2021 17:16:54 +0000 (19:16 +0200)]
conf: refactor lxc_recv_ttys_from_child()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: fix logging in lxc_idmapped_mounts_child()
Christian Brauner [Mon, 2 Aug 2021 16:47:44 +0000 (18:47 +0200)]
conf: fix logging in lxc_idmapped_mounts_child()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agomount_utils: introduce mount_at()
Christian Brauner [Mon, 2 Aug 2021 13:30:03 +0000 (15:30 +0200)]
mount_utils: introduce mount_at()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3919 from brauner/2021-07-31.devpts
Stéphane Graber [Sat, 31 Jul 2021 14:54:25 +0000 (10:54 -0400)]
Merge pull request #3919 from brauner/2021-07-31.devpts

terminal: handle kernel without TIOCGPTPEER

2 years agoterminal: fail on unknown error during TIOCGPTPEER
Christian Brauner [Sat, 31 Jul 2021 08:19:57 +0000 (10:19 +0200)]
terminal: fail on unknown error during TIOCGPTPEER

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoterminal: move native terminal allocation from error logging to info
Christian Brauner [Sat, 31 Jul 2021 08:17:36 +0000 (10:17 +0200)]
terminal: move native terminal allocation from error logging to info

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: handle kernels without TIOCGPTPEER
Christian Brauner [Sat, 31 Jul 2021 08:14:39 +0000 (10:14 +0200)]
conf: handle kernels without TIOCGPTPEER

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3918 from brauner/2021-07-30.devpts
Stéphane Graber [Fri, 30 Jul 2021 14:42:39 +0000 (10:42 -0400)]
Merge pull request #3918 from brauner/2021-07-30.devpts

conf: rework console setup

2 years agostart: allow containers to use a native console
Christian Brauner [Fri, 30 Jul 2021 12:28:17 +0000 (14:28 +0200)]
start: allow containers to use a native console

After all of the previous rework we can make it possible for a container
to use a console allocated from the container's devpts instance.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoterminal: remove unused argument from lxc_devpts_terminal()
Christian Brauner [Fri, 30 Jul 2021 11:49:15 +0000 (13:49 +0200)]
terminal: remove unused argument from lxc_devpts_terminal()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: rework console setup
Christian Brauner [Fri, 30 Jul 2021 11:13:28 +0000 (13:13 +0200)]
conf: rework console setup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agofile_utils: add open_at_same()
Christian Brauner [Fri, 30 Jul 2021 11:02:01 +0000 (13:02 +0200)]
file_utils: add open_at_same()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: use mount_fd() during console mounting
Christian Brauner [Fri, 30 Jul 2021 07:40:40 +0000 (09:40 +0200)]
conf: use mount_fd() during console mounting

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: use mount_fd() in lxc_setup_dev_console()
Christian Brauner [Fri, 30 Jul 2021 07:27:54 +0000 (09:27 +0200)]
conf: use mount_fd() in lxc_setup_dev_console()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: use mount_fd() helper when mounting ttys
Christian Brauner [Fri, 30 Jul 2021 07:20:22 +0000 (09:20 +0200)]
conf: use mount_fd() helper when mounting ttys

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agomount_utils: add mount_fd()
Christian Brauner [Fri, 30 Jul 2021 07:15:14 +0000 (09:15 +0200)]
mount_utils: add mount_fd()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: stash pty_nr in struct lxc_terminal
Christian Brauner [Fri, 30 Jul 2021 07:07:50 +0000 (09:07 +0200)]
conf: stash pty_nr in struct lxc_terminal

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3916 from brauner/2021-07-29.fixes
Stéphane Graber [Thu, 29 Jul 2021 17:26:19 +0000 (13:26 -0400)]
Merge pull request #3916 from brauner/2021-07-29.fixes

conf: move remaining setup before pivot root

2 years agoconf: move lxc_create_ttys() before pivot root
Christian Brauner [Thu, 29 Jul 2021 17:00:32 +0000 (19:00 +0200)]
conf: move lxc_create_ttys() before pivot root

This is the last setup step that occured after pivot root.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoterminal: split out lxc_devpts_terminal() helper
Christian Brauner [Thu, 29 Jul 2021 16:39:26 +0000 (18:39 +0200)]
terminal: split out lxc_devpts_terminal() helper

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3915 from brauner/2021-07-29.fixes
Stéphane Graber [Thu, 29 Jul 2021 16:42:39 +0000 (12:42 -0400)]
Merge pull request #3915 from brauner/2021-07-29.fixes

string_utils: cast __s64 to long long signed int

2 years agostring_utils: cast __s64 to long long signed int
Christian Brauner [Thu, 29 Jul 2021 16:25:19 +0000 (18:25 +0200)]
string_utils: cast __s64 to long long signed int

Link: https://launchpadlibrarian.net/550723147/buildlog_snap_ubuntu_focal_ppc64el_lxd-latest-edge_BUILDING.txt.gz
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3914 from brauner/2021-07-29.devpts
Stéphane Graber [Thu, 29 Jul 2021 16:20:23 +0000 (12:20 -0400)]
Merge pull request #3914 from brauner/2021-07-29.devpts

devpts: move setup before pivot root

2 years agoconf: merge devpts setup and move before pivot root
Christian Brauner [Thu, 29 Jul 2021 13:52:52 +0000 (15:52 +0200)]
conf: merge devpts setup and move before pivot root

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoterminal: don't use ttyname_r() for native terminal allocation
Christian Brauner [Thu, 29 Jul 2021 13:46:17 +0000 (15:46 +0200)]
terminal: don't use ttyname_r() for native terminal allocation

Since we can call that function from another mount namespace we need to
do this manually.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: add and use mount_beneath_fd()
Christian Brauner [Thu, 29 Jul 2021 12:32:21 +0000 (14:32 +0200)]
conf: add and use mount_beneath_fd()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: update comment
Christian Brauner [Thu, 29 Jul 2021 12:16:39 +0000 (14:16 +0200)]
conf: update comment

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: use a relative path in symlinkat()
Christian Brauner [Thu, 29 Jul 2021 12:15:51 +0000 (14:15 +0200)]
conf: use a relative path in symlinkat()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: s/lxc_setup_devpts_parent/lxc_recv_devpts_from_child/g
Christian Brauner [Thu, 29 Jul 2021 09:00:51 +0000 (11:00 +0200)]
conf: s/lxc_setup_devpts_parent/lxc_recv_devpts_from_child/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: attach devpts mount directly when new mount api can be used
Christian Brauner [Thu, 29 Jul 2021 08:46:59 +0000 (10:46 +0200)]
conf: attach devpts mount directly when new mount api can be used

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: set source property for devpts
Christian Brauner [Thu, 29 Jul 2021 13:39:04 +0000 (15:39 +0200)]
conf: set source property for devpts

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: surface failures to setup console
Christian Brauner [Thu, 29 Jul 2021 13:26:17 +0000 (15:26 +0200)]
conf: surface failures to setup console

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3912 from brauner/2021-07-28.devpts
Stéphane Graber [Wed, 28 Jul 2021 20:48:18 +0000 (16:48 -0400)]
Merge pull request #3912 from brauner/2021-07-28.devpts

conf: devpts rework

2 years agoMerge pull request #3913 from stgraber/master
Christian Brauner [Wed, 28 Jul 2021 19:49:14 +0000 (21:49 +0200)]
Merge pull request #3913 from stgraber/master

Fix typos

2 years agoFix typos
Stéphane Graber [Wed, 28 Jul 2021 19:13:52 +0000 (15:13 -0400)]
Fix typos

This fixes all typos identified by lintian.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2 years agoconf: ensure devpts_fd is set to -EBADF
Christian Brauner [Wed, 28 Jul 2021 16:39:31 +0000 (18:39 +0200)]
conf: ensure devpts_fd is set to -EBADF

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoterminal: ttyname_r() returns an error number on failure
Christian Brauner [Wed, 28 Jul 2021 15:25:38 +0000 (17:25 +0200)]
terminal: ttyname_r() returns an error number on failure

In other words, how inconsistent can an API be?

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoconf: use new mount api for devpts setup
Christian Brauner [Wed, 28 Jul 2021 14:38:36 +0000 (16:38 +0200)]
conf: use new mount api for devpts setup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #3910 from petris/tty_enxio
Christian Brauner [Thu, 22 Jul 2021 07:24:15 +0000 (09:24 +0200)]
Merge pull request #3910 from petris/tty_enxio

lxc_setup_ttys: Handle existing ttyN file without underlying device

2 years agoMerge pull request #3909 from petris/bpf_enosys_warn
Christian Brauner [Wed, 21 Jul 2021 13:25:36 +0000 (15:25 +0200)]
Merge pull request #3909 from petris/bpf_enosys_warn

bpf: simplify detection if BPF is supported