[pve-devel] [PATCH common 4/5] SysFSTools.pm: implement iommu check

Dominik Csapak d.csapak at proxmox.com
Fri Nov 16 16:17:49 CET 2018


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/PVE/SysFSTools.pm | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/PVE/SysFSTools.pm b/src/PVE/SysFSTools.pm
index 660f94b..e4bc328 100644
--- a/src/PVE/SysFSTools.pm
+++ b/src/PVE/SysFSTools.pm
@@ -33,12 +33,8 @@ sub lspci {
 }
 
 sub check_iommu_support{
-    #fixme : need to check IOMMU support
-    #http://www.linux-kvm.org/page/How_to_assign_devices_with_VT-d_in_KVM
-
-    my $iommu=1;
-    return $iommu;
-
+    # iommu support if there is anything in /sys/class/iommu besides . or ..
+    return PVE::Tools::dir_glob_regex('/sys/class/iommu/', "[^\.].*");
 }
 
 sub file_write {
-- 
2.11.0





More information about the pve-devel mailing list