diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng
index 66c5de62e5..52164d5ecb 100644
--- a/docs/schemas/capability.rng
+++ b/docs/schemas/capability.rng
@@ -39,6 +39,9 @@
+
+
+
@@ -155,6 +158,16 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index dd2fc77f91..d5f6f00730 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -1025,6 +1025,9 @@ virCapabilitiesFormatXML(virCapsPtr caps)
virBufferAddLit(&buf, "\n");
}
+ virBufferAsprintf(&buf, "\n",
+ caps->host.iommu ? "yes" : "no");
+
if (caps->host.offlineMigrate) {
virBufferAddLit(&buf, "\n");
virBufferAdjustIndent(&buf, 2);
@@ -1743,3 +1746,10 @@ virCapabilitiesInitCaches(virCapsPtr caps)
virBitmapFree(cpus);
return ret;
}
+
+
+void
+virCapabilitiesHostInitIOMMU(virCapsPtr caps)
+{
+ caps->host.iommu = virHostHasIOMMU();
+}
diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h
index f0a06a24df..fe1b9ea455 100644
--- a/src/conf/capabilities.h
+++ b/src/conf/capabilities.h
@@ -183,6 +183,7 @@ struct _virCapsHost {
int nPagesSize; /* size of pagesSize array */
unsigned int *pagesSize; /* page sizes support on the system */
unsigned char host_uuid[VIR_UUID_BUFLEN];
+ bool iommu;
};
typedef int (*virDomainDefNamespaceParse)(xmlDocPtr, xmlNodePtr,
@@ -327,4 +328,6 @@ void virCapsHostCacheBankFree(virCapsHostCacheBankPtr ptr);
int virCapabilitiesInitCaches(virCapsPtr caps);
+void virCapabilitiesHostInitIOMMU(virCapsPtr caps);
+
#endif /* __VIR_CAPABILITIES_H */
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 9b9970163f..206107befd 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -58,6 +58,7 @@ virCapabilitiesFreeMachines;
virCapabilitiesFreeNUMAInfo;
virCapabilitiesGetCpusForNodemask;
virCapabilitiesGetNodeInfo;
+virCapabilitiesHostInitIOMMU;
virCapabilitiesHostSecModelAddBaseLabel;
virCapabilitiesInitCaches;
virCapabilitiesInitNUMA;
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index b8764eacd8..26969ed3dc 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -948,6 +948,9 @@ virQEMUCapsInit(virFileCachePtr cache)
if (virNodeSuspendGetTargetMask(&caps->host.powerMgmt) < 0)
VIR_WARN("Failed to get host power management capabilities");
+ /* Add IOMMU info */
+ virCapabilitiesHostInitIOMMU(caps);
+
/* Add huge pages info */
if (virCapabilitiesInitPages(caps) < 0)
VIR_WARN("Failed to get pages info");
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index a43b9781eb..89121d4220 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -322,6 +322,8 @@ testBuildCapabilities(virConnectPtr conn)
if (virCapabilitiesAddHostFeature(caps, "nonpae") < 0)
goto error;
+ virCapabilitiesHostInitIOMMU(caps);
+
if (VIR_ALLOC_N(caps->host.pagesSize, 4) < 0)
goto error;
diff --git a/tests/qemucaps2xmldata/all_1.6.0-1.xml b/tests/qemucaps2xmldata/all_1.6.0-1.xml
index 84d60008d8..efe86b9a12 100644
--- a/tests/qemucaps2xmldata/all_1.6.0-1.xml
+++ b/tests/qemucaps2xmldata/all_1.6.0-1.xml
@@ -5,6 +5,7 @@
i686
+
diff --git a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml
index 28762c263b..981344e6fd 100644
--- a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml
+++ b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml
@@ -5,6 +5,7 @@
i686
+
diff --git a/tests/vircaps2xmldata/vircaps-aarch64-basic.xml b/tests/vircaps2xmldata/vircaps-aarch64-basic.xml
index ce156a364e..50466f9162 100644
--- a/tests/vircaps2xmldata/vircaps-aarch64-basic.xml
+++ b/tests/vircaps2xmldata/vircaps-aarch64-basic.xml
@@ -5,6 +5,7 @@
aarch64
+
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-basic.xml b/tests/vircaps2xmldata/vircaps-x86_64-basic.xml
index 1f2c6659a5..e7be6def3e 100644
--- a/tests/vircaps2xmldata/vircaps-x86_64-basic.xml
+++ b/tests/vircaps2xmldata/vircaps-x86_64-basic.xml
@@ -5,6 +5,7 @@
x86_64
+
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-caches.xml b/tests/vircaps2xmldata/vircaps-x86_64-caches.xml
index 0c6f3769a2..ca671a1640 100644
--- a/tests/vircaps2xmldata/vircaps-x86_64-caches.xml
+++ b/tests/vircaps2xmldata/vircaps-x86_64-caches.xml
@@ -5,6 +5,7 @@
x86_64
+
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml
index 443917c62d..1d3df318c5 100644
--- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml
+++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml
@@ -5,6 +5,7 @@
x86_64
+
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx-twocaches.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx-twocaches.xml
index d18665b24f..44c1042afe 100644
--- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx-twocaches.xml
+++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx-twocaches.xml
@@ -5,6 +5,7 @@
x86_64
+
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml
index 0cd25e59a9..8382a26c7a 100644
--- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml
+++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml
@@ -5,6 +5,7 @@
x86_64
+
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml
index 7629259294..4840614e86 100644
--- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml
+++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml
@@ -5,6 +5,7 @@
x86_64
+
|