vmspawn: split out networking related options into its own "Networking" section in --help

This commit is contained in:
Lennart Poettering
2026-05-20 23:38:30 +02:00
parent f9a40f7aa3
commit 183ec272ef
2 changed files with 45 additions and 36 deletions
+33 -27
View File
@@ -322,33 +322,6 @@
</listitem>
</varlistentry>
<varlistentry>
<term><option>-n</option></term>
<term><option>--network-tap</option></term>
<listitem>
<para>Create a TAP device to network with the virtual machine.</para>
<para>Note: root privileges are required to use TAP networking.
Additionally,
<citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
must be running and correctly set up on the host to provision the host interface. The relevant
<literal>.network</literal> file can be found at
<filename>/usr/lib/systemd/network/80-vm-vt.network</filename>.
</para>
<xi:include href="version-info.xml" xpointer="v255"/>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--network-user-mode</option></term>
<listitem><para>Use user mode networking.</para>
<xi:include href="version-info.xml" xpointer="v255"/></listitem>
</varlistentry>
<varlistentry>
<term><option>--firmware=<replaceable>PATH</replaceable></option></term>
@@ -454,6 +427,39 @@
</variablelist>
</refsect2>
<refsect2>
<title>Networking Options</title>
<variablelist>
<varlistentry>
<term><option>-n</option></term>
<term><option>--network-tap</option></term>
<listitem>
<para>Create a TAP device to network with the virtual machine.</para>
<para>Note: root privileges are required to use TAP networking.
Additionally,
<citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
must be running and correctly set up on the host to provision the host interface. The relevant
<literal>.network</literal> file can be found at
<filename>/usr/lib/systemd/network/80-vm-vt.network</filename>.
</para>
<xi:include href="version-info.xml" xpointer="v255"/>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--network-user-mode</option></term>
<listitem><para>Use user mode networking.</para>
<xi:include href="version-info.xml" xpointer="v255"/></listitem>
</varlistentry>
</variablelist>
</refsect2>
<refsect2>
<title>System Identity Options</title>
+12 -9
View File
@@ -232,6 +232,7 @@ static int help(void) {
NULL,
"Image",
"Host Configuration",
"Networking",
"Execution",
"System Identity",
"Properties",
@@ -255,7 +256,7 @@ static int help(void) {
(void) table_sync_column_widths(
0, tables[0], tables[1], tables[2], tables[3], tables[4],
tables[5], tables[6], tables[7], tables[8], tables[9], tables[10],
tables[11]);
tables[11], tables[12]);
help_cmdline("[OPTIONS...] [ARGUMENTS...]");
help_abstract("Spawn a command or OS in a virtual machine.");
@@ -540,14 +541,6 @@ static int parse_argv(int argc, char *argv[]) {
break;
}
OPTION('n', "network-tap", NULL, "Create a TAP device for networking"):
arg_network_stack = NETWORK_STACK_TAP;
break;
OPTION_LONG("network-user-mode", NULL, "Use user mode networking"):
arg_network_stack = NETWORK_STACK_USER;
break;
OPTION_LONG("secure-boot", "BOOL|auto", "Enable searching for firmware supporting SecureBoot"): {
int b;
@@ -666,6 +659,16 @@ static int parse_argv(int argc, char *argv[]) {
break;
}
OPTION_GROUP("Networking"): {}
OPTION('n', "network-tap", NULL, "Create a TAP device for networking"):
arg_network_stack = NETWORK_STACK_TAP;
break;
OPTION_LONG("network-user-mode", NULL, "Use user mode networking"):
arg_network_stack = NETWORK_STACK_USER;
break;
OPTION_GROUP("Execution"): {}
OPTION('s', "smbios11", "STRING", "Pass an arbitrary SMBIOS Type #11 string to the VM"):