[lxc-devel] [PATCH 3/9] lxc-ls: only list active containers

Daniel Lezcano daniel.lezcano at free.fr
Mon Mar 5 23:01:14 UTC 2012


On 03/05/2012 02:34 PM, David Ward wrote:
> Originally, lxc-ls listed all containers by printing the directory names
> in /var/lib/lxc. After commit 65cb447f9b8d1ac8dcf9df24a4f877180444f003,
> lxc-ls now finds and prints active containers by searching for open UNIX
> sockets named '/var/lib/lxc/<name>/command'. However, all containers are
> still printed using the old method as well, so now the active containers
> just get printed twice.
>
> Assuming that the intention of the above commit was to only list active
> containers, do not print the directory names in /var/lib/lxc any longer.

The intention of the above commit was to list also the container which 
were created on-the-fly and hence not present in the /var/lib/lxc. For 
example, lxc-execute -n foo sleep 10, does not exists in /var/lib/lxc.

I think the correct fix is to remove the duplicate container names.
Or just show two list, the running ones and the stopped ones.




More information about the lxc-devel mailing list