numam-dpdk/lib/librte_eal/common/eal_common_hypervisor.c
Thomas Monjalon 8f40ee0734 eal/x86: get hypervisor name
The CPUID instruction is caught by hypervisor which can return
a flag indicating one is running, and its name.

Suggested-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2018-01-12 00:39:14 +01:00

23 lines
417 B
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright 2017 Mellanox Technologies, Ltd.
*/
#include "rte_hypervisor.h"
const char *
rte_hypervisor_get_name(enum rte_hypervisor id)
{
switch (id) {
case RTE_HYPERVISOR_NONE:
return "none";
case RTE_HYPERVISOR_KVM:
return "KVM";
case RTE_HYPERVISOR_HYPERV:
return "Hyper-V";
case RTE_HYPERVISOR_VMWARE:
return "VMware";
default:
return "unknown";
}
}