From: Michael Tremer Date: Fri, 19 Nov 2010 12:29:17 +0000 (+0100) Subject: Add VMWare hypervisor detection. X-Git-Tag: v0.2~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=284eedb7553173fd5e0e65c2fb083ae1bc6577b9;p=oddments%2Ffireinfo.git Add VMWare hypervisor detection. Source: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1009458 --- diff --git a/fireinfo/__init__.py b/fireinfo/__init__.py index 7ac7f27..d74f897 100644 --- a/fireinfo/__init__.py +++ b/fireinfo/__init__.py @@ -1,3 +1,3 @@ #!/usr/bin/python -# Empty module so far... +from system import System diff --git a/src/fireinfo.c b/src/fireinfo.c index c9c5700..850bbab 100644 --- a/src/fireinfo.c +++ b/src/fireinfo.c @@ -51,13 +51,15 @@ enum { HYPER_NONE = 0, HYPER_XEN, HYPER_KVM, - HYPER_MSHV + HYPER_MSHV, + HYPER_VMWARE }; const char *hv_vendors[] = { [HYPER_NONE] = NULL, [HYPER_XEN] = "Xen", [HYPER_KVM] = "KVM", - [HYPER_MSHV] = "Microsoft" + [HYPER_MSHV] = "Microsoft", + [HYPER_VMWARE] = "VMWare" }; /* CPU modes (bits) */ @@ -355,6 +357,8 @@ read_hypervisor_cpuid(struct lscpu_desc *desc) desc->hyper = HYPER_KVM; else if (!strncmp("Microsoft Hv", hyper_vendor_id, 12)) desc->hyper = HYPER_MSHV; + else if (!strncmp("VMwareVMware", hyper_vendor_id, 12)) + desc->hyper = HYPER_VMWARE; } #else /* ! __x86_64__ */