Clean up and rename conf_ns_open()

conf_ns_open() opens file descriptors for the namespaces pasta needs, but
it doesnt really have anything to do with configuration any more.  For
better clarity, move it to pasta.c and rename it pasta_open_ns().  This
makes the symmetry between it and pasta_start_ns() more clear, since these
represent the two basic ways that pasta can operate, either attaching to
an existing namespace/process or spawning a new one.

Since its no longer validating options, the errors it could return
shouldn't cause a usage message.  Just exit directly with an error instead.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson
2022-09-12 22:24:05 +10:00
committed by Stefano Brivio
parent e8b19a4bd2
commit fc1be3d5ab
3 changed files with 68 additions and 71 deletions

View File

@@ -6,6 +6,7 @@
#ifndef PASTA_H
#define PASTA_H
void pasta_open_ns(struct ctx *c, const char *userns, const char *netns);
void pasta_start_ns(struct ctx *c, int argc, char *argv[]);
void pasta_ns_conf(struct ctx *c);
void pasta_child_handler(int signal);