• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

systemd / systemd / 15263807472

26 May 2025 08:53PM UTC coverage: 72.046% (-0.002%) from 72.048%
15263807472

push

github

yuwata
src/core/manager.c: log preset activity on first boot

This gives us a little more information about what units were enabled
or disabled on that first boot and will be useful for OS developers
tracking down the source of unit state.

An example with this enabled looks like:

```
NET: Registered PF_VSOCK protocol family
systemd[1]: Applying preset policy.
systemd[1]: Unit /etc/systemd/system/dnsmasq.service is masked, ignoring.
systemd[1]: Unit /etc/systemd/system/systemd-repart.service is masked, ignoring.
systemd[1]: Removed '/etc/systemd/system/sockets.target.wants/systemd-resolved-monitor.socket'.
systemd[1]: Removed '/etc/systemd/system/sockets.target.wants/systemd-resolved-varlink.socket'.
systemd[1]: Created symlink '/etc/systemd/system/multi-user.target.wants/var-mnt-workdir.mount' → '/etc/systemd/system/var-mnt-workdir.mount'.
systemd[1]: Created symlink '/etc/systemd/system/multi-user.target.wants/var-mnt-workdir\x2dtmp.mount' → '/etc/systemd/system/var-mnt-workdir\x2dtmp.mount'.
systemd[1]: Created symlink '/etc/systemd/system/afterburn-sshkeys.target.requires/afterburn-sshkeys@core.service' → '/usr/lib/systemd/system/afterburn-sshkeys@.service'.
systemd[1]: Created symlink '/etc/systemd/system/sockets.target.wants/systemd-resolved-varlink.socket' → '/usr/lib/systemd/system/systemd-resolved-varlink.socket'.
systemd[1]: Created symlink '/etc/systemd/system/sockets.target.wants/systemd-resolved-monitor.socket' → '/usr/lib/systemd/system/systemd-resolved-monitor.socket'.
systemd[1]: Populated /etc with preset unit settings.
```

Considering it only happens on first boot and not on every boot I think
the extra information is worth the extra verbosity in the logs just for
that boot.

5 of 6 new or added lines in 1 file covered. (83.33%)

5463 existing lines in 165 files now uncovered.

299151 of 415222 relevant lines covered (72.05%)

702386.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/network/netdev/ipoib.c
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2

3
#include <linux/if_arp.h>
4
#include <linux/if_link.h>
5

6
#include "sd-netlink.h"
7

8
#include "conf-parser.h"
9
#include "ipoib.h"
10
#include "networkd-link.h"
11
#include "networkd-network.h"
12
#include "parse-util.h"
13
#include "string-table.h"
14
#include "string-util.h"
15

16
assert_cc((int) IP_OVER_INFINIBAND_MODE_DATAGRAM  == (int) IPOIB_MODE_DATAGRAM);
17
assert_cc((int) IP_OVER_INFINIBAND_MODE_CONNECTED == (int) IPOIB_MODE_CONNECTED);
18

19
static void netdev_ipoib_init(NetDev *netdev) {
×
UNCOV
20
        IPoIB *ipoib = IPOIB(netdev);
×
21

22
        ipoib->mode = _IP_OVER_INFINIBAND_MODE_INVALID;
×
23
        ipoib->umcast = -1;
×
UNCOV
24
}
×
25

26
static int netdev_ipoib_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *m) {
×
27
        assert(link);
×
UNCOV
28
        assert(m);
×
29

30
        IPoIB *ipoib = IPOIB(netdev);
×
UNCOV
31
        int r;
×
32

33
        if (ipoib->pkey > 0) {
×
34
                r = sd_netlink_message_append_u16(m, IFLA_IPOIB_PKEY, ipoib->pkey);
×
UNCOV
35
                if (r < 0)
×
36
                        return r;
37
        }
38

39
        if (ipoib->mode >= 0) {
×
40
                r = sd_netlink_message_append_u16(m, IFLA_IPOIB_MODE, ipoib->mode);
×
UNCOV
41
                if (r < 0)
×
42
                        return r;
43
        }
44

45
        if (ipoib->umcast >= 0) {
×
46
                r = sd_netlink_message_append_u16(m, IFLA_IPOIB_UMCAST, ipoib->umcast);
×
47
                if (r < 0)
×
UNCOV
48
                        return r;
×
49
        }
50

51
        return 0;
52
}
53

