diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2022-09-12 22:24:04 +1000 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-09-13 05:31:51 +0200 |
commit | e8b19a4bd2eed33b1497482ffd693785c73ebaeb (patch) | |
tree | 951e71964c7796f98372ea0ec6518033bb112efb /test/lib/term | |
parent | d72a1e7bb96b461eb47d921436f7fe344e7b268a (diff) | |
download | passt-e8b19a4bd2eed33b1497482ffd693785c73ebaeb.tar passt-e8b19a4bd2eed33b1497482ffd693785c73ebaeb.tar.gz passt-e8b19a4bd2eed33b1497482ffd693785c73ebaeb.tar.bz2 passt-e8b19a4bd2eed33b1497482ffd693785c73ebaeb.tar.lz passt-e8b19a4bd2eed33b1497482ffd693785c73ebaeb.tar.xz passt-e8b19a4bd2eed33b1497482ffd693785c73ebaeb.tar.zst passt-e8b19a4bd2eed33b1497482ffd693785c73ebaeb.zip |
Consolidate validation of pasta namespace options
There are a number of different ways to specify namespaces for pasta to
use. Some combinations are valid and some are not. Currently validation
for these is spread across several places: conf_ns_pid() validates PID
options specifically. Near its callsite in conf() several other checks
are made. Some additional checks are made in conf_ns_open() and finally
theres a check just before the call to pasta_start_ns().
This is quite hard to follow. Make it easier by putting all the validation
logic together in a new conf_pasta_ns() function, which subsumes
conf_ns_pid(). This reveals that some of the checks were redundant with
each other, so remove those.
For good measure, rename conf_netns() to conf_netns_opt() to make it
clearer its handling just the --netns option specifically, not overall
configuration of the netns.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'test/lib/term')
0 files changed, 0 insertions, 0 deletions