summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-01-13 19:42:02 +0100
committerLennart Poettering <lennart@poettering.net>2015-01-13 20:17:06 +0100
commit0dfaa0060711a8332c8eb9f1e10f48fe182d3650 (patch)
tree0b991d704d43a7c96363478b7878b070a9c1c238
parentbd763d350c7e8bf8b934bd45bc34ac35cdba2a63 (diff)
nspawn: add "-n" shortcut for "--network-veth"
Now that networkd's IP masquerading support means that running containers with "--network-veth" will provide network access out of the box for the container, let's add a shortcut "-n" for it, to make it easily accessible.
-rw-r--r--man/systemd-nspawn.xml1
-rw-r--r--src/nspawn/nspawn.c9
2 files changed, 5 insertions, 5 deletions
diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml
index 7d67472ff8..e67aeecb1a 100644
--- a/man/systemd-nspawn.xml
+++ b/man/systemd-nspawn.xml
@@ -407,6 +407,7 @@
</varlistentry>
<varlistentry>
+ <term><option>-n</option></term>
<term><option>--network-veth</option></term>
<listitem><para>Create a virtual
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 2b1feb6aa3..ce9a9e84f6 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -209,7 +209,7 @@ static void help(void) {
" --network-macvlan=INTERFACE\n"
" Create a macvlan network interface based on an\n"
" existing network interface to the container\n"
- " --network-veth Add a virtual ethernet connection between host\n"
+ " -n --network-veth Add a virtual ethernet connection between host\n"
" and container\n"
" --network-bridge=INTERFACE\n"
" Add a virtual ethernet connection between host\n"
@@ -283,7 +283,6 @@ static int parse_argv(int argc, char *argv[]) {
ARG_KEEP_UNIT,
ARG_NETWORK_INTERFACE,
ARG_NETWORK_MACVLAN,
- ARG_NETWORK_VETH,
ARG_NETWORK_BRIDGE,
ARG_PERSONALITY,
ARG_VOLATILE,
@@ -318,7 +317,7 @@ static int parse_argv(int argc, char *argv[]) {
{ "keep-unit", no_argument, NULL, ARG_KEEP_UNIT },
{ "network-interface", required_argument, NULL, ARG_NETWORK_INTERFACE },
{ "network-macvlan", required_argument, NULL, ARG_NETWORK_MACVLAN },
- { "network-veth", no_argument, NULL, ARG_NETWORK_VETH },
+ { "network-veth", no_argument, NULL, 'n' },
{ "network-bridge", required_argument, NULL, ARG_NETWORK_BRIDGE },
{ "personality", required_argument, NULL, ARG_PERSONALITY },
{ "image", required_argument, NULL, 'i' },
@@ -333,7 +332,7 @@ static int parse_argv(int argc, char *argv[]) {
assert(argc >= 0);
assert(argv);
- while ((c = getopt_long(argc, argv, "+hD:u:bL:M:jS:Z:qi:xp:", options, NULL)) >= 0)
+ while ((c = getopt_long(argc, argv, "+hD:u:bL:M:jS:Z:qi:xp:n", options, NULL)) >= 0)
switch (c) {
@@ -384,7 +383,7 @@ static int parse_argv(int argc, char *argv[]) {
/* fall through */
- case ARG_NETWORK_VETH:
+ case 'n':
arg_network_veth = true;
arg_private_network = true;
break;