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

systemd / systemd / 29790165204

20 Jul 2026 10:30PM UTC coverage: 72.837% (-0.05%) from 72.889%
29790165204

push

github

yuwata
hwdb: classify PlayStation controller audio as controller form-factor

Add Sony PlayStation controller entries to 70-sound-card.hwdb so that their
ALSA sound devices are tagged with SOUND_FORM_FACTOR=controller:
 - DualSense (054c:0ce6)
 - DualSense Edge (054c:0df2)
 - DualShock 4 CUH-ZCT1x (054c:05c4)
 - DualShock 4 CUH-ZCT2x (054c:09cc)

These controllers expose USB audio but are neither headsets nor speakers.
Pinning them in the hwdb ensures they are identified correctly before any
fallback matching occurs.

345467 of 474302 relevant lines covered (72.84%)

1388252.76 hits per line

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

62.5
/src/network/networkctl.c
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2

3
#include "sd-json.h"
4

5
#include "alloc-util.h"
6
#include "build.h"
7
#include "dlopen-note.h"
8
#include "format-table.h"
9
#include "help-util.h"
10
#include "log.h"
11
#include "logs-show.h"
12
#include "main-func.h"
13
#include "networkctl.h"
14
#include "networkctl-address-label.h"
15
#include "networkctl-config-file.h"
16
#include "networkctl-dhcp-lease.h"
17
#include "networkctl-list.h"
18
#include "networkctl-lldp.h"
19
#include "networkctl-misc.h"
20
#include "networkctl-status-link.h"
21
#include "options.h"
22
#include "parse-argument.h"
23
#include "parse-util.h"
24
#include "path-util.h"
25
#include "string-util.h"
26
#include "verbs.h"
27

28
PagerFlags arg_pager_flags = 0;
29
bool arg_legend = true;
30
bool arg_no_reload = false;
31
bool arg_no_reconfigure = false;
32
bool arg_all = false;
33
bool arg_stats = false;
34
bool arg_full = false;
35
bool arg_runtime = false;
36
bool arg_stdin = false;
37
unsigned arg_lines = 10;
38
char *arg_drop_in = NULL;
39
sd_json_format_flags_t arg_json_format_flags = SD_JSON_FORMAT_OFF;
40
bool arg_ask_password = true;
41

42
STATIC_DESTRUCTOR_REGISTER(arg_drop_in, freep);
2,735✔
43

44
VERB_SCOPE(, verb_list_links,                 "list",               "[PATTERN...]",  VERB_ANY, VERB_ANY, VERB_DEFAULT|VERB_ONLINE_ONLY,
45
           "List links");
46
VERB_SCOPE(, verb_link_status,                "status",             "[PATTERN...]",  VERB_ANY, VERB_ANY, VERB_ONLINE_ONLY,
47
           "Show link status");
48
VERB_SCOPE(, verb_dhcp_lease,                 "dhcp-lease",         "INTERFACE [CODE[:FORMAT]...]", 2, VERB_ANY, VERB_ONLINE_ONLY,
49
           "Show DHCP lease");
50
VERB_SCOPE(, verb_link_lldp_status,           "lldp",               "[PATTERN...]",  VERB_ANY, VERB_ANY, 0,
51
           "Show LLDP neighbors");
52
VERB_SCOPE(, verb_list_address_labels,        "label",              NULL,            1,        1,        0,
53
           "Show current address label entries in the kernel");
54
VERB_SCOPE(, verb_link_delete,                "delete",             "DEVICES...",    2,        VERB_ANY, 0,
55
           "Delete virtual netdevs");
56
VERB_SCOPE(, verb_link_varlink_simple_method, "up",                 "DEVICES...",    2,        VERB_ANY, 0,
57
           "Bring devices up");
58
VERB_SCOPE(, verb_link_varlink_simple_method, "down",               "DEVICES...",    2,        VERB_ANY, 0,
59
           "Bring devices down");
60
VERB_SCOPE(, verb_link_varlink_simple_method, "renew",              "DEVICES...",    2,        VERB_ANY, VERB_ONLINE_ONLY,
61
           "Renew dynamic configurations");
62
VERB_SCOPE(, verb_link_varlink_simple_method, "forcerenew",         "DEVICES...",    2,        VERB_ANY, VERB_ONLINE_ONLY,
63
           "Trigger DHCP reconfiguration of all connected clients");
64
VERB_SCOPE(, verb_link_varlink_simple_method, "reconfigure",        "DEVICES...",    2,        VERB_ANY, VERB_ONLINE_ONLY,
65
           "Reconfigure interfaces");
66
VERB_SCOPE(, verb_reload,                     "reload",             NULL,            1,        1,        VERB_ONLINE_ONLY,
67
           "Reload .network and .netdev files");
68
VERB_SCOPE(, verb_edit,                       "edit",               "FILES|DEVICES...",   2,   VERB_ANY, 0,
69
           "Edit network configuration files");
70
VERB_SCOPE(, verb_cat,                        "cat",                "[FILES|DEVICES...]", 1,   VERB_ANY, 0,
71
           "Show network configuration files");
72
VERB_SCOPE(, verb_mask,                       "mask",               "FILES...",      2,        VERB_ANY, 0,
73
           "Mask network configuration files");
74
VERB_SCOPE(, verb_unmask,                     "unmask",             "FILES...",      2,        VERB_ANY, 0,
75
           "Unmask network configuration files");
76
VERB_SCOPE(, verb_persistent_storage,         "persistent-storage", "BOOL",          2,        2,        0,
77
           "Notify systemd-networkd if persistent storage is ready");
78

