]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/lxccontainer.c
lxccontainer: implement container live patching
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 11 Oct 2017 09:13:53 +0000 (11:13 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 11 Oct 2017 12:02:46 +0000 (14:02 +0200)
commit0d9cd9c37a7fa1dabec171a2b2f95d21ad6d0730
tree1ab2696d325b5366a377d6edcc65ca429fa96f3c
parent7c8f5d1d0149e08c71738f4a040ce65f8abbfbca
lxccontainer: implement container live patching

This adds set_running_config_item() which is the analogue of
get_running_config_item(). In essence it allows a caller to livepatch the
container's in-memory configuration. This POC is severly limited. Here are the
most obvious ones:
- Only the container's in-memory config can be updated but no further actions
  (e.g. on-disk actions) are made.
- Only keys in the "lxc.net." namespace can be changed. This POC also allows
  updating an existing network. For example it allows to change the network
  type of an existing network. This is obviously nonsense and in a non-POC
  implementation this should be blocked.

Use Case:
Callers can hotplug a new network for the container. For example, LXD can
create a pair of veth devices in the host and in the container and add it to
the container's in-memory config. This means, the container can later be
queried for the name of the device later on etc. Note that liblxc will
currently not delete hotplugged network devices on container shutdown since it
won't have the ifindex of the container.

Relates to https://github.com/lxc/lxd/issues/3920 .

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