]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/SysFSTools.pm
SysFSTools: implement IOMMU check
[pve-common.git] / src / PVE / SysFSTools.pm
index 660f94bbeae3ee6176e7eac1cfbe975f72f0041f..e4bc328c568e6345525bd18151079c21c7ae0b64 100644 (file)
@@ -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 {