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

systemd / systemd / 16280725298

14 Jul 2025 08:16PM UTC coverage: 72.166% (-0.006%) from 72.172%
16280725298

push

github

web-flow
Two fixlets for coverage test (#38183)

302135 of 418667 relevant lines covered (72.17%)

773261.64 hits per line

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

39.13
/src/shared/machine-pool.c
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2

3
#include <linux/magic.h>
4

5
#include "sd-bus.h"
6

7
#include "btrfs-util.h"
8
#include "label-util.h"
9
#include "log.h"
10
#include "machine-pool.h"
11
#include "stat-util.h"
12

13
static int check_btrfs(void) {
9✔
14
        struct statfs sfs;
9✔
15

16
        if (statfs("/var/lib/machines", &sfs) < 0) {
9✔
17
                if (errno != ENOENT)
×
18
                        return -errno;
×
19

20
                if (statfs("/var/lib", &sfs) < 0)
×
21
                        return -errno;
×
22
        }
23

24
        return F_TYPE_EQUAL(sfs.f_type, BTRFS_SUPER_MAGIC);
9✔
25
}
26

27
int setup_machine_directory(sd_bus_error *error, bool use_btrfs_subvol, bool use_btrfs_quota) {
9✔
28
        int r;
9✔
29

30
        r = check_btrfs();
9✔
31
        if (r < 0)
9✔
32
                return sd_bus_error_set_errnof(error, r, "Failed to determine whether /var/lib/machines is located on btrfs: %m");
×
33
        if (r == 0)
9✔
34
                return 0;
35

36
        if (!use_btrfs_subvol)
×
37
                return 0;
38

39
        (void) btrfs_subvol_make_label("/var/lib/machines");
×
40

41
        if (!use_btrfs_quota)
×
42
                return 0;
43

44
        r = btrfs_quota_enable("/var/lib/machines", true);
×
45
        if (r < 0)
×
46
                log_warning_errno(r, "Failed to enable quota for /var/lib/machines, ignoring: %m");
×
47

48
        r = btrfs_subvol_auto_qgroup("/var/lib/machines", 0, true);
×
49
        if (r < 0)
×
50
                log_warning_errno(r, "Failed to set up default quota hierarchy for /var/lib/machines, ignoring: %m");
×
51

52
        return 0;
53
}
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