]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
13 days agoupdate TODO 41870/head
Lennart Poettering [Wed, 29 Apr 2026 14:05:36 +0000 (16:05 +0200)] 
update TODO

This is mostly stuff discussed in #41776.

13 days agosd-boot: minor tweaks as follow-up for #41863
Lennart Poettering [Wed, 29 Apr 2026 13:52:29 +0000 (15:52 +0200)] 
sd-boot: minor tweaks as follow-up for #41863

This addresses some trivial points made by @keszybz in the PR review.

13 days agovolume: add an "io.systemd.StorageProvider" IPC API that is supposed to be used by...
Lennart Poettering [Wed, 29 Apr 2026 13:51:52 +0000 (15:51 +0200)] 
volume: add an "io.systemd.StorageProvider" IPC API that is supposed to be used by vmspawn/nspawn/pid1 to provide storage volumes in a generic fashion (#41776)

BindPath= in unit files, and --bind= in nspawn/vmspawn doesn't really
cut it to connect arbitrary storage infra to it. Let's do something
about it, and implement a simple, light-weight API for acquiring an fd
to a storage volume. Benefits:

1. the interface can be implemented by anyone, connecting anything to
vmspawn/nspawn/service management
2. very lose coupling: just bind a socket into a well-known dir, done
3. mounting can happen on-demand

13 days agosd-boot related work from #41543 (add "extra" stanza to bls type 1) (#41863)
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 13:25:38 +0000 (15:25 +0200)] 
sd-boot related work from #41543 (add "extra" stanza to bls type 1) (#41863)

This implements the "extra" stanza for type 1 entries in systemd-boot,
see:

https://github.com/uapi-group/specifications/commit/bde167a46c866c44e1240120695f70f0bf70aadc

It comes with a really thorough test suite matching our currently level
of testing of systemd-boot (read: there is none, I ask you to trust me,
Claude, and your review on this one)...

Split out of #41543

13 days agoSmall cleanups in sd-varlink and sd-json (#41861)
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 13:03:00 +0000 (15:03 +0200)] 
Small cleanups in sd-varlink and sd-json (#41861)

13 days agosd-bus: store the strv size when extending it (#41864)
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 13:01:12 +0000 (15:01 +0200)] 
sd-bus: store the strv size when extending it (#41864)

So strv_push_with_size() doesn't have to recalculate the size every
time.

13 days agoman: add a brief note about type 1 extra lines 41863/head
Lennart Poettering [Wed, 29 Apr 2026 11:35:41 +0000 (13:35 +0200)] 
man: add a brief note about type 1 extra lines

13 days agoboot: downgrade log level for an error we ignore
Lennart Poettering [Wed, 29 Apr 2026 10:39:26 +0000 (12:39 +0200)] 
boot: downgrade log level for an error we ignore

13 days agoboot: load extra files for UKIs into memory and register as initrds
Lennart Poettering [Wed, 25 Mar 2026 17:15:38 +0000 (18:15 +0100)] 
boot: load extra files for UKIs into memory and register as initrds

This generates on-the-fly cpio initrds from 'extra' resources declared
in Type #1 entries and installs them via the Linux initrd protocol so
that they get passed to the Linux kernel.

Replaces: #39286

13 days agoboot: parse 'extra' type 1 stanza too
Lennart Poettering [Fri, 20 Mar 2026 16:46:15 +0000 (17:46 +0100)] 
boot: parse 'extra' type 1 stanza too

This loads the new 'extra' stanza, but doesn't actually do anything with
it yet. That's added in a later commit.

Replaces: #39286

Implements: https://github.com/uapi-group/specifications/pull/212

13 days agocpio: move TPM PCR info into CpioTarget
Lennart Poettering [Wed, 29 Apr 2026 10:01:59 +0000 (12:01 +0200)] 
cpio: move TPM PCR info into CpioTarget

The PR to measure into is closely associated with where we place a
resource in the initrd cpios. Hence, let's also track it in CpioTarget,
thus simplifying our function parameter lists that way.

No change in behaviour.

13 days agocore: limit the number of units that can be requested over ListUnitsByNames 41864/head
Frantisek Sumsal [Wed, 29 Apr 2026 10:02:32 +0000 (12:02 +0200)] 
core: limit the number of units that can be requested over ListUnitsByNames

13 days agosd-bus: store the strv size when extending it
Frantisek Sumsal [Wed, 29 Apr 2026 09:50:01 +0000 (11:50 +0200)] 
sd-bus: store the strv size when extending it

So strv_push_with_size() doesn't have to recalculate the size every
time.

13 days agoTODO: track StorageProvider follow-ups, sketch a NetworkProvider sibling 41776/head
Lennart Poettering [Thu, 23 Apr 2026 10:16:24 +0000 (12:16 +0200)] 
TODO: track StorageProvider follow-ups, sketch a NetworkProvider sibling

Records the still-missing StorageProvider integrations (nspawn,
vmspawn, service-manager BindVolume=) and replaces the now-obsolete
generic "storage API via varlink" entry with a NetworkProvider
proposal modelled on it.

13 days agotest: add integration test for storagectl and storage providers
Lennart Poettering [Wed, 29 Apr 2026 00:25:07 +0000 (02:25 +0200)] 
test: add integration test for storagectl and storage providers

VM-only test that exercises both shipped providers through storagectl:
verifies the well-known sockets exist, lists providers/volumes/
templates, creates and acquires volumes from each template
(sparse-file, allocated-file, directory, subvolume), attaches a loop
device to cover the block provider, and exercises the mount.storage
helper.

13 days agostorage: add 'storagectl' command-line tool
Lennart Poettering [Wed, 22 Apr 2026 21:44:04 +0000 (23:44 +0200)] 
storage: add 'storagectl' command-line tool

CLI for inspecting and using storage providers. Scans
/run/systemd/io.systemd.StorageProvider/ (or the user-mode equivalent)
for AF_UNIX sockets and talks to each one over Varlink. Verbs:
"volumes" lists volumes across all providers, "templates" lists
supported creation templates, "providers" lists the endpoints
themselves.

Also installed as a mount.storage helper, so
'mount -t storage PROVIDER:VOLUME /mnt' (or 'mount -t storage.<fstype>'
to put a fresh filesystem on a block volume) acquires the volume and
mounts it. Ships with bash/zsh completions and a man page.

13 days agostorage: add systemd-storage-fs@.service provider
Lennart Poettering [Thu, 23 Apr 2026 07:00:46 +0000 (09:00 +0200)] 
storage: add systemd-storage-fs@.service provider

Second StorageProvider implementation, exposing regular files and
directories from a backing filesystem. In system mode the backing
directory is /var/lib/storage/, in user mode $XDG_STATE_HOME/storage/;
entries with a .volume suffix are exposed, with the inode type
determining whether the volume is reported as reg, dir or (via
symlinked/bind-mounted device node) blk.

Unlike the block provider, this one supports creating volumes
on-demand from a small set of built-in templates: sparse-file,
allocated-file, directory and subvolume.

13 days agostorage: add systemd-storage-block@.service provider
Lennart Poettering [Thu, 23 Apr 2026 07:00:06 +0000 (09:00 +0200)] 
storage: add systemd-storage-block@.service provider

First implementation of io.systemd.StorageProvider, exposing all block
devices known to udev (disks, partitions, dm nodes, …) as volumes of
type "blk". Names are picked from stable /dev/mapper and /dev/disk/by-*
symlinks; content-derived identifiers (by-uuid, by-label, …) are
intentionally avoided for security. Volume creation is not supported by
this backend.

Socket-activated via /run/systemd/io.systemd.StorageProvider/block.
Also adds shared storage-util.[ch] (VolumeType / CreateMode helpers)
that subsequent providers reuse.

13 days agoshared: add io.systemd.StorageProvider Varlink interface
Lennart Poettering [Thu, 23 Apr 2026 06:59:20 +0000 (08:59 +0200)] 
shared: add io.systemd.StorageProvider Varlink interface

Generic Varlink API for services that hand out file descriptors to
storage volumes. Three methods: Acquire() returns an fd for a named
volume (optionally creating it from a template), ListVolumes()
enumerates available volumes, ListTemplates() enumerates supported
creation templates. Volume types follow kernel inode-type naming:
blk (block device), reg (regular file), dir (directory).

Intent is that multiple providers can sit behind AF_UNIX sockets in a
well-known directory and be consumed uniformly by nspawn, vmspawn,
the service manager (BindVolume=) and similar tools.

13 days agolibsystemd: Clean up meson.build
Daan De Meyer [Tue, 28 Apr 2026 17:47:14 +0000 (19:47 +0200)] 
libsystemd: Clean up meson.build

Merge the two blocks adding tests, since there seems to be
no obvious reason to have two separate blocks, as they both
contain tests from the same libraries.

13 days agosd-json: stop printing debug messages about extension fields 41861/head
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 09:20:06 +0000 (11:20 +0200)] 
sd-json: stop printing debug messages about extension fields

The intent was good, but we now print two or three of those messages
for each report metrics received on the wire. If the json object is
extensible, then it's all good and we don't need to inundate the user
with this trivial information. (And the message also sounds like
something is wrong or unexpected, when it totally isn't.)

...
(string):1:73: Unrecognized object field 'object', assuming extension.
(string):1:89: Unrecognized object field 'value', assuming extension.
json-stream: Received message: {"parameters":{"name":"io.systemd.Network.CarrierState","object":"virbr0","value":"degraded-carrier"},"continues":true}
(string):1:66: Unrecognized object field 'object', assuming extension.
(string):1:83: Unrecognized object field 'value', assuming extension.
json-stream: Received message: {"parameters":{"name":"io.systemd.Network.CarrierState","object":"lo","value":"carrier"},"continues":true}
(string):1:66: Unrecognized object field 'object', assuming extension.
(string):1:79: Unrecognized object field 'value', assuming extension.
json-stream: Received message: {"parameters":{"name":"io.systemd.Network.CarrierState","object":"wlp0s20f3","value":"carrier"},"continues":true}
(string):1:66: Unrecognized object field 'object', assuming extension.
(string):1:86: Unrecognized object field 'value', assuming extension.
...

13 days agosd-varlink: reduce size of varlink structs
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 09:00:00 +0000 (11:00 +0200)] 
sd-varlink: reduce size of varlink structs

struct sd_varlink:
- /* size: 448, cachelines: 7, members: 21 */
+ /* size: 432, cachelines: 7, members: 21 */

struct sd_varlink_server:
- /* size: 160, cachelines: 3, members: 21 */
+ /* size: 152, cachelines: 3, members: 21 */

13 days agosd-varlink: drop pointless bitfield
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 08:54:43 +0000 (10:54 +0200)] 
sd-varlink: drop pointless bitfield

