machinectl: several trivial cleanups and man page fix (#37812)

Fixes #27481.
This commit is contained in:
Mike Yuan
2025-06-11 22:03:28 +02:00
committed by GitHub
2 changed files with 4 additions and 5 deletions

View File

@@ -778,8 +778,7 @@
non-empty label strings, separated by dots. No leading or trailing
dots are allowed. No sequences of multiple dots are allowed. The
label strings may only consist of alphanumeric characters as well
as the dash and underscore. The maximum length of a machine name
is 64 characters.</para>
as the dash. The maximum length of a machine name is 64 characters.</para>
<para>A special machine with the name <literal>.host</literal>
refers to the running host system itself. This is useful for execution

View File

@@ -68,14 +68,14 @@ typedef enum MachineRunner {
} MachineRunner;
static const char* const machine_runner_table[_RUNNER_MAX] = {
[RUNNER_NSPAWN] = "nspawn",
[RUNNER_NSPAWN] = "nspawn",
[RUNNER_VMSPAWN] = "vmspawn",
};
DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING(machine_runner, MachineRunner);
static const char* const machine_runner_unit_prefix_table[_RUNNER_MAX] = {
[RUNNER_NSPAWN] = "systemd-nspawn",
[RUNNER_NSPAWN] = "systemd-nspawn",
[RUNNER_VMSPAWN] = "systemd-vmspawn",
};
@@ -1694,7 +1694,7 @@ static int make_service_name(const char *name, char **ret) {
assert(name);
assert(ret);
assert(arg_runner >= 0 && arg_runner < (MachineRunner) ELEMENTSOF(machine_runner_unit_prefix_table));
assert(arg_runner >= 0 && arg_runner < _RUNNER_MAX);
if (!hostname_is_valid(name, 0))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),