From: Pavel Hrdina <phrdina@redhat.com> The function qemuDomainNeedsVFIO() was originally used by other parts of qemu code to figure out if the VM needs /dev/vfio/vfio. Later it was also used by code calculating locked memory limit for all architectures, and after that change again and used only for PPC64. Now it needs to be changed again due to IOMMUFD support, the /dev/vfio/vfio device is used by QEMU only if IOMMUFD is not used but for accounting we should most likely still consider any PCI host device. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_domain.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 90d0f02612..4520c3c28d 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8259,7 +8259,10 @@ getPPC64MemLockLimitBytes(virDomainDef *def) passthroughLimit = maxMemory + 128 * (1ULL<<30) / 512 * nPCIHostBridges + 8192; - } else if (qemuDomainNeedsVFIO(def) || virDomainDefHasVDPANet(def)) { + } else if (virDomainDefHasPCIHostdev(def) || + virDomainDefHasMdevHostdev(def) || + virDomainDefHasNVMeDisk(def) || + virDomainDefHasVDPANet(def)) { /* For regular (non-NVLink2 present) VFIO passthrough, the value * of passthroughLimit is: * -- 2.53.0