virt: move caching of virtualization check results into detect_vm() and detect_container()

After all, we ended up calling detect_container() more often than
detect_virtualization(), hence the former one should cache the results,
since the latter is only a wrapper around the former.
This commit is contained in:
Lennart Poettering
2013-10-31 16:24:14 +01:00
parent c9197a76ae
commit 0fb533a533
2 changed files with 87 additions and 95 deletions
+1 -1
View File
@@ -114,8 +114,8 @@ static int parse_argv(int argc, char *argv[]) {
int main(int argc, char *argv[]) {
const char *id = NULL;
int r;
int retval = EXIT_SUCCESS;
int r;
/* This is mostly intended to be used for scripts which want
* to detect whether we are being run in a virtualized