As is often the case, in this case because of alignment, we are actually
not saving any space. With the bitfield we are using one bit of the 8 bytes
allocated, and without the bitfield we are using 8 bits of that.

But we're paying a price in generated code, at every access site to the
field:

$ diff <(objdump -S build/libsystemd.so.old) <(objdump -S build/libsystemd.so.new)
...
       v->protocol_upgrade = false;
-   fa2d2: 48 8b 45 a8           mov    -0x58(%rbp),%rax
-   fa2d6: 0f b6 90 90 01 00 00  movzbl 0x190(%rax),%edx
-   fa2dd: 83 e2 fe              and    $0xfffffffe,%edx
-   fa2e0: 88 90 90 01 00 00     mov    %dl,0x190(%rax)
+   fa2a9: 48 8b 45 a8           mov    -0x58(%rbp),%rax
+   fa2ad: c6 80 90 01 00 00 00  movb   $0x0,0x190(%rax)

13 days agomkosi: Install liburing
Daan De Meyer [Mon, 27 Apr 2026 21:46:37 +0000 (23:46 +0200)] 
mkosi: Install liburing

Make sure liburing is installed so it's available for
experimentation in sd-event integration.

2 weeks agocore: add io.systemd.Unit.StartTransient() to the varlink API (#41583)
Michael Vogt [Wed, 29 Apr 2026 06:20:56 +0000 (08:20 +0200)] 
core: add io.systemd.Unit.StartTransient() to the varlink API (#41583)

This commit adds a simple version of io.systemd.Unit.StartTransient
for varlink. It is similar to the dbus version, but there is a key
difference:
1. Instead of building the unit from key/value properties it
takes a structured json object "UnitContext" with a "Service" field
inside.
   It is also only implementing a minimal set of what can be done with a
   service.
2. No aux units (for now)
3. When called with --more the varlink socket can notify about
   state changes depending on the notify{Job,Unit}Changes parameter

This aligns to the json objects/format from
https://github.com/systemd/systemd/pull/39391
and to show how the format can be shared it adds a new
(minimal) `ServiceContext` that is now part of
`io.systemd.Unit.List()`.

2 weeks agoci: Reduce noise from claude-review workflow
Daan De Meyer [Tue, 28 Apr 2026 07:26:12 +0000 (09:26 +0200)] 
ci: Reduce noise from claude-review workflow

2 weeks agoAdd "namespaces" to option macros, convert systemd-run+run0 (#41844)
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 17:38:04 +0000 (19:38 +0200)] 
Add "namespaces" to option macros, convert systemd-run+run0 (#41844)

2 weeks agoupdate TODO
Lennart Poettering [Tue, 28 Apr 2026 10:04:20 +0000 (12:04 +0200)] 
update TODO

2 weeks agoshared/options: add an assert loop to verify ordering 41844/head
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 06:45:03 +0000 (08:45 +0200)] 
shared/options: add an assert loop to verify ordering

If things are misordered, we need to catch this. Use assert_se to make
the check also in custom builds that otherwise disable assertions.

2 weeks agorun: use a "named namespace" also for the main option parser
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 06:11:40 +0000 (08:11 +0200)] 
run: use a "named namespace" also for the main option parser

It seems that clang reorders the entries in the options array that
originate from different functions, but not within a function. Using
"named namespaces" exclusively should sidestep the issue.

(A bigger hammer would be to sort the array. We *can* do this, since the
options have the increasing .id field. But that'd require duplicating
the memory or making it writable. Let's avoid this until we know for
sure that it's needed.)

2 weeks agorun: convert run0 option parser to macros
Zbigniew Jędrzejewski-Szmek [Mon, 27 Apr 2026 22:30:08 +0000 (00:30 +0200)] 
run: convert run0 option parser to macros

This exercises the new option namespace code.

--help output is generally the same, except for the formatting changes
related to use of the new output helpers and the common option macros.

--same-root-dir is now documented (followup for
  475729b80532dfbbce98705dade6570ce5cc29f0).

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agorun: convert parse_argv() to OPTION macros
Zbigniew Jędrzejewski-Szmek [Mon, 27 Apr 2026 22:04:50 +0000 (00:04 +0200)] 
run: convert parse_argv() to OPTION macros

--system is now documented (fixup for 66b1e746055b9c56fd72c0451a4cfb2b06cf3f20).
--capsule is now documented (fixup for 759b3c082d463a488235592df45cbebefbe1ad5c).

--help output is generally the same, except for the formatting changes
related to use of the new output helpers and common option macros.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agorun: reorder switch cases to match help() output order
Zbigniew Jędrzejewski-Szmek [Mon, 27 Apr 2026 21:58:24 +0000 (23:58 +0200)] 
run: reorder switch cases to match help() output order

Both parse_argv() and parse_argv_sudo_mode() handled options in an
order that no longer matched the help text. Reorder the case statements
so the source order mirrors what the user sees in --help.

In parse_argv_sudo_mode(), drop the case 'i' → ARG_VIA_SHELL fall-through
so the cases can be sequenced independently; 'i' now sets arg_via_shell
directly.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agoshared/options: introduce "namespaces" for options
Zbigniew Jędrzejewski-Szmek [Mon, 27 Apr 2026 20:56:50 +0000 (22:56 +0200)] 
shared/options: introduce "namespaces" for options

This allows multiple option parsers to be defined in a single
compilation unit. We put the OPTION_NAMESPACE("name") to split
up the options. The basic implementation is similar to groups,
except that groups only matter for help display, while namespaces
matter for both help display and actual option parsing. When parsing,
we locate the appropriate range between the beginning of options
and the next namespace marker or between two namespace markers and
only look at that range.

2 weeks agoloop-util: don't reuse partition fd when partscan needed
Clayton Craft [Tue, 28 Apr 2026 02:38:26 +0000 (19:38 -0700)] 
loop-util: don't reuse partition fd when partscan needed

Some devices (e.g. android phones running pmOS) cannot have their OEM
partition table altered without breaking the firmware, so the distros's
partitions live inside a nested GPT carved into one of the OEM
partitions. Exposing these subpartitions requires wrapping the outer
partition in a loop device with partscan enabled, since the kernel does
not go into nested partition tables.

systemd already detects this case in udev-builtin-blkid
(ID_PART_GPT_AUTO_ROOT_DISK_NEEDS_LOOP) and acts on with
systemd-loop@.service, but this fails towards the end.
loop_device_make_internal has an optimization where if the input is
already a block device with a matching sector size, it skips creating
a loop and just hands back the original fd. That's fine for whole disks
but wrong for partitions, which don't support partscan, so this causes
dissect_image to fail with EPROTONOSUPPORT.

This patch changes the behavior to only take the shortcut when the input
is a whole disk, or when partscan was not requested.

Co-Authored-By: Clayton Craft <clayton@craftyguy.net>
2 weeks agoshared/options: fix --help indentation for long options
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 09:12:43 +0000 (11:12 +0200)] 
shared/options: fix --help indentation for long options

In 4339197f5d4f712bc900d8e09c892015d48b19bb the helper to format -o/--opt=
was split out, but the indentation was for --long-options was messed up.
We'd print:
Options:
  -h --help             Show this help
  --version             Show package version
  --no-ask-password     Do not prompt for password
  ...
But we want
  -h --help             Show this help
     --version          Show package version
     --no-ask-password  Do not prompt for password
  ...

The prefix argument was arguably ugly, even if it allowed one alloc to be
avoided. Let's get rid of it and let the handler prefix the string as
appropriate. This makes other callers nicer too.

Fixup for 4339197f5d4f712bc900d8e09c892015d48b19bb.

2 weeks agocore: ensure all types from execute.h start with Exec
Lennart Poettering [Tue, 28 Apr 2026 10:05:28 +0000 (12:05 +0200)] 
core: ensure all types from execute.h start with Exec

Until very recently all types defined by execute.h started with "Exec"
in the name. I think that was useful, since it made clear that the types
are associated with the ExecContext infrastructure. Let's hence restore
this.

(If we every move these types out of execute.h we should drop the "Exec"
prefix again. But today is not that day.)

No real code changes, just dumb renaming.

2 weeks agomeson: rerun 'update-man-rules'
Lennart Poettering [Tue, 28 Apr 2026 10:03:45 +0000 (12:03 +0200)] 
meson: rerun 'update-man-rules'

2 weeks agoA couple of sanitizer-related tweaks (#41808)
Luca Boccassi [Tue, 28 Apr 2026 11:04:45 +0000 (12:04 +0100)] 
A couple of sanitizer-related tweaks (#41808)

The sanitizer job was FUBAR on Fedora Rawhide (and RHEL 10 to some
extent) due to several changes:
- latest LLVM (v22) introduced a change that occasionally generates a
false-positive warning when running with sanitizers
  - several tools had to be "ASan-wrapped" because:
- util-linux started linking against libsystemd which propagated to
other tools depending on its shared libraries (like libmount)
- libssh started depending on libfido2, which depends on libudev; this
then translated to an interesting depedency chain where tpm2 utils got a
dependency on libudev through libcurl -> libssh -> libfido2
- polkit added MemoryMax= to its service file, which is incompatible
with ASan-runs (at least with the current limits)

See the commits for more detailed descriptions.

Also, one note: the santizer job is currently still FUBAR on Fedora
Rawhide (or, more specifically, the TEST-50-DISSECT and TEST-58-REPART),
because mkfs.erofs also gained a dependency on libudev (through libcurl,
see above), but the wrapping currently doesn't work as it also depends
on libqpl which is linked with libtsan (which is incompatible with other
sanitizers). This is currently tracked in
https://bugzilla.redhat.com/show_bug.cgi?id=2461146

2 weeks agopo: Translated using Weblate (German)
Dark Cronyx [Tue, 28 Apr 2026 08:59:17 +0000 (08:59 +0000)] 
po: Translated using Weblate (German)

Currently translated at 100.0% (266 of 266 strings)

Co-authored-by: Dark Cronyx <darkcronyx@protonmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/de/
Translation: systemd/main

2 weeks agofork-notify: Use callback instead of argv NULL code path with return (#41813)
Daan De Meyer [Tue, 28 Apr 2026 08:15:31 +0000 (10:15 +0200)] 
fork-notify: Use callback instead of argv NULL code path with return (#41813)

2 weeks agocore: transition job to JOB_FINISHED on uninstall 41583/head
Michael Vogt [Mon, 27 Apr 2026 11:12:30 +0000 (13:12 +0200)] 
core: transition job to JOB_FINISHED on uninstall

When a job reaches the job_uninstall() stage we used to set the
state to JOB_WAITING. However now that we have a JOB_FINISHED state [1]
we should use that instead. This is more accurate so when
varlink_job_send_removed_signal() is called the job is in the expected
state and that is what the user will see.

Note that this does not change the D-Bus API because there
bus_job_send_removed_signal() doesn't send the state, it only sends
the result.

[1] https://github.com/systemd/systemd/pull/41811

2 weeks agoudev: don't assert on worker cap after killing a broken idle worker 41758/head
Daan De Meyer [Tue, 21 Apr 2026 08:44:44 +0000 (08:44 +0000)] 
udev: don't assert on worker cap after killing a broken idle worker

manager_can_process_event() considers an event processable if either
there is room below children_max to spawn, or an idle worker exists.
When only the latter holds, event_run() picks the idle worker and
tries device_monitor_send(). If that send fails, event_run() SIGKILLs
the worker, marks it WORKER_KILLED and continues the loop. With no
other idle worker available, it falls through to worker_spawn(),
guarded by:

    assert(hashmap_size(manager->workers) < manager->config.children_max);

The just-killed worker is still in manager->workers until its SIGCHLD
is reaped by on_worker_exit(), so at the cap this assertion trips and
udevd aborts:

    Assertion 'hashmap_size(manager->workers) < manager->config.children_max'
    failed at src/udev/udev-manager.c:635, function event_run(). Aborting.

Instead of asserting, bail out when we are already at the worker
limit. The event remains in EVENT_QUEUED; once the killed worker's
SIGCHLD arrives and frees it from the hashmap, on_post() re-runs
event_queue_start() and the event is retried.

2 weeks agooptions: add a proper state machine field
Lennart Poettering [Fri, 24 Apr 2026 08:33:46 +0000 (10:33 +0200)] 
options: add a proper state machine field

Let's track the state of the option parser in an explicit 'state' field.

Benefits:

1. We can make sure that a parser that got into a failure state will
   be invalidated for good (i.e. further operations are guaranteed to
   fail too).

2. As a side effect this cleans up the option_parse() return parameter
   handling: we'll now always initialize ret_option/ret_arg when
   returning >= 0, as per coding style.

2 weeks agooptions: tighten validation of argc/argv
Lennart Poettering [Fri, 24 Apr 2026 08:37:48 +0000 (10:37 +0200)] 
options: tighten validation of argc/argv

If argc/argv do no match a lot of our assumptions are invalid, hence
let's check this explicitly once, instead of ignoring the issue.

2 weeks agooptions: drop redundant enum value declaration
Lennart Poettering [Fri, 24 Apr 2026 08:32:52 +0000 (10:32 +0200)] 
options: drop redundant enum value declaration

2 weeks agotree-wide: change option_parse() to return option and arg via internal state (#41833)
Zbigniew Jędrzejewski-Szmek [Mon, 27 Apr 2026 17:42:52 +0000 (19:42 +0200)] 
tree-wide: change option_parse() to return option and arg via internal state (#41833)

2 weeks agomachine-register: don't unref borrowed varlink reply 41813/head
Kai Lüke [Fri, 24 Apr 2026 16:49:09 +0000 (01:49 +0900)] 
machine-register: don't unref borrowed varlink reply

ASAN showed a use-after-free error for systemd-vmspawn's
machine_register call because the reply got accessed and freed again
through _cleanup. The same problem exists in two
verb_machine_control_one/unregister_machine.
Fix these call sites to not set up _cleanup.

2 weeks agonsresource: fix buffer overrun reported by ASAN
Kai Lüke [Fri, 24 Apr 2026 16:42:36 +0000 (01:42 +0900)] 
nsresource: fix buffer overrun reported by ASAN

This came up when running systemd-vmspawn with ASAN to fix another bug
and thus I had to fix this overrun here first: The dispatch tables were
missing the terminator, add it.

2 weeks agofork-notify: Use callback instead of argv NULL code path with return
Kai Lüke [Fri, 24 Apr 2026 15:18:56 +0000 (00:18 +0900)] 
fork-notify: Use callback instead of argv NULL code path with return

In 012d87c1fc/cc8f398202 it was made possible for fork_notify() to
return in the child but at that point all FDs were closed and the
_cleanup path from the return causes assertion failures due to invalid
FDs in notify_event_source/event, leading to a vmspawn failing to start
with a SIGABRT logged in coredump.
Instead of TAKE_PTR on a bunch of things which is fragile, rather avoid
the return and instead add an explicit callback handler and guarantee
to exit directly after it. A userdata argument is also added but not
used yet I think it's quite normal to have for a callback.

2 weeks agovmspawn-varlink: treat QMP disconnect as success for Terminate
Christian Brauner [Mon, 27 Apr 2026 10:34:27 +0000 (12:34 +0200)] 
vmspawn-varlink: treat QMP disconnect as success for Terminate

QMP "quit" tells QEMU to exit, which races the reply with the socket
EOF: sometimes the disconnect lands in qmp_client_fail_pending() with
-ECONNRESET before the reply has been parsed. The shared completion
callback then translates that into io.systemd.MachineInstance.NotConnected,
turning the desired outcome into a varlink error.

This is exactly what TEST-87-AUX-UTILS-VM exposes during its repeated
start/pause/resume/terminate stress loop: a successful Pause/Describe
followed milliseconds later by a Terminate that fails with NotConnected
when the disconnect path wins the race.

Give Terminate its own completion callback that treats disconnect-class
errors as success, since QEMU shutting down is the whole point of "quit".
The other simple commands (Pause, Resume, PowerOff, Reboot) keep the
existing semantics: they expect QMP to remain alive, so NotConnected is
the correct reply for them.

Link: https://github.com/systemd/systemd/actions/runs/24986080288/job/73159585425?pr=41835
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2 weeks agotest: add varlink io.systemd.Unit.StartTransient() test
Michael Vogt [Tue, 14 Apr 2026 15:04:31 +0000 (17:04 +0200)] 
test: add varlink io.systemd.Unit.StartTransient() test

This commit adds a bunch of integration tests for the new varlink
based io.systemd.Unit.StartTransient().

2 weeks agocore: add io.systemd.Unit.StartTransient() to the varlink API
Michael Vogt [Tue, 14 Apr 2026 15:04:15 +0000 (17:04 +0200)] 
core: add io.systemd.Unit.StartTransient() to the varlink API

This commit adds a simple version of io.systemd.Unit.StartTransient
for varlink. It is similar to the dbus version, but there is a key
difference:
1. Instead of building the unit from key/value properties it
   takes a json object in the "service" parameter. It is also
   only implementing a minimal set of what can be done with a
   service (for now)
2. No aux units (for now)
3. When called with --more the varlink socket can notify about
   unit job and state changes controlled via a bool on the
   varlink call inputs: notify{Job,Unit}Changes

We use the new io.systemd.Job interface when outputing the
io.systemd.Unit.StartTransient result as it makes the output
nice and mirrors the input.

Note that the property names follow the D-Bus naming to make a
future "systemctl show" transition from D-Bus -> varlink easier.

Because UnitContext is now also used for the inputs we need
to make a bunch of fields `SD_VARLINK_NULLABLE` so that the
input is even accepted. This does not affect the output, it
is still fully populated, just the schema. The ID of UnitContext
is still required.

Thanks to ikruglov and Lennart for their excellent feedback on
this.

2 weeks agocore: extract manager_setup_transient_unit() helper
Michael Vogt [Tue, 14 Apr 2026 14:24:07 +0000 (16:24 +0200)] 
core: extract manager_setup_transient_unit() helper

Extract the transient unit setup logic from transient_unit_from_message()
in dbus-manager.c into a shared helper.

This prepares for reuse by the varlink StartTransient implementation.

2 weeks agovarlink: add new io.systemd.Job interface
Michael Vogt [Tue, 21 Apr 2026 07:10:39 +0000 (09:10 +0200)] 
varlink: add new io.systemd.Job interface

This commit creates a new varlink-io.systemd.Job.c file and puts
the job related varlink types into this file. Those will be
used by the upcoming io.systemd.Unit.StartTransient.

Note that the property names follow the D-Bus naming to make a
future "systemctl show" transition from D-Bus -> varlink easier.

Thanks to @ikruglov for suggesting this preparation commit and
to Lennart for suggesting the D-Bus compatibility considerations.

2 weeks agoshared/options: add whitespace to OPTION_COMMON definitions 41833/head
Zbigniew Jędrzejewski-Szmek [Thu, 23 Apr 2026 18:04:35 +0000 (20:04 +0200)] 
shared/options: add whitespace to OPTION_COMMON definitions

Initially I thought that there'd be just a handful, but the list
has grown over time and all bunched up together they are hard to
read.

2 weeks agonspawn,vmspawn: fix state optarg uses
Zbigniew Jędrzejewski-Szmek [Mon, 27 Apr 2026 07:22:43 +0000 (09:22 +0200)] 
nspawn,vmspawn: fix state optarg uses

2 weeks agotree-wide: change option_parse() to return option and arg via internal state
Zbigniew Jędrzejewski-Szmek [Sun, 26 Apr 2026 21:22:27 +0000 (23:22 +0200)] 
tree-wide: change option_parse() to return option and arg via internal state

It was requested to make the 'c', 'opt', and 'arg' params the same, i.e.
defined through the FOREACH_OPTION macro. But we can't do that easily,
because 'c' was defined in the for loop definition, and we can only
define variables of the same type in that way. Also, in some cases we
need only 'c', in other cases with need 'c' and 'arg, in some cases 'c'
and 'opt', and in other cases all three. We'd need to either
conditionalize or mark those variables with _unused_ to deal with
compiler warnings. But a different approach works quite nicely: add
state.opt and state.arg to show the current option and it's argument.
(The short names are picked on purpose to reduce verbosity since those
are used a lot.)

2 weeks agoConvert udev helper programs to option macros (#41820)
Zbigniew Jędrzejewski-Szmek [Mon, 27 Apr 2026 09:22:23 +0000 (11:22 +0200)] 
Convert udev helper programs to option macros (#41820)

2 weeks agojob: add a "finished" state for jobs
Lennart Poettering [Fri, 24 Apr 2026 14:00:21 +0000 (16:00 +0200)] 
job: add a "finished" state for jobs

So far when a job completed we'd never transition into any new state,
we'd just do some final processing work (such as notifying clients) and
destroy it.

Let's change that, and briefly enter a final state: "finished". This is
useful so that code that notifies clients can generically send the
quadruplet of id, type, state, result for any change notification and
naturally can communicate job completion that way: by setting the state
field to "finished".

Prompted by the discussions in: #41583

2 weeks agoiocost: convert to the new option parser 41820/head
Zbigniew Jędrzejewski-Szmek [Sat, 25 Apr 2026 17:06:55 +0000 (19:06 +0200)] 
iocost: convert to the new option parser

--help output only has changes expected in the new style.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 weeks agoscsi_id: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Sat, 25 Apr 2026 11:01:13 +0000 (13:01 +0200)] 
scsi_id: convert to the new option parser

Common page-code parsing extracted into a parse_page_code() helper.

While at it, return real error values (-EINVAL, etc.) rather than -1,
and rename retval to r throughout for consistency.

The body of main is moved to new run. The closing of logging file
descriptors is dropped. They will be closed automatically anyway. Not
sure what the original purpose of that code was. The code is also
modernized in various places… though more changes could be made. The
return convention of help() and similar functions is changed to usual
negative/0/1, where 0 means that the caller should quit.

set_inq_values would return positive error values too, which was
previously ignored. It's not entirely clear, but that doesn't seem
to have been on purpose.

2 weeks agoformat-table: fix potential segfault
Yu Watanabe [Sun, 26 Apr 2026 17:04:38 +0000 (02:04 +0900)] 
format-table: fix potential segfault

In format-table.h, TABLE_IN_ADDR is commented as "Takes a union in_addr_union
(or a struct in_addr)". However, if we pass struct in_addr to table_add_many(),
the function reads more than the size of the struct.

2 weeks agopreparatory work for the storage provider work in #41776 (#41814)
Lennart Poettering [Sun, 26 Apr 2026 21:44:02 +0000 (23:44 +0200)] 
preparatory work for the storage provider work in #41776 (#41814)

nothing earth shattering, but generally useful. without #41776 it has no
immediate users though

2 weeks agovarious trivial tweaks (#41828)
Luca Boccassi [Sun, 26 Apr 2026 21:40:01 +0000 (22:40 +0100)] 
various trivial tweaks (#41828)

2 weeks agoblockdev-list: make BLOCKDEV_LIST_IGNORE_ROOT suppress all definitions of the root... 41814/head
Lennart Poettering [Thu, 23 Apr 2026 13:46:10 +0000 (15:46 +0200)] 
blockdev-list: make BLOCKDEV_LIST_IGNORE_ROOT suppress all definitions of the root disk

There are various definitions of the root disk, let's suppress them all if
the flag is set. So far only the outermost is suppressed, which is a bit
weird, given it's "further away" from the rootfs.

2 weeks agoblockdev-list: pick up read_only property
Lennart Poettering [Thu, 23 Apr 2026 06:58:48 +0000 (08:58 +0200)] 
blockdev-list: pick up read_only property

2 weeks agofs-util: add XO_AUTO_RW_RO
Lennart Poettering [Wed, 22 Apr 2026 08:17:19 +0000 (10:17 +0200)] 
fs-util: add XO_AUTO_RW_RO

2 weeks agoformat-table: add tristate field
Lennart Poettering [Wed, 22 Apr 2026 21:43:17 +0000 (23:43 +0200)] 
format-table: add tristate field

2 weeks agopath-lookup: add state_directory_generic() helper inspired by runtime_directory_generic()
Lennart Poettering [Thu, 23 Apr 2026 13:44:52 +0000 (15:44 +0200)] 
path-lookup: add state_directory_generic() helper inspired by runtime_directory_generic()

2 weeks agohelp-util: reword comment a bit 41828/head
Lennart Poettering [Sun, 26 Apr 2026 18:53:28 +0000 (20:53 +0200)] 
help-util: reword comment a bit

Based on comments here:

https://github.com/systemd/systemd/pull/41805#discussion_r3141746275

2 weeks agonotify: we typically say 'service manager' not 'init system', do so here too
Lennart Poettering [Sun, 26 Apr 2026 18:51:26 +0000 (20:51 +0200)] 
notify: we typically say 'service manager' not 'init system', do so here too

2 weeks agossh-proxy: add a missing dispatch table sentinel
Frantisek Sumsal [Sat, 25 Apr 2026 21:51:48 +0000 (23:51 +0200)] 
ssh-proxy: add a missing dispatch table sentinel

Which was accidentally dropped in e6be5fb7200fb02e78e4f27f49a4d734b7b850a0.

Follow-up for e6be5fb7200fb02e78e4f27f49a4d734b7b850a0.

2 weeks agovarlink: address some trivial points Claude found
Lennart Poettering [Sun, 26 Apr 2026 18:50:09 +0000 (20:50 +0200)] 
varlink: address some trivial points Claude found

Just addressing Claude's last review from #41815

2 weeks agovarlink-util: add generic code that calls out to a 'hook' directory o… (#41815)
Christian Brauner [Sun, 26 Apr 2026 15:31:52 +0000 (17:31 +0200)] 
varlink-util: add generic code that calls out to a 'hook' directory o… (#41815)

…f sockets

2 weeks agoshared/options: split out helper to format -o/--option=
Zbigniew Jędrzejewski-Szmek [Sat, 25 Apr 2026 11:31:43 +0000 (13:31 +0200)] 
shared/options: split out helper to format -o/--option=

2 weeks agoata_id: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Sat, 25 Apr 2026 10:43:12 +0000 (12:43 +0200)] 
ata_id: convert to the new option parser

The commandline check is tightened to reject extra arguments.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agocdrom_id: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Sat, 25 Apr 2026 10:33:03 +0000 (12:33 +0200)] 
cdrom_id: convert to the new option parser

The commandline check is tightened to reject extra arguments.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agodmi_memory_id: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Sat, 25 Apr 2026 10:17:27 +0000 (12:17 +0200)] 
dmi_memory_id: convert to the new option parser

For some reason, the old code had duplicate {"version", 'v'} entry in
the options table and a matching case that could not be reached.

Commandline parsing is tightened to reject any positional arguments.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agofido_id: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Sat, 25 Apr 2026 10:09:05 +0000 (12:09 +0200)] 
fido_id: convert to the new option parser

The commandline check is tightened. Previously the program would
crash if called without an argument.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agomtd_probe: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Sat, 25 Apr 2026 10:05:47 +0000 (12:05 +0200)] 
mtd_probe: convert to the new option parser

The commandline check is tightened. Previously the program would
crash if called without an argument.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agovarlink-util: add generic code that calls out to a 'hook' directory of sockets 41815/head
Lennart Poettering [Thu, 23 Apr 2026 07:29:20 +0000 (09:29 +0200)] 
varlink-util: add generic code that calls out to a 'hook' directory of sockets

2 weeks agotest: don't strip directives from test units 41808/head
Frantisek Sumsal [Sat, 25 Apr 2026 21:39:47 +0000 (23:39 +0200)] 
test: don't strip directives from test units

The original find was matching even our test units, which caused issues
when the check was extended with Memory*= directives, as we stripped
them off from test units for TEST-55-OOMD where we certainly need them.
Since the stripping was meant primarily for "production-grade" units,
let's limit it to units under /etc/systemd/system/ and
/usr/lib/systemd/system/.

2 weeks agotest: slightly reduce the performance/memory overhead for wrapped binaries
Frantisek Sumsal [Sat, 25 Apr 2026 14:37:34 +0000 (16:37 +0200)] 
test: slightly reduce the performance/memory overhead for wrapped binaries

Let's drop the quarantine that ASan uses for use-after-free detection,
as it's pointless in wrapped binaries and can consume up to 256 MiB of
memory (with the default configuration). Also, don't keep any stack
traces for allocations & deallocations, which should (slightly) help
with both memory & performance overhead.

2 weeks agotest: temporarily ignore sanitizer warning about blocked ptrace()
Frantisek Sumsal [Thu, 23 Apr 2026 13:11:01 +0000 (15:11 +0200)] 
test: temporarily ignore sanitizer warning about blocked ptrace()

LLVM 22 introduced an additional check [0] for ptrace() syscall when
invoking sanitizers [0] which currently produces a false-positive
warning when running some of our units under sanitizers:

[   47.524680] systemd-timedated[740]: ==740==WARNING: ptrace appears to be blocked (is seccomp enabled?). LeakSanitizer may hang.
[   47.524680] systemd-timedated[740]: ==740==Child exited with signal 15.
...
[ 1555.734223] systemd-oomd[93]: ==93==WARNING: ptrace appears to be blocked (is seccomp enabled?). LeakSanitizer may hang.
[ 1555.734223] systemd-oomd[93]: ==93==Child exited with signal 15.
...

It is a false positive because we disable the seccomp filters
system-wide for our units in the sanitizer jobs.

Now, from what I've seen so far this happens only in
Type=notify(-reload) units that also utilize bus_event_loop_with_idle().
This, combined with the fact that the ptrace()-check child process from
[0] checks only if the child process was killed by _any_ signal, means
that if the systemd unit exits on its own after becoming idle and then
something sends it SIGTERM (either via explicit `systemctl stop` or
during system shutdown), this SIGTERM might hit the ptrace()-check child
process from the sanitizer handler (as we also send the signal to all
processes in the target cgroup), which the parent process then
mistakenly evaluates as a blocked ptrace() syscall, even though the
check process wasn't killed by SIGSYS.

I filed this as [1] to the LLVM project, but let's also temporarily
ignore the warning in the sanitizer report processing, as it currently
causes annoying test fails.

[0] https://github.com/llvm/llvm-project/commit/a708b4bf21d7c2298224cdacf7d424abc3c8fed4
[1] https://github.com/llvm/llvm-project/issues/193714

2 weeks agotest: drop any memory limits from units when running with sanitizers
Frantisek Sumsal [Fri, 24 Apr 2026 12:17:23 +0000 (14:17 +0200)] 
test: drop any memory limits from units when running with sanitizers

As the memory usage under sanitizers is quite unpredictable.

This is currently relevant mainly for Polkit, as it introduced memory
limits for its polkitd.service unit in the latest version [0] which are
very easy to trigger when running under sanitizers (as polkitd depends
on libsystemd which brings ASan into polkitd's address space).

[0] https://github.com/polkit-org/polkit/commit/7d9c06c58a957ee3f2a4383ade6f207b05207e3e

2 weeks agotest: wrap even more binaries when running with sanitizers
Frantisek Sumsal [Thu, 23 Apr 2026 11:44:59 +0000 (13:44 +0200)] 
test: wrap even more binaries when running with sanitizers

Turns out that the util-linux dep on libsystemd caused more fun than I
originally anticipated:

$ lddtree /usr/bin/dfuzzer
dfuzzer => /usr/bin/dfuzzer (interpreter => /lib64/ld-linux-x86-64.so.2)
    libgio-2.0.so.0 => /lib64/libgio-2.0.so.0
        libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0
        libz.so.1 => /lib64/libz.so.1
        libmount.so.1 => /lib64/libmount.so.1
            libblkid.so.1 => /lib64/libblkid.so.1
            libsystemd.so.0 => /lib64/libsystemd.so.0
                libm.so.6 => /lib64/libm.so.6
                    ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
        libselinux.so.1 => /lib64/libselinux.so.1
            libpcre2-8.so.0 => /lib64/libpcre2-8.so.0
...

Also, the tpm2 utils now depend on libudev through libcurl -> libssh ->
libfido2 dep chain:

$ lddtree /usr/bin/tpm2_pcrread
tpm2_pcrread => /usr/bin/tpm2_pcrread (interpreter => /lib64/ld-linux-x86-64.so.2)
    ...
    libcurl.so.4 => /lib64/libcurl.so.4
    ...
        libssh.so.4 => /lib64/libssh.so.4
            libfido2.so.1 => /lib64/libfido2.so.1
                libcbor.so.0.13 => /lib64/libcbor.so.0.13
                libudev.so.1 => /lib64/libudev.so.1
                    libgcc_s.so.1 => /lib64/libgcc_s.so.1
...

Follow-up for 8030e0b19ef7c0e823d84dd08ad38a2d88e0a230.

2 weeks agov4l_id: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Sat, 25 Apr 2026 09:58:50 +0000 (11:58 +0200)] 
v4l_id: convert to the new option parser

The commandline check is tightened to reject extra arguments.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agohwdb: sensor: add accel mount matrix for GPD WIN 5
fecet [Sat, 25 Apr 2026 06:48:19 +0000 (14:48 +0800)] 
hwdb: sensor: add accel mount matrix for GPD WIN 5

The WIN 5 (DMI product G1618-05) ships the same BMI0160
accelerometer with the same physical mounting as the Win Max 2
(G1619-04), so reuse its mount matrix. Verified on hardware:
without the matrix iio-sensor-proxy reports
AccelerometerOrientation=normal regardless of physical pose,
and applying the G1619-04 matrix makes orientation transitions
(normal / left-up / right-up / bottom-up) track the device
correctly.

2 weeks agoadd helpers for unified --help formatting (#41805)
Zbigniew Jędrzejewski-Szmek [Sat, 25 Apr 2026 09:23:18 +0000 (11:23 +0200)] 
add helpers for unified --help formatting (#41805)

I see --help output formatting as contiuation of @keszybz's work on
options.[ch], hence let's start to add some really basic infrastructure
to unify the --help output more.

2 weeks agoip-util: introduce several functions for IP packet handling (#41801)
Yu Watanabe [Sat, 25 Apr 2026 01:15:54 +0000 (10:15 +0900)] 
ip-util: introduce several functions for IP packet handling (#41801)

2 weeks agoip-util: define IPV4_MIN_REASSEMBLY_SIZE 41801/head
Yu Watanabe [Mon, 13 Apr 2026 23:12:49 +0000 (08:12 +0900)] 
ip-util: define IPV4_MIN_REASSEMBLY_SIZE

The number will be later used at several places.

2 weeks agoip-util: introduce udp_packet_verify()
Yu Watanabe [Mon, 16 Mar 2026 15:11:25 +0000 (00:11 +0900)] 
ip-util: introduce udp_packet_verify()

This is mostly equivalent to dhcp_packet_verify_headers(), but
- it optionally returns the UDP payload as iovec, and
- supports IP header with options,
- check packet length more strictly.

2 weeks agoip-util: introduce udp_packet_build()
Yu Watanabe [Sun, 15 Mar 2026 04:57:33 +0000 (13:57 +0900)] 
ip-util: introduce udp_packet_build()

Then make dhcp_packet_append_ip_headers() just a wrapper of the new
function. Currently, the wrapper is inefficient, but will be removed in
a later commit.

2 weeks agoip-util: introduce ip_checksum()
Yu Watanabe [Sun, 15 Mar 2026 04:30:38 +0000 (13:30 +0900)] 
ip-util: introduce ip_checksum()

It is equivalent to dhcp_packet_checksum(). It is generic
and not specific to DHCP. Hence, renamed to ip_checksum().

2 weeks agounits: order networkd resolve hook After=network-pre.target
Nick Rosbrook [Fri, 24 Apr 2026 13:38:42 +0000 (09:38 -0400)] 
units: order networkd resolve hook After=network-pre.target

Without this, the socket is available well before systemd-networkd.service
is able to start, because of its own After=network-pre.target ordering.
Then, if resolved handles queries before network-pre.target, it will
hang waiting for networkd to reply to hook queries.

This is currently happening in the wild with cloud-init.

2 weeks agonss-myhostname: fix maybe-uninitialized warning
Luca Boccassi [Fri, 24 Apr 2026 12:31:46 +0000 (13:31 +0100)] 
nss-myhostname: fix maybe-uninitialized warning

In resolute with gcc 15.2.0:

472s ../src/nss-myhostname/nss-myhostname.c: In function ‘_nss_myhostname_gethostbyname4_r’:
472s ../src/nss-myhostname/nss-myhostname.c:132:44: error: ‘local_address_ipv4’ may be used uninitialized [-Werror=maybe-uninitialized]
472s   132 |                 *(uint32_t*) r_tuple->addr = local_address_ipv4;
472s       |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
472s ../src/nss-myhostname/nss-myhostname.c:42:18: note: ‘local_address_ipv4’ was declared here
472s    42 |         uint32_t local_address_ipv4;
472s       |                  ^~~~~~~~~~~~~~~~~~

2 weeks agovmspawn: prepare QMP infrastructure for runtime block-device hotplug (#41763)
Christian Brauner [Fri, 24 Apr 2026 15:38:54 +0000 (17:38 +0200)] 
vmspawn: prepare QMP infrastructure for runtime block-device hotplug (#41763)

  The block-device hotplug work (#NNNNN) needs a number of cross-cutting
  changes to the QMP plumbing that aren't hotplug-specific in
  themselves: a refcounted DriveInfo so async stage callbacks can keep
  slot refs, a counter-based naming scheme so multiple drives can share
  the same backing path, pipelined remove-fd so QEMU's fdsets get
  released at blockdev-del time, and a generic-completion callback that
  doesn't tear the VM down on a runtime QMP error. None of these change
  behaviour from a user's point of view, none of them depend on the
  varlink hotplug methods landing, and several are wins on their own
  (the fdset leak in particular is observable today with --extra-drive
  under long-running VMs). Pulling them out of the hotplug PR keeps
  that PR focused on the IDL + server-side method handlers, and lets
  this preparatory work land on its own merits without waiting for the
  larger feature review.

  Cleanup pieces that fall out for free:

    qmp-client: widen next_fdset_id to uint64_t
    vmspawn: move VMSPAWN_PCIE_HOTPLUG_SPARES to vmspawn-qmp.h
    vmspawn-varlink: use error < 0 in async QMP completion callbacks
    vmspawn-varlink: simplify on_qmp_describe_complete result extraction
    vmspawn-varlink: extract notify_event_subscribers from on_qmp_event
    vmspawn-varlink: treat empty event subscription filter as catch-all
    vmspawn-qmp: pass bridge to on_cont_complete via invoke userdata

  Infrastructure the hotplug add path will sit on top of:

    vmspawn-qmp: convert DriveInfo to a refcounted object
    vmspawn-qmp: derive QMP node and device ids from a bridge counter
    vmspawn-qmp: pipeline remove-fd after each blockdev-add
    vmspawn-qmp: keep the event loop running on post-setup QMP failures
    vmspawn-qmp: add the hotplug-capable block-device add machinery
    vmspawn-qmp: add vmspawn_qmp_remove_block_device

  The two final commits introduce vmspawn_qmp_add_block_device() and
  vmspawn_qmp_remove_block_device() but leave them without varlink
  callers — the io.systemd.VirtualMachineInstance method handlers that
  forward into them land with the rest of the hotplug PR. Boot-time
  drive setup is rewritten on top of vmspawn_qmp_add_block_device() so
  the hotplug and boot paths share a single staged-add pipeline from
  day one.

2 weeks agojob: properly initialize all enum fields
Lennart Poettering [Fri, 24 Apr 2026 13:19:06 +0000 (15:19 +0200)] 
job: properly initialize all enum fields

This changes the .result field to invalid initially, which arguably
makes more sense than "done", which was previously the default.

This is a correctnes fix, and afaics has no effect on the API, since we
do not expose this 1:1 as D-Bus property: it's only seen on D-Bus as
part of the job completion signal, at which part it is correctly
initialized.

Noticed while reviewing: https://github.com/systemd/systemd/pull/41583

2 weeks agosystemd-cat does not connect the standard *input* of a process to the journal
Stephane Chazelas [Fri, 24 Apr 2026 12:53:02 +0000 (13:53 +0100)] 
systemd-cat does not connect the standard *input* of a process to the journal

The first paragraph of the description of the systemd-cat utility incorrectly referred to stdin when it obviously meant stderr: the other fd that it connects to the journal via a unix(7) domain socket, as clarified in the following paragraphs.

I've also replaced "process" with "command" as in that mode, systemd-cat executes a file and does not spawn a process.