From 75f86906c52735c98dc0aa7e24b773edb42ee814 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 7 Sep 2015 13:42:47 +0200 Subject: 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. --- src/core/swap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/swap.c') 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; } -- cgit v1.2.3-54-g00ecf