From 095b9cf45ad85dffff2e40752e74392484dfbcab Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Wed, 30 Jan 2019 16:40:41 +0000 Subject: [PATCH 1/2] virt: detect the ACRN hypervisor Add magic string and enumeration for the ACRN hypervisor (https://projectacrn.org). --- src/basic/virt.c | 3 +++ src/basic/virt.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/basic/virt.c b/src/basic/virt.c index c7376bf5e45..0717347b35e 100644 --- a/src/basic/virt.c +++ b/src/basic/virt.c @@ -40,6 +40,8 @@ static int detect_vm_cpuid(void) { /* https://wiki.freebsd.org/bhyve */ { "bhyve bhyve ", VIRTUALIZATION_BHYVE }, { "QNXQVMBSQG", VIRTUALIZATION_QNX }, + /* https://projectacrn.org */ + { "ACRNACRNACRN", VIRTUALIZATION_ACRN }, }; uint32_t eax, ebx, ecx, edx; @@ -628,6 +630,7 @@ static const char *const virtualization_table[_VIRTUALIZATION_MAX] = { [VIRTUALIZATION_PARALLELS] = "parallels", [VIRTUALIZATION_BHYVE] = "bhyve", [VIRTUALIZATION_QNX] = "qnx", + [VIRTUALIZATION_ACRN] = "acrn", [VIRTUALIZATION_VM_OTHER] = "vm-other", [VIRTUALIZATION_SYSTEMD_NSPAWN] = "systemd-nspawn", diff --git a/src/basic/virt.h b/src/basic/virt.h index c4cf4bfeabc..03cf1752f47 100644 --- a/src/basic/virt.h +++ b/src/basic/virt.h @@ -21,6 +21,7 @@ enum { VIRTUALIZATION_PARALLELS, VIRTUALIZATION_BHYVE, VIRTUALIZATION_QNX, + VIRTUALIZATION_ACRN, VIRTUALIZATION_VM_OTHER, VIRTUALIZATION_VM_LAST = VIRTUALIZATION_VM_OTHER, From 0f0e30ad9cc8be1140fc43436c71549c2eafeac9 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Thu, 28 Feb 2019 15:36:50 +0000 Subject: [PATCH 2/2] man: add ACRN hypervisor --- man/systemd-detect-virt.xml | 5 +++++ man/systemd.unit.xml | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/man/systemd-detect-virt.xml b/man/systemd-detect-virt.xml index e4c2d9fd5fd..5c5510eaf23 100644 --- a/man/systemd-detect-virt.xml +++ b/man/systemd-detect-virt.xml @@ -125,6 +125,11 @@ QNX hypervisor + + acrn + ACRN hypervisor + + Container openvz diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index f21f9eae443..82c63e1609d 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -1093,7 +1093,8 @@ lxc-libvirt, systemd-nspawn, docker, - rkt to test + rkt, + acrn to test against a specific implementation, or private-users to check whether we are running in a user namespace. See systemd-detect-virt1