diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-09-07 13:42:47 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-09-07 13:42:47 +0200 |
commit | 75f86906c52735c98dc0aa7e24b773edb42ee814 (patch) | |
tree | d2d0701f8df51d5a09586073ebd387bb831743e7 /src/core/swap.c | |
parent | 47f5a38cdf98a220d6a0d4eb11a710a0a42ae5c4 (diff) |
basic: rework virtualization detection API
Introduce a proper enum, and don't pass around string ids anymore. This
simplifies things quite a bit, and makes virtualization detection more
similar to architecture detection.
Diffstat (limited to 'src/core/swap.c')
-rw-r--r-- | src/core/swap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/swap.c b/src/core/swap.c index 4f3ddc9f04..2f462e339d 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -215,7 +215,7 @@ static int swap_add_default_dependencies(Swap *s) { if (UNIT(s)->manager->running_as != MANAGER_SYSTEM) return 0; - if (detect_container(NULL) > 0) + if (detect_container() > 0) return 0; return unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true); @@ -824,7 +824,7 @@ static int swap_start(Unit *u) { assert(s->state == SWAP_DEAD || s->state == SWAP_FAILED); - if (detect_container(NULL) > 0) + if (detect_container() > 0) return -EPERM; /* If there's a job for another swap unit for the same node @@ -857,7 +857,7 @@ static int swap_stop(Unit *u) { s->state == SWAP_ACTIVATING_DONE || s->state == SWAP_ACTIVE); - if (detect_container(NULL) > 0) + if (detect_container() > 0) return -EPERM; swap_enter_deactivating(s); @@ -1404,7 +1404,7 @@ static bool swap_supported(void) { if (supported < 0) supported = access("/proc/swaps", F_OK) >= 0 && - detect_container(NULL) <= 0; + detect_container() <= 0; return supported; } |