- conf: Parse hyperv features even for host-model (RHEL-151688) - qemu: Wire up new hyperv host-model mode behavior (RHEL-151688) - Introduce EXPAND_CPU_FEATURES flag for domain capabilities (RHEL-153653) - qemu: Implement VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES (RHEL-153653) - virsh: Add --expand-cpu-features option for domcapabilities (RHEL-153653) - docs: Clarify host-model description in domain capabilities (RHEL-153653) - qemu: Fix job handling when domain dies in post-copy migration (RHEL-145179) - security_apparmor: Use g_auto* in AppArmorSetSecurityHostdevLabel (RHEL-159902) - security: Cleanup hostdev label error logic (RHEL-159902) - qemu: Fix IOMMUFD and VFIO security labels (RHEL-159902) - viriommufd: Set IOMMU_OPTION_RLIMIT_MODE only when running privileged (RHEL-156803) - conf: Move and rename virStorageSourceFDTuple object (RHEL-156803) - conf: Refactor virHostdevIsPCIDevice (RHEL-156803) - hypervisor: Fix virHostdevNeedsVFIO detection (RHEL-156803) - qemu: Expand call to qemuDomainNeedsVFIO (RHEL-156803) - qemu: Update qemuDomainNeedsVFIO to ignore PCI hostdev with IOMMUFD (RHEL-156803) - src: Use virHostdevIsPCIDeviceWith* to check for IOMMUFD (RHEL-156803) - conf: Introduce domain iommufd element (RHEL-156803) - qemu: Implement iommufd (RHEL-156803) - conf: Add iommufd fdgroup support (RHEL-156803) - qemu: Implement iommufd fdgroup (RHEL-156803) - tests: Add iommufd fdgroup test (RHEL-156803) - hypervisor: Call virWaitForDevices() after detaching host devices (RHEL-156803) - qemuMigrationSrcBeginXML: Don't call 'qemuMigrationSrcBeginPhaseBlockDirtyBitmaps' with offline VM (RHEL-173433) - qemuMigrationSrcBeginPhase: Don't call 'qemuBlockNodesEnsureActive' with offline VM (RHEL-173433) - util: virGetSubIDs: do not limit file size (RHEL-174491) - cpu_conf: Introduce virCPUDefSortFeatures (RHEL-177364) - qemu_capabilities: Split virQEMUCapsFillDomainCPUCaps (RHEL-177364) - qemu: Move domain caps flags handling to virQEMUCapsFillDomainCPUHostModel (RHEL-177364) - qemu_capabilities: Always sort features in host-model CPU (RHEL-177364) - qemu_capabilities: Use g_autoptr in virQEMUCapsInitHostCPUModel (RHEL-177364) - qemu_capabilities: Split conditions in virQEMUCapsInitHostCPUModel (RHEL-177364) - qemu_capabilities: Cache expanded CPU (RHEL-177364) - domaincapstest: Test EXPAND_CPU_FEATURES flag (RHEL-177364) - util: Publish and mock virHostCPUGetMSRFromKVM (RHEL-177364) - cpu_x86: Introduce virCPUx86DataAddMSR (RHEL-177364) - cpu: Introduce virCPUUpdateFeatures (RHEL-177364) - Fix documentation of VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES (RHEL-177364) - Introduce VIR_CONNECT_GET_DOMAIN_CAPABILITIES_SUPPORTED_CPU_FEATURES flag (RHEL-177364) - virsh: Add --supported-cpu-features option for domcapabilities (RHEL-177364) - domaincapstest: Test SUPPORTED_CPU_FEATURES flag (RHEL-177364) - qemu_capabilities: Fix domain capabilities on AMD CPUs (RHEL-177364) - distro: Replace old gating with tmt Resolves: RHEL-145179, RHEL-151688, RHEL-153653, RHEL-156803, RHEL-159902 Resolves: RHEL-173433, RHEL-174491, RHEL-177364
120 lines
4.6 KiB
Diff
120 lines
4.6 KiB
Diff
From e52edf2ed7f3e1e379fb85ae0c0870113912c9d6 Mon Sep 17 00:00:00 2001
|
|
Message-ID: <e52edf2ed7f3e1e379fb85ae0c0870113912c9d6.1780571166.git.jdenemar@redhat.com>
|
|
From: Pavel Hrdina <phrdina@redhat.com>
|
|
Date: Wed, 18 Mar 2026 17:59:01 +0100
|
|
Subject: [PATCH] qemu: Implement iommufd
|
|
|
|
Ideally this should be done in qemuDomainHostdevDefPostParse but that
|
|
would require a lot of refactoring mainly due to how interface backed by
|
|
hostdev works.
|
|
|
|
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
|
(cherry picked from commit fc516031ed865f78d590068424ada19a941046ba)
|
|
|
|
Resolves: https://redhat.atlassian.net/browse/RHEL-156803
|
|
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
---
|
|
src/qemu/qemu_domain.c | 12 +++++++++---
|
|
src/qemu/qemu_domain.h | 3 ++-
|
|
src/qemu/qemu_hotplug.c | 2 +-
|
|
src/qemu/qemu_process.c | 4 ++--
|
|
4 files changed, 14 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
|
index a61939aa15..495cbd4f7d 100644
|
|
--- a/src/qemu/qemu_domain.c
|
|
+++ b/src/qemu/qemu_domain.c
|
|
@@ -10120,10 +10120,12 @@ qemuDomainPrepareHostdevSCSI(virDomainHostdevDef *hostdev,
|
|
|
|
|
|
static int
|
|
-qemuDomainPrepareHostdevPCI(virDomainHostdevDef *hostdev,
|
|
+qemuDomainPrepareHostdevPCI(const virDomainDef *def,
|
|
+ virDomainHostdevDef *hostdev,
|
|
virQEMUCaps *qemuCaps)
|
|
{
|
|
virDeviceHostdevPCIDriverName *driverName = &hostdev->source.subsys.u.pci.driver.name;
|
|
+ virDomainHostdevSubsysPCI *pcisrc = &hostdev->source.subsys.u.pci;
|
|
|
|
/* assign defaults for hostdev passthrough */
|
|
switch (*driverName) {
|
|
@@ -10160,12 +10162,16 @@ qemuDomainPrepareHostdevPCI(virDomainHostdevDef *hostdev,
|
|
return -1;
|
|
}
|
|
|
|
+ if (pcisrc->driver.iommufd == VIR_TRISTATE_BOOL_ABSENT)
|
|
+ pcisrc->driver.iommufd = def->iommufd;
|
|
+
|
|
return 0;
|
|
}
|
|
|
|
|
|
int
|
|
-qemuDomainPrepareHostdev(virDomainHostdevDef *hostdev,
|
|
+qemuDomainPrepareHostdev(const virDomainDef *def,
|
|
+ virDomainHostdevDef *hostdev,
|
|
qemuDomainObjPrivate *priv)
|
|
{
|
|
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
|
|
@@ -10175,7 +10181,7 @@ qemuDomainPrepareHostdev(virDomainHostdevDef *hostdev,
|
|
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
|
|
return qemuDomainPrepareHostdevSCSI(hostdev, priv);
|
|
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
|
- return qemuDomainPrepareHostdevPCI(hostdev, priv->qemuCaps);
|
|
+ return qemuDomainPrepareHostdevPCI(def, hostdev, priv->qemuCaps);
|
|
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
|
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
|
|
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
|
|
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
|
|
index 62c5252b9f..8cd221062c 100644
|
|
--- a/src/qemu/qemu_domain.h
|
|
+++ b/src/qemu/qemu_domain.h
|
|
@@ -1048,7 +1048,8 @@ qemuDomainDiskCachemodeFlags(virDomainDiskCache cachemode,
|
|
bool *noflush);
|
|
|
|
int
|
|
-qemuDomainPrepareHostdev(virDomainHostdevDef *hostdev,
|
|
+qemuDomainPrepareHostdev(const virDomainDef *def,
|
|
+ virDomainHostdevDef *hostdev,
|
|
qemuDomainObjPrivate *priv);
|
|
|
|
char * qemuDomainGetManagedPRSocketPath(qemuDomainObjPrivate *priv);
|
|
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
|
|
index 994cc749f6..25fe699bb3 100644
|
|
--- a/src/qemu/qemu_hotplug.c
|
|
+++ b/src/qemu/qemu_hotplug.c
|
|
@@ -2900,7 +2900,7 @@ qemuDomainAttachHostDevice(virQEMUDriver *driver,
|
|
return -1;
|
|
}
|
|
|
|
- if (qemuDomainPrepareHostdev(hostdev, vm->privateData) < 0)
|
|
+ if (qemuDomainPrepareHostdev(vm->def, hostdev, vm->privateData) < 0)
|
|
return -1;
|
|
|
|
switch (hostdev->source.subsys.type) {
|
|
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
|
index 9b8b378b1f..d13bce8fcf 100644
|
|
--- a/src/qemu/qemu_process.c
|
|
+++ b/src/qemu/qemu_process.c
|
|
@@ -6050,7 +6050,7 @@ qemuProcessPrepareDomainNetwork(virDomainObj *vm)
|
|
/* For hostdev present in qemuProcessPrepareDomain() phase this was
|
|
* done already, but this code runs after that, so we have to call
|
|
* it ourselves. */
|
|
- if (qemuDomainPrepareHostdev(hostdev, priv) < 0)
|
|
+ if (qemuDomainPrepareHostdev(def, hostdev, priv) < 0)
|
|
return -1;
|
|
|
|
virDomainHostdevInsert(def, hostdev);
|
|
@@ -6838,7 +6838,7 @@ qemuProcessPrepareDomainHostdevs(virDomainObj *vm,
|
|
for (i = 0; i < vm->def->nhostdevs; i++) {
|
|
virDomainHostdevDef *hostdev = vm->def->hostdevs[i];
|
|
|
|
- if (qemuDomainPrepareHostdev(hostdev, priv) < 0)
|
|
+ if (qemuDomainPrepareHostdev(vm->def, hostdev, priv) < 0)
|
|
return -1;
|
|
}
|
|
|
|
--
|
|
2.54.0
|