Commit Graph
54482 Commits
Author SHA1 Message Date
Mike Yuan b04ddbcbd7 string-table: annotate _to_string and _from_string with _const_ and _pure_, respectively
Follow-up for c94f6ab1bf
2025-05-06 23:07:00 +02:00
damnkiwi6120 eda164cd4a Replace reference URLs with working ones
The linuxfoundation.org entry at L50 goes 404, so I replace it with a working one from kernel.org.

Both links are checked with archive.org.
https://web.archive.org/web/20231114104223/https://lists.linuxfoundation.org/pipermail/virtualization/2015-August/030331.html
https://web.archive.org/web/20230503084037/https://docs.kernel.org/s390/pci.html
2025-05-07 04:10:33 +09:00
Yu Watanabe dde0ed6335 core/service: minor cleanups (#37362)
Split out from #37071
2025-05-07 02:09:19 +09:00
Mike Yuan 61ce6e673e run0: disable IgnoreSIGPIPE= for transient unit 2025-05-07 01:39:04 +09:00
Yu Watanabe 13e4201dc9 Bugprone argument comments - round 3 (#37356)
Follow up from https://github.com/systemd/systemd/pull/37346
2025-05-07 01:38:34 +09:00
Daan De Meyer 1fbfbe81b5 tree-wide: Get rid of prefix_roota() in favor of path_join()
We deprecated prefix_roota() in favor of chase() and path_join().
Let's finish the removal by replacing the few remaining call sites
with path_join().
2025-05-06 17:40:33 +02:00
Daan De Meyer 38c9ca5380 tree-wide: Remove strv_from_stdarg_alloca()
It's trivial to replace all uses of this function with STRV_MAKE()
and strv_new_ap() so let's get rid of this variant.
2025-05-06 17:40:01 +02:00
Mike Yuan c0239e5f11 macro: implement ABS via __builtin_imaxabs() 2025-05-06 17:39:01 +02:00
Lennart Poettering e9f9ddbfa8 boot: make console_key_read() return param optional
Inspired by #36684
2025-05-06 17:38:25 +02:00
Daan De Meyer efc529cfbd Add missing alloc-util.h to string-util.h
Used by strndupa_safe() and strdupa_safe().

Follow up for 02207b54d5
2025-05-06 17:38:11 +02:00
Jelle van der Waa 4c94ea02a5 core: prefer American spelling of canceled 2025-05-06 16:26:47 +02:00
Jelle van der Waa 70201ae720 libsystemd-network: correct argument comment 2025-05-06 16:26:47 +02:00
Jelle van der Waa 1c04b172f1 treewide: correct argument comments for show_boot_entry 2025-05-06 16:26:47 +02:00
Jelle van der Waa fbe89a80b9 test: correct argument comment expected 2025-05-06 16:26:47 +02:00
Jelle van der Waa 72c389254a treewide: correct argument comments for event_reset_time_relative 2025-05-06 16:26:47 +02:00
Jelle van der Waa 3e813860c0 shared: use implementation argument naming for dissect_loop_device 2025-05-06 16:26:47 +02:00
Jelle van der Waa c147cd9acb treewide: correct argument comments for sd_notify 2025-05-06 16:26:47 +02:00
Jelle van der Waa 396b3a1ea7 core: correct argument comments 2025-05-06 16:26:29 +02:00
Mike Yuan e1fa0e1a2f core/service: correct comment in service_deserialize_exec_command()
The index of ExecCommand is serialized, not PID.
2025-05-06 16:13:16 +02:00
Mike Yuan 729228e7da core/service: drop duplicate ExecCommand check
It is verified in config_parse_exec() and bus_set_transient_exec_command()
already.
2025-05-06 16:13:16 +02:00
Daan De Meyer 02207b54d5 alloc-util: Move strdupa_safe() and strndupa_safe() to string-util.h 2025-05-06 15:42:01 +02:00
Jelle van der Waa 52068c1e9c sd-varlink: sd_varlink_dispatch rename table to dispatch_table
Follow the argument style used throughout the codebase.
2025-05-06 13:38:46 +02:00
Daan De Meyer e4a08721c3 string-util: Remove utf8.h and alloc-util.h includes 2025-05-06 13:27:54 +02:00
Yu Watanabe 8d7f05abc8 cleanup: bugprone argument issues (#37346)
Follow up from https://github.com/systemd/systemd/pull/37281
2025-05-06 18:56:07 +09:00
Daan De Meyer 0682853b2f Various preparatory changes from #37344 (#37348) 2025-05-06 11:23:15 +02:00
Daan De Meyer c09ce222b6 hashmap: Drop debug params
Passing in the func, file and line information complicates the
interface. On top of that, it prevents forward declaring Hashmap in
strv.h, as we need to pass the macros everywhere that we allocate a
hashmap, which means we have to include the hashmap header everywhere
we have a function that allocates a hashmap instead of just having to
forward declare Hashmap.

Let's drop the file, func and line information from the debug information.
Instead, in the future we can add a description field to hashmaps like we
already have in various other structs to describe the purpose of the hashmap
which should be much more useful than having the file, line and function where
the hashmap was allocated.
2025-05-06 10:14:26 +02:00
Daan De Meyer 40a6cdc29e macro: Introduce ABS() macro and use it in header files
abs() requires including the entirety of stdlib.h just for a single
trivial function. Let's introduce the ABS() macro and use it in header
files instead so we can get rid of stdlib.h transitive includes in header
files in a later commit.
2025-05-06 10:14:26 +02:00
Daan De Meyer c94f6ab1bf string-table: Move more implementation logic into functions
Let's move some more implementation logic into functions. We keep
the logic that requires the macro in the macro and move the rest into
functions.

While we're at it, let's also make the parameter declarations of
all the string table macros less clausthrophobic.
2025-05-06 10:14:24 +02:00
Daan De Meyer 76d62b63ef main-func: Reduce transitive includes
Let's move some logic from _DEFINE_MAIN_FUNCTION() and other places
in main-func.h into functions that we implement in main-func.c to
allow moving some included headers from the header to the .c file.
2025-05-06 10:07:27 +02:00
Jelle van der Waa 3ce45cd3ac shared: fix leftover bool value from flags conversion
Follow-up for 5c48335ef4
2025-05-06 09:31:50 +02:00
Yu Watanabe d3059d48ee hibernate-resume: automatically decrypt dissected swap (#37335)
Closes https://github.com/systemd/systemd/issues/27247
(https://github.com/systemd/systemd/pull/35328,
https://github.com/systemd/systemd/issues/37330)
2025-05-06 13:00:24 +09:00
Yu Watanabe 2482bd49c3 network,udev: several improvements for logging (#37337)
No functional changes. Continuation of #37269.
2025-05-06 12:43:15 +09:00
Yu Watanabe a3a98a3793 prioq: coding style fixes 2025-05-05 22:53:01 +02:00
Jelle van der Waa 4b779c874c shared: rename type to fstype
Follow the argument comment naming already used.
2025-05-05 21:34:31 +02:00
Jelle van der Waa 60f6d70a29 network: correct argument comments 2025-05-05 19:47:49 +02:00
Jelle van der Waa 5cdec544c7 libsystemd-network: fix typo in argument comment 2025-05-05 19:38:18 +02:00
Mike Yuan 656a7bb1fb hibernate-resume: automatically decrypt dissected swap if told so via autoSwap
With the addition of /dev/disk/by-designator/ along with
ID_DISSECT_PART_DESIGNATOR attr, it is now trivial to tell
whether the swap device we hibernated into is the "auto" one.
Hence use that bit of info and generate cryptsetup unit
in hibernate-resume-generator if that's the case.

Ideally, gpt-auto should really just handle swap already
in initrd, which would save us a myriad of trouble and
the system behaves more consistently. But I don't see that
happening anytime soon. This is the second best option
we have I reckon.

Closes #27247 (#35328, #37330)
2025-05-05 19:37:11 +02:00
Mike Yuan a88ee2c8df sleep: record whether the hibernation device is auto swap (with "swap" designator) 2025-05-05 19:37:10 +02:00
Jelle van der Waa 866a662abe treewide: correct argument comments for sd_notifyf 2025-05-05 19:35:39 +02:00
Jelle van der Waa ff259047d5 shared: fix typo in read_etc_hostname definition 2025-05-05 19:32:52 +02:00
Jelle van der Waa 160159a709 resolve: update argument comments 2025-05-05 19:32:23 +02:00
Mike Yuan 60997a87ef blockdev-util: don't use mixed style of retval in block_device_get_originating
We have two typical styles of 'ret' param assignment + retval:

1) < 0 on actual error, 0 on nothing (ret == NULL), > 0 on something
2) recognizable errno on nothing, < 0 on other errors, >= 0 on something

but never use both at the same time.
2025-05-05 18:39:05 +02:00
Mike Yuan ab2f5407a0 core/cgroup: block_get_originating() doesn't return > 0
Follow-up for 612fc70fc0
2025-05-05 18:39:05 +02:00
Debarshi Ray ab46feb3e2 meson: Ensure that distribution packages own systemenvgeneratordir
Currently, Fedora's systemd RPM doesn't own systemenvgeneratordir
(ie., /usr/lib/systemd/system-environment-generators) [1] because it's
not created when systemd is installed.  In contrast, userenvgeneratordir
(ie., /usr/lib/systemd/user-environment-generators) is created, unless
the environment-d Meson option is explicitly disabled.

While this can be worked around elsewhere, it's better if the upstream
build system created the directories consistently.  It will avoid
repetition, and prevent silly bugs or deviations from creeping in.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2284085
2025-05-06 00:12:02 +09:00
Daan De Meyer b75c6c3c3f meson: Make sure check-filesystems.sh runs from the build directory
run_command()'s working directory is documented as undefined but it
seems to be the current source directory as when the -ftime-trace
clang option is enabled, -.json is written to src/basic/meson.build
every time meson is run.

Let's make sure the command is executed in the build directory so that
any auxiliary files are written there as well.
2025-05-05 17:09:18 +02:00
Yu Watanabe 11c5eff1cb udev/net: update log message 2025-05-05 22:07:04 +09:00
Yu Watanabe f4282e6a06 udev/net: mention which SR-IOV setting could not be applied in log message 2025-05-05 22:07:04 +09:00
Yu Watanabe fed4da3a19 network/sriov: mention which setting could not be applied in log message 2025-05-05 22:07:04 +09:00
Yu Watanabe d28746ef55 network: make log_link_message_full_errno() take format string 2025-05-05 22:07:04 +09:00
Yu Watanabe 3d026764f1 network/nexthop: split out nexthop_to_string() 2025-05-05 22:07:00 +09:00