]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: detect VMware hypervisor
authorStephen Hemminger <shemminger@vyatta.com>
Thu, 16 Jun 2011 20:54:07 +0000 (16:54 -0400)
committerKarel Zak <kzak@redhat.com>
Mon, 20 Jun 2011 10:53:28 +0000 (12:53 +0200)
Add detection of VMware.
Tested on VMware Workstation 7.1.4

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
sys-utils/lscpu.c

index 0d948835ff05f5454996ac5d1f313916aa4a04ac..8edf99706cc7029e1faee92a1adc41aebef4a10a 100644 (file)
@@ -66,13 +66,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 */
@@ -511,6 +513,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__ */