]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/conf.c
conf, criu: add make_anonymous_mount_file()
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 23 Nov 2016 05:47:37 +0000 (06:47 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 26 Nov 2016 03:28:03 +0000 (04:28 +0100)
commit5ef5c9a34460a8bd7c562b72bc977b2e7ac47cc8
tree54790e4f93006aaf83cf462fd7cc1adcf1ddbfba
parent413c294f756684cb683f78fc317c9c5c0953de18
conf, criu: add make_anonymous_mount_file()

Before we used tmpfile() to write out mount entries for the container. This
requires a writeable /tmp file system which can be a problem for systems where
this filesystem is not present. This commit switches from tmpfile() to using
the memfd_create() syscall. It allows us to create an anonymous tmpfs file (And
is somewhat similar to mmap().) which is automatically deleted as soon as any
references to it are dropped. In case we detect that syscall is not
implemented, we fallback to using tmpfile().

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c
src/lxc/conf.h
src/lxc/criu.c