]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/commands.c
handle hashed command socket names (v2)
authorS.Çağlar Onur <caglar@10ur.org>
Mon, 25 Aug 2014 23:54:51 +0000 (19:54 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 26 Aug 2014 14:46:40 +0000 (10:46 -0400)
commit88556fd7560e3811f92108cb7eb51d41eb558724
tree87e30c36b9dafe1a91e4aef1b377cc691d07d8cf
parent735f2c6e504a541cbb2592a3f94858bf337a24ff
handle hashed command socket names (v2)

With the new hashed command socket names (e85898415c), it's possible to
have something like below;

[caglar@qop:~/go/src/github.com/lxc/go-lxc(master)] cat /proc/net/unix | grep lxc
000000000000000000000002 00000000 00010000 0001 01 53465 @lxc/d086e835c86f4b8d/command
[...]

list_active_containers reads /proc/net/unix to find all running
containers but this new format no longer includes the container name or
its lxcpath.

This patch introduces two new commands (LXC_CMD_GET_NAME and
LXC_CMD_GET_LXCPATH) and starts to use those in list_active_containers
call.

changes since v1:
 - added sanity check proposed by Serge

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/commands.c
src/lxc/commands.h
src/lxc/lxccontainer.c