[pve-devel] [PATCH qemu-server v2 4/5] implement iommu check

Dominik Csapak d.csapak at proxmox.com
Wed Nov 14 10:44:27 CET 2018


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

diff --git a/PVE/QemuServer/PCI.pm b/PVE/QemuServer/PCI.pm
index 4de781e..57d2f5c 100644
--- a/PVE/QemuServer/PCI.pm
+++ b/PVE/QemuServer/PCI.pm
@@ -184,12 +184,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