New upstream version 18.02
[deb_dpdk.git] / lib / librte_eal / common / eal_common_hypervisor.c
diff --git a/lib/librte_eal/common/eal_common_hypervisor.c b/lib/librte_eal/common/eal_common_hypervisor.c
new file mode 100644 (file)
index 0000000..c3b4c62
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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";
+       }
+}