summaryrefslogtreecommitdiff
path: root/src/hypervisor_check.adb
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2015-04-06 16:40:03 +0600
committerDaniil Baturin <daniil@baturin.org>2015-04-06 16:40:03 +0600
commit29a9fc9af63a4c897ac718894f8f01bb50a38104 (patch)
tree7f08887e689aecb4ae99a1dd29220e47fded88a1 /src/hypervisor_check.adb
parent74c860906f9ae73f194341feda41436f959521d5 (diff)
downloadhvinfo-29a9fc9af63a4c897ac718894f8f01bb50a38104.tar.gz
hvinfo-29a9fc9af63a4c897ac718894f8f01bb50a38104.zip
Add VirtualBox PCI detection on FreeBSD.
Diffstat (limited to 'src/hypervisor_check.adb')
-rw-r--r--src/hypervisor_check.adb18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/hypervisor_check.adb b/src/hypervisor_check.adb
index 30bccf3..df8391b 100644
--- a/src/hypervisor_check.adb
+++ b/src/hypervisor_check.adb
@@ -191,4 +191,22 @@ package body Hypervisor_Check is
end if;
end Known_DMI_HV_Vendor;
+ function VirtualBox_PCI_Present return Boolean is
+ begin
+ if Config.FreeBSD then
+ if Command_Succeeds ("/sbin/sysctl dev.vgapci | grep vendor=0x80ee") then
+ return True;
+ else
+ return False;
+ end if;
+ elsif Config.Linux then
+ -- Can be done, but on Linux VirtualBox is covered by DMI checks,
+ -- so I cut the corners here
+ -- XXX: maybe it's relevant on some UEFI machines
+ return False;
+ else
+ return False;
+ end if;
+ end;
+
end Hypervisor_Check;