diff options
| author | Daniil Baturin <daniil@baturin.org> | 2015-04-04 18:27:44 +0600 |
|---|---|---|
| committer | Daniil Baturin <daniil@baturin.org> | 2015-04-04 18:27:44 +0600 |
| commit | e4a567a9b0fe33fe0bab23d57c5deefbfbbe29bd (patch) | |
| tree | 2514a8ea955748edfd0db68052b99fd6d00f4bac /src/hypervisor_check.ads | |
| parent | 906da6a7baedc302674b59ce70bfe50b44a834df (diff) | |
| download | hvinfo-e4a567a9b0fe33fe0bab23d57c5deefbfbbe29bd.tar.gz hvinfo-e4a567a9b0fe33fe0bab23d57c5deefbfbbe29bd.zip | |
Add support for Xen. Revamp the detection workflow.
Diffstat (limited to 'src/hypervisor_check.ads')
| -rw-r--r-- | src/hypervisor_check.ads | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/hypervisor_check.ads b/src/hypervisor_check.ads index 9571393..b19bf70 100644 --- a/src/hypervisor_check.ads +++ b/src/hypervisor_check.ads @@ -19,16 +19,31 @@ package Hypervisor_Check is function Hypervisor_Present return Boolean; + function Xen_Present return Boolean; + function DMI_Available return Boolean; function Get_DMI_Vendor_Name return US.Unbounded_String; + function Known_DMI_HV_Vendor (Name : US.Unbounded_String) return Boolean; + + -- Vendor names for human consumption + VMWare : constant String := "VMWare"; + Xen_HVM : constant String := "Xen HVM"; + Xen_PV : constant String := "Xen PV"; + KVM : constant String := "KVM"; + HyperV : constant String := "Microsoft Hyper-V"; + VirtualBox : constant String := "VirtualBox"; + Parallels : constant String := "Parallels"; + private Hypervisor_Leaf : constant := 16#40000000#; type CPUID_Registers is array (1 .. 4) of Unsigned_32; + -- Linux-specific file names etc. Linux_Sys_Vendor_File : constant String := "/sys/class/dmi/id/sys_vendor"; + Linux_Sys_HV_Type_File : constant String := "/sys/hypervisor/type"; -- SMBIOS vendor strings VMWare_DMI_Pattern : constant String := "VMware, Inc."; @@ -36,15 +51,6 @@ private VirtualBox_DMI_Pattern : constant String := "innotek GmbH"; Parallels_DMI_Pattern : constant String := "Parallels"; - -- Vendor names for human consumption - VMWare : constant String := "VMWare"; - Xen : constant String := "Xen"; - KVM : constant String := "KVM"; - HyperV : constant String := "Microsoft Hyper-V"; - VirtualBox : constant String := "VirtualBox"; - Parallels : constant String := "Parallels"; - - function CPUID (Arg : Unsigned_32) return CPUID_Registers; function String_of_U32 (Arg : Unsigned_32) return US.Unbounded_String; |
