Quoting Stéphane Graber ([email protected]): > Signed-off-by: Stéphane Graber <[email protected]>
Acked-by: Serge E. Hallyn <[email protected]> > --- > src/lxc/lxc-ls.in | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/src/lxc/lxc-ls.in b/src/lxc/lxc-ls.in > index 7e35ab2..908a64a 100755 > --- a/src/lxc/lxc-ls.in > +++ b/src/lxc/lxc-ls.in > @@ -102,7 +102,7 @@ def get_root_path(path): > > > # Constants > -FIELDS = ("name", "state", "ipv4", "ipv6", "autostart", "pid", > +FIELDS = ("name", "state", "interfaces", "ipv4", "ipv6", "autostart", "pid", > "memory", "ram", "swap") > DEFAULT_FIELDS = ("name", "state", "ipv4", "ipv6", "autostart") > > @@ -323,6 +323,18 @@ def get_containers(fd=None, base="/", root=False): > if ips: > entry[protocol] = ", ".join(ips) > > + # Get the interfaces > + if 'interfaces' in args.fancy_format: > + entry['interfaces'] = "-" > + > + if state == 'UNKNOWN' or (container.running and > + not SUPPORT_SETNS_NET): > + entry['interfaces'] = "UNKNOWN" > + elif container.running: > + interfaces = container.get_interfaces() > + if interfaces: > + entry['interfaces'] = ", ".join(interfaces) > + > # Nested containers > if args.nesting: > if container.running: > -- > 1.9.0 > > _______________________________________________ > lxc-devel mailing list > [email protected] > http://lists.linuxcontainers.org/listinfo/lxc-devel _______________________________________________ lxc-devel mailing list [email protected] http://lists.linuxcontainers.org/listinfo/lxc-devel
