The LXC controller code (libvirt_lxc binary) has grown rather large
and complicated over time. One of the particularly bad problems is
that there is no single store of global state. The results is that
methods are passing around huge lists of parameters and it becomes
unclear who is responsible for cleaning up state on failure. Although
they are harmless in this context, there are many FDs which are
leaked in the normal shutdown path.
This series refactors everything so that a virLXCControllerPtr
object holds all global state. The final patch also switches over
to using the virNetServer APIs for the client/server monitor socket
handling.
There should be no functional change in this series, but it prepares
the way for the next fun bit which is to introduce a full RPC
protocol between libvirtd & libvirt_lxc. This will enable us to
provide a bunch of interesting new APIs that are desired for LXC.
Don't be put off by the large patch series - each change is fairly
small & self-contained, with primarily just renaming of variables
and funtions
daemon/libvirtd.c | 3
daemon/remote.c | 3
daemon/remote.h | 3
src/Makefile.am | 41 -
src/libvirt_private.syms | 1
src/lxc/lxc_container.c | 10
src/lxc/lxc_container.h | 2
src/lxc/lxc_controller.c | 1250 +++++++++++++++++++++--------------------------
src/rpc/virnetserver.c | 120 ++--
src/rpc/virnetserver.h | 6
src/util/virfile.c | 138 +++++
src/util/virfile.h | 3
12 files changed, 819 insertions(+), 761 deletions(-)