]> git.proxmox.com Git - mirror_lxcfs.git/commit - src/lxcfs.c
sysfs_fuse: account for liblxcfs reload with identical lxcfs binary
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 27 May 2021 15:23:06 +0000 (17:23 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 27 May 2021 16:22:11 +0000 (18:22 +0200)
commit0d5383b73c6e03c677b92471bb3b33afe9e952b2
tree224056b80c0a9f04c199b895751d65bec542bd2b
parent285aea407acd58811b3ecf53033497d0a25b83f9
sysfs_fuse: account for liblxcfs reload with identical lxcfs binary

This makes LXCFS upgradable from the old-style
/sys/devices/system/cpu/online virtualization to the new full
/sys/devices/system/cpu virtualization.

The special case this is handling is an upgrade where the LXCFS binary
itself is not replaced, only the liblxcfs shared library is replaced.

The original patch earlier in this series added several new fuse methods
e.g. .readlink() and .opendir() that required changes in the lxcfs.c
code itself while also modifying existing ones like .open() and .read().
This leads to inconsistency as .open() would end up being resolved to
the modified sys_open() implementation whereas .readlink() doesn't exist
as .readlink() wasn't registered with fuse. This causes the
virtualization to be broken.

Abuse the .init() method of fuse to indicate the sys_cpu works and also
make it possible to version struct lxcfs_opts.

If liblxcfs is reloaded virtualization of /sys/devices/system/cpu/online
will continue to work as before. In order to gain access to the new full
/sys/devices/system/cpu/ virtualzation a restart is needed.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/bindings.c
src/bindings.h
src/lxcfs.c
src/sysfs_fuse.c