54
int ipoib_set_netlink_message(Link *link, sd_netlink_message *m) {
×
UNCOV
55
        int r;
×
56

57
        assert(link);
×
58
        assert(link->network);
×
UNCOV
59
        assert(m);
×
60

61
        r = sd_netlink_message_open_container(m, IFLA_LINKINFO);
×
UNCOV
62
        if (r < 0)
×
63
                return r;
64

65
        r = sd_netlink_message_open_container_union(m, IFLA_INFO_DATA, link->kind);
×
UNCOV
66
        if (r < 0)
×
67
                return r;
68

69
        if (link->network->ipoib_mode >= 0) {
×
70
                r = sd_netlink_message_append_u16(m, IFLA_IPOIB_MODE, link->network->ipoib_mode);
×
UNCOV
71
                if (r < 0)
×
72
                        return r;
73
        }
74

75
        if (link->network->ipoib_umcast >= 0) {
×
76
                r = sd_netlink_message_append_u16(m, IFLA_IPOIB_UMCAST, link->network->ipoib_umcast);
×
UNCOV
77
                if (r < 0)
×
78
                        return r;
79
        }
80

81
        r = sd_netlink_message_close_container(m);
×
UNCOV
82
        if (r < 0)
×
83
                return r;
84

85
        r = sd_netlink_message_close_container(m);
×
86
        if (r < 0)
×
UNCOV
87
                return r;
×
88

89
        return 0;
90
}
91

92
static const char * const ipoib_mode_table[_IP_OVER_INFINIBAND_MODE_MAX] = {
93
        [IP_OVER_INFINIBAND_MODE_DATAGRAM]  = "datagram",
94
        [IP_OVER_INFINIBAND_MODE_CONNECTED] = "connected",
95
};
96

97
DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING(ipoib_mode, IPoIBMode);
×
UNCOV
98
DEFINE_CONFIG_PARSE_ENUM(config_parse_ipoib_mode, ipoib_mode, IPoIBMode);
×
99

UNCOV
100
int config_parse_ipoib_pkey(
×
101
                const char *unit,
102
                const char *filename,
103
                unsigned line,
104
                const char *section,
105
                unsigned section_line,
106
                const char *lvalue,
107
                int ltype,
108
                const char *rvalue,
109
                void *data,
110
                void *userdata) {
111

112
        uint16_t u, *pkey = ASSERT_PTR(data);
×
UNCOV
113
        int r;
×
114

115
        assert(filename);
×
116
        assert(lvalue);
×
UNCOV
117
        assert(rvalue);
×
118

119
        if (isempty(rvalue)) {
×
120
                *pkey = 0; /* 0 means unset. */
×
UNCOV
121
                return 0;
×
122
        }
123

124
        r = safe_atou16(rvalue, &u);
×
125
        if (r < 0) {
×
UNCOV
126
                log_syntax(unit, LOG_WARNING, filename, line, r,
×
127
                           "Failed to parse IPoIB pkey '%s', ignoring assignment: %m",
128
                           rvalue);
UNCOV
129
                return 0;
×
130
        }
131
        if (IN_SET(u, 0, 0x8000)) {
×
UNCOV
132
                log_syntax(unit, LOG_WARNING, filename, line, 0,
×
133
                           "IPoIB pkey cannot be 0 nor 0x8000, ignoring assignment: %s",
134
                           rvalue);
UNCOV
135
                return 0;
×
136
        }
137

138
        *pkey = u;
×
UNCOV
139
        return 0;
×
140
}
141

142
const NetDevVTable ipoib_vtable = {
143
        .object_size = sizeof(IPoIB),
144
        .sections = NETDEV_COMMON_SECTIONS "IPoIB\0",
145
        .init = netdev_ipoib_init,
146
        .fill_message_create = netdev_ipoib_fill_message_create,
147
        .create_type = NETDEV_CREATE_STACKED,
148
        .iftype = ARPHRD_INFINIBAND,
149
        .generate_mac = true,
150
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc