repart: log allocation failure at debug level in Varlink service mode

When systemd-sysinstall probes whether an installation would fit by
calling io.systemd.Repart.Run() in dry-run mode, systemd-repart runs as
a child process sharing sysinstall's stderr. When the requested
partitions didn't fit, context_ponder() logged its failure at LOG_ERR
before vl_method_run() converted it into a structured Varlink error
(InsufficientFreeSpace or DiskTooSmall), which the client then reports
to the user in its own words. The internal message hence appeared
interleaved with the user-facing report:

    Can't fit requested partitions into available free space (1.9G), refusing.
    The selected disk is not large enough for an OS installation.
    The size of the selected disk is 0B, but a minimal size of 15.7G is required.

Log at LOG_DEBUG when running as a Varlink service, and keep LOG_ERR
for CLI invocations, where this message is the primary error report
shown to the user.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-07-16 13:59:18 +02:00
parent 588275f426
commit 70cc332640
+7 -4
View File
@@ -11402,10 +11402,13 @@ static int context_ponder(Context *context) {
if (context_drop_or_foreignize_one_priority(context))
continue; /* Still no luck. Let's drop a priority and try again. */
/* No more priorities left to drop. This configuration just doesn't fit on this disk... */
return log_error_errno(SYNTHETIC_ERRNO(ENOSPC),
"Can't fit requested partitions into available free space (%s), refusing.",
FORMAT_BYTES(largest_free_area));
/* No more priorities left to drop. This configuration just doesn't fit on this disk...
* In Varlink service mode the failure is reported to the client as a structured error,
* hence only log at debug level here. */
return log_full_errno(arg_varlink ? LOG_DEBUG : LOG_ERR,
SYNTHETIC_ERRNO(ENOSPC),
"Can't fit requested partitions into available free space (%s), refusing.",
FORMAT_BYTES(largest_free_area));
}
LIST_FOREACH(partitions, p, context->partitions) {