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

Ward, David - 0663 - MITLL david.ward at ll.mit.edu
Sun Mar 11 17:04:25 UTC 2012


On 03/05/2012 06:01 PM, Daniel Lezcano wrote:
> 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.

I added an '--active' flag in the new patch series.  With the flag, 
running containers are shown.  Without the flag, containers existing on 
the filesystem are shown (running or stopped).  Let me know if that is okay.

David

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4558 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20120311/4f346767/attachment.bin>


More information about the lxc-devel mailing list