4 This file is part of systemd.
6 Copyright 2011 Lennart Poettering
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
27 VIRTUALIZATION_NONE = 0,
29 VIRTUALIZATION_VM_FIRST,
30 VIRTUALIZATION_KVM = VIRTUALIZATION_VM_FIRST,
35 VIRTUALIZATION_VMWARE,
36 VIRTUALIZATION_ORACLE,
37 VIRTUALIZATION_MICROSOFT,
39 VIRTUALIZATION_PARALLELS,
41 VIRTUALIZATION_VM_OTHER,
42 VIRTUALIZATION_VM_LAST = VIRTUALIZATION_VM_OTHER,
44 VIRTUALIZATION_CONTAINER_FIRST,
45 VIRTUALIZATION_SYSTEMD_NSPAWN = VIRTUALIZATION_CONTAINER_FIRST,
46 VIRTUALIZATION_LXC_LIBVIRT,
48 VIRTUALIZATION_OPENVZ,
49 VIRTUALIZATION_DOCKER,
51 VIRTUALIZATION_CONTAINER_OTHER,
52 VIRTUALIZATION_CONTAINER_LAST = VIRTUALIZATION_CONTAINER_OTHER,
55 _VIRTUALIZATION_INVALID = -1
58 #if 0 /// UNNEEDED by elogind
59 static inline bool VIRTUALIZATION_IS_VM(int x) {
60 return x >= VIRTUALIZATION_VM_FIRST && x <= VIRTUALIZATION_VM_LAST;
63 static inline bool VIRTUALIZATION_IS_CONTAINER(int x) {
64 return x >= VIRTUALIZATION_CONTAINER_FIRST && x <= VIRTUALIZATION_CONTAINER_LAST;
69 int detect_container(void);
70 #if 0 /// UNNEEDED by elogind
71 int detect_virtualization(void);
73 int running_in_userns(void);
75 int running_in_chroot(void);
77 const char *virtualization_to_string(int v) _const_;
78 int virtualization_from_string(const char *s) _pure_;