79
static int help(void) {
×
80
        _cleanup_(table_unrefp) Table *verbs = NULL, *options = NULL;
×
81
        int r;
×
82

83
        r = verbs_get_help_table(&verbs);
×
84
        if (r < 0)
×
85
                return r;
86

87
        r = option_parser_get_help_table(&options);
×
88
        if (r < 0)
×
89
                return r;
90

91
        (void) table_sync_column_widths(0, verbs, options);
×
92

93
        help_cmdline("[OPTIONS...] COMMAND");
×
94
        help_abstract("Query and control the networking subsystem.");
×
95

96
        help_section("Commands");
×
97
        r = table_print_or_warn(verbs);
×
98
        if (r < 0)
×
99
                return r;
100

101
        help_section("Options");
×
102
        r = table_print_or_warn(options);
×
103
        if (r < 0)
×
104
                return r;
105

106
        help_man_page_reference("networkctl", "1");
×
107
        return 0;
108
}
109

110
VERB_COMMON_HELP_HIDDEN(help);
×
111

112
static int parse_argv(int argc, char *argv[], char ***remaining_args) {
2,735✔
113
        int r;
2,735✔
114

115
        assert(argc >= 0);
2,735✔
116
        assert(argv);
2,735✔
117
        assert(remaining_args);
2,735✔
118

119
        OptionParser opts = { argc, argv };
2,735✔
120

121
        FOREACH_OPTION_OR_RETURN(c, &opts)
7,031✔
122
                switch (c) {
1,561✔
123

124
                OPTION_COMMON_HELP:
×
125
                        return help();
×
126

127
                OPTION_COMMON_VERSION:
×
128
                        return version();
×
129

130
                OPTION_COMMON_NO_PAGER:
×
131
                        arg_pager_flags |= PAGER_DISABLE;
×
132
                        break;
×
133

134
                OPTION_COMMON_NO_LEGEND:
1✔
135
                        arg_legend = false;
1✔
136
                        break;
1✔
137

138
                OPTION_COMMON_NO_ASK_PASSWORD:
×
139
                        arg_ask_password = false;
×
140
                        break;
×
141

142
                OPTION('a', "all", NULL, "Show status for all links"):
1✔
143
                        arg_all = true;
1✔
144
                        break;
1✔
145

146
                OPTION('s', "stats", NULL, "Show detailed link statistics"):
1✔
147
                        arg_stats = true;
1✔
148
                        break;
1✔
149

150
                OPTION('l', "full", NULL, "Do not ellipsize output"):
1✔
151
                        arg_full = true;
1✔
152
                        break;
1✔
153

154
                OPTION('n', "lines", "INTEGER", "Number of journal entries to show"):
1,458✔
155
                        r = safe_atou(opts.arg, &arg_lines);
1,458✔
156
                        if (r < 0)
1,458✔
157
                                return log_error_errno(r, "Failed to parse --lines value '%s': %m", opts.arg);
×
158
                        break;
159

160
                OPTION_COMMON_JSON:
87✔
161
                        r = parse_json_argument(opts.arg, &arg_json_format_flags);
87✔
162
                        if (r <= 0)
87✔
163
                                return r;
164
                        break;
165

166
                OPTION_LONG("no-reload", NULL,
×
167
                            "Do not reload systemd-networkd or systemd-udevd after editing network config"):
168
                        arg_no_reload = true;
×
169
                        break;
×
170

171
                OPTION_LONG("no-reconfigure", NULL,
1✔
172
                            "Only reload config files, do not reconfigure network interfaces"):
173
                        arg_no_reconfigure = true;
1✔
174
                        break;
1✔
175

176
                OPTION_LONG("drop-in", "NAME",
3✔
177
                            "Edit specified drop-in instead of main config file"):
178
                        if (isempty(opts.arg))
3✔
179
                                return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Empty drop-in file name.");
×
180

181
                        if (!endswith(opts.arg, ".conf")) {
3✔
182
                                char *conf;
1✔
183

184
                                conf = strjoin(opts.arg, ".conf");
1✔
185
                                if (!conf)
1✔
186
                                        return log_oom();
×
187

188
                                free_and_replace(arg_drop_in, conf);
1✔
189
                        } else {
190
                                r = free_and_strdup(&arg_drop_in, opts.arg);
2✔
191
                                if (r < 0)
2✔
192
                                        return log_oom();
×
193
                        }
194

195
                        if (!filename_is_valid(arg_drop_in))
3✔
196
                                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
×
197
                                                       "Invalid drop-in file name '%s'.", arg_drop_in);
198

199
                        break;
200

201
                OPTION_LONG("runtime", NULL, "Edit runtime config files"):
7✔
202
                        arg_runtime = true;
7✔
203
                        break;
7✔
204

205
                OPTION_LONG("stdin", NULL, "Read new contents of edited file from stdin"):
1✔
206
                        arg_stdin = true;
1✔
207
                        break;
1✔
208
                }
209

210
        *remaining_args = option_parser_get_args(&opts);
2,735✔
211
        return 1;
2,735✔
212
}
213

214
static int run(int argc, char* argv[]) {
2,735✔
215
        char **args = NULL;
2,735✔
216
        int r;
2,735✔
217

218
        COMPRESS_JOURNAL_NOTE;
2,735✔
219
        LIBSELINUX_NOTE(recommended);
2,735✔
220

221
        log_setup();
2,735✔
222

223
        r = parse_argv(argc, argv, &args);
2,735✔
224
        if (r <= 0)
2,735✔
225
                return r;
2,735✔
226

227
        journal_browse_prepare();
2,735✔
228

229
        return dispatch_verb(args, NULL);
2,735✔
230
}
231

232
DEFINE_MAIN_FUNCTION(run);
2,735✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc