]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
virt: detect KubeVirt instance
authorFei Li <lifei.shirley@bytedance.com>
Fri, 17 Jun 2022 11:26:28 +0000 (19:26 +0800)
committerLennart Poettering <lennart@poettering.net>
Fri, 29 Jul 2022 09:10:29 +0000 (11:10 +0200)
Kubevirt is currently technically based on KVM (but not xen yet[1]).
The systemd-detect-virt command, used to differentiate the current
virtualization environment, works fine on x86 relying on CPUID, while
fails to get the correct value (none instead of kvm) on aarch64.

Let's fix this by adding a new 'vendor[KubeVirt] = kvm' classification
considering the sys_vendor is always KubeVirt.

[1] https://groups.google.com/g/kubevirt-dev/c/C6cUgzTOsVg

Signed-off-by: Fei Li <lifei.shirley@bytedance.com>
src/basic/virt.c

index 2666f62b6cac4ecfb9d634e5a0c443a26088446a..e5277b4a4bfc7e537d7770dbec60f0f75c039d6f 100644 (file)
@@ -158,6 +158,7 @@ static Virtualization detect_vm_dmi_vendor(void) {
         } dmi_vendor_table[] = {
                 { "KVM",                 VIRTUALIZATION_KVM       },
                 { "OpenStack",           VIRTUALIZATION_KVM       }, /* Detect OpenStack instance as KVM in non x86 architecture */
+                { "KubeVirt",            VIRTUALIZATION_KVM       }, /* Detect KubeVirt instance as KVM in non x86 architecture */
                 { "Amazon EC2",          VIRTUALIZATION_AMAZON    },
                 { "QEMU",                VIRTUALIZATION_QEMU      },
                 { "VMware",              VIRTUALIZATION_VMWARE    }, /* https://kb.vmware.com/s/article/1009458 */