- 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
74 lines
2.4 KiB
Diff
74 lines
2.4 KiB
Diff
From e5bdfe01cb976c45a440b88061a40f65ac6f8be8 Mon Sep 17 00:00:00 2001
|
|
Message-ID: <e5bdfe01cb976c45a440b88061a40f65ac6f8be8.1771423659.git.jdenemar@redhat.com>
|
|
From: Pavel Hrdina <phrdina@redhat.com>
|
|
Date: Sun, 15 Feb 2026 20:10:50 +0100
|
|
Subject: [PATCH] qemu_command: Extract building IOMMUFD props to function
|
|
|
|
This will be reused by hotplug code.
|
|
|
|
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
|
(cherry picked from commit 3f7ad3a8a5f0e453c85f186e811e051ead0f769a)
|
|
|
|
Resolves: https://issues.redhat.com/browse/RHEL-150351
|
|
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
---
|
|
src/qemu/qemu_command.c | 20 ++++++++++++++++----
|
|
src/qemu/qemu_command.h | 3 +++
|
|
2 files changed, 19 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
|
index cca5fed285..521aefbc10 100644
|
|
--- a/src/qemu/qemu_command.c
|
|
+++ b/src/qemu/qemu_command.c
|
|
@@ -5337,6 +5337,21 @@ qemuBuildHostdevCommandLine(virCommand *cmd,
|
|
}
|
|
|
|
|
|
+virJSONValue *
|
|
+qemuBuildIOMMUFDProps(qemuFDPassDirect *iommufd)
|
|
+{
|
|
+ g_autoptr(virJSONValue) props = NULL;
|
|
+
|
|
+ if (qemuMonitorCreateObjectProps(&props, "iommufd",
|
|
+ "iommufd0",
|
|
+ "S:fd", qemuFDPassDirectGetPath(iommufd),
|
|
+ NULL) < 0)
|
|
+ return NULL;
|
|
+
|
|
+ return g_steal_pointer(&props);
|
|
+}
|
|
+
|
|
+
|
|
static int
|
|
qemuBuildIOMMUFDCommandLine(virCommand *cmd,
|
|
const virDomainDef *def,
|
|
@@ -5350,10 +5365,7 @@ qemuBuildIOMMUFDCommandLine(virCommand *cmd,
|
|
|
|
qemuFDPassDirectTransferCommand(priv->iommufd, cmd);
|
|
|
|
- if (qemuMonitorCreateObjectProps(&props, "iommufd",
|
|
- "iommufd0",
|
|
- "S:fd", qemuFDPassDirectGetPath(priv->iommufd),
|
|
- NULL) < 0)
|
|
+ if (!(props = qemuBuildIOMMUFDProps(priv->iommufd)))
|
|
return -1;
|
|
|
|
if (qemuBuildObjectCommandlineFromJSON(cmd, props) < 0)
|
|
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
|
|
index ad068f1f16..028d002ef9 100644
|
|
--- a/src/qemu/qemu_command.h
|
|
+++ b/src/qemu/qemu_command.h
|
|
@@ -190,6 +190,9 @@ int
|
|
qemuBuildRNGBackendProps(virDomainRNGDef *rng,
|
|
virJSONValue **props);
|
|
|
|
+virJSONValue *
|
|
+qemuBuildIOMMUFDProps(qemuFDPassDirect *iommufd);
|
|
+
|
|
/* Current, best practice */
|
|
virJSONValue *
|
|
qemuBuildUSBHostdevDevProps(const virDomainDef *def,
|
|
--
|
|
2.53.0
|