- qemu: Introduce QEMU_CAPS_OBJECT_IOMMUFD (RHEL-150351) - qemu: Move IOMMUFD validation to qemu_validate (RHEL-150351) - util: Move openning IOMMU device to viriommufd (RHEL-150351) - qemu_process: Refactor qemuProcessOpenIommuFd (RHEL-150351) - util: Move openning VFIO device to virpci (RHEL-150351) - qemu_process: Refactor qemuProcessOpenVfioDeviceFd (RHEL-150351) - util: Use virPCIDevice as argument in virPCIDeviceGetVfioPath (RHEL-150351) - conf: Introduce virHostdevIsPCIDeviceWithIOMMUFD (RHEL-150351) - conf: Introduce virDomainDefHasPCIHostdevWithIOMMUFD (RHEL-150351) - qemu_domain: Add missing IOMMUFD cleanup (RHEL-150351) - qemu_process: Fix FD leak with multiple host devices using IOMMUFD (RHEL-150351) - qemu_process: Refactor qemuProcessOpenVfioFds (RHEL-150351) - qemuxmlconftest: Refactor host device preparation (RHEL-150351) - qemuxmlconftest: Rename and refactor testSetupHostdevPrivateData (RHEL-150351) - qemuxmlconftest: Set fake FD for IOMMUFD (RHEL-150351) - qemu: Convert IOMMUFD to qemuFDPassDirect (RHEL-150351) - qemu: Convert vfioDeviceFd to qemuFDPassDirect (RHEL-150351) - qemu_command: Don't use host property if IOMMUFD is used (RHEL-150351) - qemu: Save IOMMUFD state into status XML (RHEL-150351) - qemu_hotplug: Remove iommufd object if no longer needed (RHEL-150351) - qemu_command: Extract building IOMMUFD props to function (RHEL-150351) - qemu_hotplug: Add support to hotplug host device with IOMMUFD (RHEL-150351) - conf: Introduce iommufd enum for domaincaps (RHEL-148135) - qemu: Fill iommufd domain capability (RHEL-148135) - tests: properly mock VFIO and IOMMU checks (RHEL-148135) - iommufd: fix FD leak in case of error (RHEL-150351) Resolves: RHEL-148135, RHEL-150351
49 lines
1.6 KiB
Diff
49 lines
1.6 KiB
Diff
From e42d8373633488a6d67b6c895953de183b1dd495 Mon Sep 17 00:00:00 2001
|
|
Message-ID: <e42d8373633488a6d67b6c895953de183b1dd495.1771423659.git.jdenemar@redhat.com>
|
|
From: Pavel Hrdina <phrdina@redhat.com>
|
|
Date: Sun, 15 Feb 2026 19:13:19 +0100
|
|
Subject: [PATCH] qemu_process: Fix FD leak with multiple host devices using
|
|
IOMMUFD
|
|
|
|
We would open IOMMU device for each host device with IOMMUFD backend
|
|
leaking FD except for the last one. Since we are adding only single
|
|
iommufd object we need to open it only once.
|
|
|
|
Fixes: 2f0999a161910e3992458902ce90d37f8b8f2642
|
|
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
|
(cherry picked from commit d194f362f342c22731670e365e8a2681759dbc57)
|
|
|
|
Resolves: https://issues.redhat.com/browse/RHEL-150351
|
|
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
---
|
|
src/qemu/qemu_process.c | 10 ++++++----
|
|
1 file changed, 6 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
|
index 3bd81c55b3..da7a9fc11f 100644
|
|
--- a/src/qemu/qemu_process.c
|
|
+++ b/src/qemu/qemu_process.c
|
|
@@ -7736,13 +7736,15 @@ qemuProcessOpenVfioFds(virDomainObj *vm)
|
|
/* Open VFIO device FD */
|
|
if (qemuProcessOpenVfioDeviceFd(hostdev) < 0)
|
|
return -1;
|
|
-
|
|
- /* Open IOMMU FD */
|
|
- if (qemuProcessOpenIommuFd(vm) < 0)
|
|
- return -1;
|
|
}
|
|
}
|
|
|
|
+ /* Open IOMMU FD */
|
|
+ if (virDomainDefHasPCIHostdevWithIOMMUFD(vm->def) &&
|
|
+ qemuProcessOpenIommuFd(vm) < 0) {
|
|
+ return -1;
|
|
+ }
|
|
+
|
|
return 0;
|
|
}
|
|
|
|
--
|
|
2.53.0
|