summaryrefslogtreecommitdiff
path: root/src/hypervisor_check.ads
diff options
context:
space:
mode:
Diffstat (limited to 'src/hypervisor_check.ads')
-rw-r--r--src/hypervisor_check.ads9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/hypervisor_check.ads b/src/hypervisor_check.ads
index b19bf70..ea08d90 100644
--- a/src/hypervisor_check.ads
+++ b/src/hypervisor_check.ads
@@ -1,4 +1,5 @@
with Interfaces; use Interfaces;
+with Interfaces.C;
with System.Machine_Code; use System.Machine_Code;
with Ada.Strings.Unbounded;
with Ada.Text_IO;
@@ -27,6 +28,8 @@ package Hypervisor_Check is
function Known_DMI_HV_Vendor (Name : US.Unbounded_String) return Boolean;
+ function Command_Succeeds (Command : Interfaces.C.Char_Array) return Boolean;
+
-- Vendor names for human consumption
VMWare : constant String := "VMWare";
Xen_HVM : constant String := "Xen HVM";
@@ -45,6 +48,12 @@ private
Linux_Sys_Vendor_File : constant String := "/sys/class/dmi/id/sys_vendor";
Linux_Sys_HV_Type_File : constant String := "/sys/hypervisor/type";
+ -- FreeBSD-specific file names, commands etc.
+
+ -- sysctl read commands are available to unprivileged users, but sysctl binary
+ -- may not be in the $PATH, hence the absolute path
+ FreeBSD_Xen_Present_Command : constant String := "/sbin/sysctl kern.vm_guest | grep xen";
+
-- SMBIOS vendor strings
VMWare_DMI_Pattern : constant String := "VMware, Inc.";
HyperV_DMI_Pattern : constant String := "Microsoft Corporation";