diff options
author | Daniil Baturin <daniil@baturin.org> | 2018-03-30 04:32:52 +0700 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2018-03-30 04:32:52 +0700 |
commit | 661fb50b55d6279d88530ca60b27b9e66426905d (patch) | |
tree | 8c2e257818e9879834a83e6a2b443ede5f6d5c4c /src/hypervisor_check.adb | |
parent | 7499b8e543223306d9fd1a9a925f515ca3f579a8 (diff) | |
download | hvinfo-661fb50b55d6279d88530ca60b27b9e66426905d.tar.gz hvinfo-661fb50b55d6279d88530ca60b27b9e66426905d.zip |
Add a debug option and refactor the checks.
Diffstat (limited to 'src/hypervisor_check.adb')
-rw-r--r-- | src/hypervisor_check.adb | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/hypervisor_check.adb b/src/hypervisor_check.adb index 4d87cb0..076348b 100644 --- a/src/hypervisor_check.adb +++ b/src/hypervisor_check.adb @@ -1,5 +1,5 @@ ------------------------------------------------------------------------ --- Copyright (C) 2015 Daniil Baturin <daniil@baturin.org> +-- Copyright (C) 2018 Daniil Baturin <daniil@baturin.org> -- -- This file is part of hvinfo. -- @@ -186,10 +186,9 @@ package body Hypervisor_Check is return Name; end Get_DMI_Vendor_String; - function Get_DMI_Vendor_Name return US.Unbounded_String is - Vendor_String, Vendor_Name : US.Unbounded_String; + function Get_DMI_Vendor_Name (Vendor_String : US.Unbounded_String) return US.Unbounded_String is + Vendor_Name : US.Unbounded_String; begin - Vendor_String := Get_DMI_Vendor_String; if Contains (Vendor_String, VMWare_DMI_Pattern) then Vendor_Name := US.To_Unbounded_String (VMWare); elsif Contains (Vendor_String, HyperV_DMI_Pattern) then @@ -199,21 +198,12 @@ package body Hypervisor_Check is elsif Contains (Vendor_String, Parallels_DMI_Pattern) then Vendor_Name := US.To_Unbounded_String (Parallels); else - Vendor_Name := US.To_Unbounded_String (""); + Vendor_Name := US.Null_Unbounded_String; end if; + return Vendor_Name; end Get_DMI_Vendor_Name; - function Known_DMI_HV_Vendor (Name : US.Unbounded_String) return Boolean is - use US; - begin - if Name /= US.To_Unbounded_String ("") then - return True; - else - return False; - end if; - end Known_DMI_HV_Vendor; - function VirtualBox_PCI_Present return Boolean is begin if Config.FreeBSD then |