| Name |
Last commit
|
Last update |
|---|---|---|
| config | ||
| doc | ||
| hooks | ||
| src | ||
| templates | ||
| .gitignore | ||
| .travis.yml | ||
| AUTHORS | ||
| CONTRIBUTING | ||
| COPYING | ||
| INSTALL | ||
| MAINTAINERS | ||
| Makefile.am | ||
| NEWS | ||
| README | ||
| autogen.sh | ||
| configure.ac | ||
| lxc.pc.in | ||
| lxc.spec.in |
- With the -g/--groups argument the user can give a comma-separated list of groups MUST a container must have in order to be displayed. We receive this list as a single string. ls_has_all_grps() is called to check if a container has all the groups of MUST in its current list of groups HAS. I.e. we determine whether MUST ⊆ HAS and only then do we record the container. The original implementation was dumb in that it split the string MUST everytime it needed to check whether MUST ⊆ HAS for a given container. That's pointless work. Instead we split the string MUST only once in main() and pass it to ls_get() which passes it along to ls_has_all_grps(). - Before doing any costly checking make sure that #MUST <= #HAS. If not bail immediately. - The linear search algorithm ls_has_all_grps() currently uses stays for now. Binary search et al. do not seem to make sense since sorting the array HAS for each container is probably too costly. Especially, since it seems unlikely that a users specifies 50+ or so groups on the command line a container must have to be displayed. If however there are a lot of use-cases where users have a lot of containers each with 50-100 groups and regularly use lxc-ls with -g/--groups to only show containers that have 50 specified groups among their 50-100 groups we can revisit this issue and implement e.g. binary search or a ternary search tree. Signed-off-by:Christian Brauner <christian.brauner@mailbox.org> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| config | Loading commit data... | |
| doc | Loading commit data... | |
| hooks | Loading commit data... | |
| src | Loading commit data... | |
| templates | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .travis.yml | Loading commit data... | |
| AUTHORS | Loading commit data... | |
| CONTRIBUTING | Loading commit data... | |
| COPYING | Loading commit data... | |
| INSTALL | Loading commit data... | |
| MAINTAINERS | Loading commit data... | |
| Makefile.am | Loading commit data... | |
| NEWS | Loading commit data... | |
| README | Loading commit data... | |
| autogen.sh | Loading commit data... | |
| configure.ac | Loading commit data... | |
| lxc.pc.in | Loading commit data... | |
| lxc.spec.in | Loading commit data... |