summaryrefslogtreecommitdiff
path: root/src/hypervisor_check.ads
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2019-01-20 17:53:33 +0000
committerDaniil Baturin <daniil@baturin.org>2019-01-20 17:53:33 +0000
commit2f09010ac0f5c38ebc4ef351695fbcbd3599d14d (patch)
tree92fc9539e84d2a87b78677a5e34ac5cbe3ffa2ee /src/hypervisor_check.ads
parent0801a54b6c5d95ce6e18d6bbd525c66b9d7a6bdf (diff)
downloadhvinfo-2f09010ac0f5c38ebc4ef351695fbcbd3599d14d.tar.gz
hvinfo-2f09010ac0f5c38ebc4ef351695fbcbd3599d14d.zip
Add a DMI-based check for QEMU vs KVM.
This enabled KVM detection on non-x86 machines.
Diffstat (limited to 'src/hypervisor_check.ads')
-rw-r--r--src/hypervisor_check.ads4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/hypervisor_check.ads b/src/hypervisor_check.ads
index 3c62f5c..5c561a7 100644
--- a/src/hypervisor_check.ads
+++ b/src/hypervisor_check.ads
@@ -49,6 +49,8 @@ package Hypervisor_Check is
function Get_DMI_Vendor_String return US.Unbounded_String;
+ function Get_DMI_Product_Name return US.Unbounded_String;
+
function Command_Succeeds (Command : String) return Boolean;
function VirtualBox_PCI_Present return Boolean;
@@ -71,6 +73,7 @@ private
-- Linux-specific file names etc.
Linux_Sys_Vendor_File : constant String := "/sys/class/dmi/id/sys_vendor";
+ Linux_Sys_Product_File : constant String := "/sys/class/dmi/id/product_name";
Linux_Sys_HV_Type_File : constant String := "/sys/hypervisor/type";
-- FreeBSD-specific file names, commands etc.
@@ -85,6 +88,7 @@ private
VirtualBox_DMI_Pattern : constant String := "innotek GmbH";
Parallels_DMI_Pattern : constant String := "Parallels";
QEMU_DMI_Pattern : constant String := "QEMU";
+ KVM_DMI_Pattern : constant String := "KVM Virtual Machine";
function CPUID (Arg : Unsigned_32) return CPUID_Registers;