vmspawn: move image related knobs close to --image=

(Also, arrange the order if the image options group in the man page to
the same as in the --help text)
This commit is contained in:
Lennart Poettering
2026-05-20 23:37:31 +02:00
parent 8c0f9073c7
commit 1a0b17df32
2 changed files with 45 additions and 45 deletions
+28 -28
View File
@@ -104,6 +104,18 @@
</listitem>
</varlistentry>
<varlistentry>
<term><option>-x</option></term>
<term><option>--ephemeral</option></term>
<listitem><para>If specified, the VM is run with a temporary snapshot of its file system that is removed
immediately when the VM terminates. Only works with <option>--image=</option> currently.
Note that <option>--ephemeral</option> will not work with <option>--extra-drive=</option>.</para>
<xi:include href="version-info.xml" xpointer="v260"/></listitem>
</varlistentry>
<varlistentry>
<term><option>-i</option></term>
<term><option>--image=</option></term>
@@ -139,15 +151,25 @@
</varlistentry>
<varlistentry>
<term><option>-x</option></term>
<term><option>--ephemeral</option></term>
<term><option>--discard-disk=<replaceable>BOOL</replaceable></option></term>
<listitem><para>If specified, the VM is run with a temporary snapshot of its file system that is removed
immediately when the VM terminates. Only works with <option>--image=</option> currently.
<listitem><para>Controls whether qemu processes discard requests from the VM.
This prevents long running VMs from using more disk space than required.
This is enabled by default.</para>
Note that <option>--ephemeral</option> will not work with <option>--extra-drive=</option>.</para>
<xi:include href="version-info.xml" xpointer="v256"/></listitem>
</varlistentry>
<xi:include href="version-info.xml" xpointer="v260"/></listitem>
<varlistentry>
<term><option>--grow-image=<replaceable>BYTES</replaceable></option></term>
<term><option>-G <replaceable>BYTES</replaceable></option></term>
<listitem><para>Grows the image file specified by <option>--image=</option> to the specified size
in bytes if it is smaller. Executes no operation if no image file is used or the image file is
already as large or larger than requested. The specified size accepts the usual K, M, G suffixes
(to the base of 1024). Specified values are rounded up to multiples of 4096.</para>
<xi:include href="version-info.xml" xpointer="v258"/></listitem>
</varlistentry>
</variablelist>
</refsect2>
@@ -363,16 +385,6 @@
<xi:include href="version-info.xml" xpointer="v261"/></listitem>
</varlistentry>
<varlistentry>
<term><option>--discard-disk=<replaceable>BOOL</replaceable></option></term>
<listitem><para>Controls whether qemu processes discard requests from the VM.
This prevents long running VMs from using more disk space than required.
This is enabled by default.</para>
<xi:include href="version-info.xml" xpointer="v256"/></listitem>
</varlistentry>
<varlistentry>
<term><option>--secure-boot=<replaceable>BOOL</replaceable></option></term>
@@ -409,18 +421,6 @@
<xi:include href="version-info.xml" xpointer="v261"/></listitem>
</varlistentry>
<varlistentry>
<term><option>--grow-image=<replaceable>BYTES</replaceable></option></term>
<term><option>-G <replaceable>BYTES</replaceable></option></term>
<listitem><para>Grows the image file specified by <option>--image=</option> to the specified size
in bytes if it is smaller. Executes no operation if no image file is used or the image file is
already as large or larger than requested. The specified size accepts the usual K, M, G suffixes
(to the base of 1024). Specified values are rounded up to multiples of 4096.</para>
<xi:include href="version-info.xml" xpointer="v258"/></listitem>
</varlistentry>
<varlistentry>
<term><option>--smbios11=<replaceable>STRING</replaceable></option></term>
<term><option>-s <replaceable>STRING</replaceable></option></term>
+17 -17
View File
@@ -394,6 +394,23 @@ static int parse_argv(int argc, char *argv[]) {
"Invalid image disk type: %s", opts.arg);
break;
OPTION_LONG("discard-disk", "BOOL", "Control processing of discard requests"):
r = parse_boolean_argument("--discard-disk=", opts.arg, &arg_discard_disk);
if (r < 0)
return r;
break;
OPTION('G', "grow-image", "BYTES", "Grow image file to specified size in bytes"):
if (isempty(opts.arg)) {
arg_grow_image = 0;
break;
}
r = parse_size(opts.arg, 1024, &arg_grow_image);
if (r < 0)
return log_error_errno(r, "Failed to parse --grow-image= parameter: %s", opts.arg);
break;
OPTION_GROUP("Host Configuration"): {}
OPTION_LONG("cpus", "CPUS", "Configure number of CPUs in guest"): {}
@@ -646,23 +663,6 @@ static int parse_argv(int argc, char *argv[]) {
break;
}
OPTION_LONG("discard-disk", "BOOL", "Control processing of discard requests"):
r = parse_boolean_argument("--discard-disk=", opts.arg, &arg_discard_disk);
if (r < 0)
return r;
break;
OPTION('G', "grow-image", "BYTES", "Grow image file to specified size in bytes"):
if (isempty(opts.arg)) {
arg_grow_image = 0;
break;
}
r = parse_size(opts.arg, 1024, &arg_grow_image);
if (r < 0)
return log_error_errno(r, "Failed to parse --grow-image= parameter: %s", opts.arg);
break;
OPTION_GROUP("Execution"): {}
OPTION('s', "smbios11", "STRING", "Pass an arbitrary SMBIOS Type #11 string to the VM"):