mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 15:52:55 +00:00
capabilities: Extend capabilities with iommu_support
Signed-off-by: Filip Alac <filipalac@gmail.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
1597e155b2
commit
dc34e78e21
@ -39,6 +39,9 @@
|
|||||||
<optional>
|
<optional>
|
||||||
<ref name='power_management'/>
|
<ref name='power_management'/>
|
||||||
</optional>
|
</optional>
|
||||||
|
<optional>
|
||||||
|
<ref name='iommu_support'/>
|
||||||
|
</optional>
|
||||||
<optional>
|
<optional>
|
||||||
<ref name='migration'/>
|
<ref name='migration'/>
|
||||||
</optional>
|
</optional>
|
||||||
@ -155,6 +158,16 @@
|
|||||||
</element>
|
</element>
|
||||||
</define>
|
</define>
|
||||||
|
|
||||||
|
<define name='iommu_support'>
|
||||||
|
<element name='iommu'>
|
||||||
|
<optional>
|
||||||
|
<attribute name='support'>
|
||||||
|
<ref name='virYesNo'/>
|
||||||
|
</attribute>
|
||||||
|
</optional>
|
||||||
|
</element>
|
||||||
|
</define>
|
||||||
|
|
||||||
<define name='migration'>
|
<define name='migration'>
|
||||||
<element name='migration_features'>
|
<element name='migration_features'>
|
||||||
<optional>
|
<optional>
|
||||||
|
@ -1025,6 +1025,9 @@ virCapabilitiesFormatXML(virCapsPtr caps)
|
|||||||
virBufferAddLit(&buf, "<power_management/>\n");
|
virBufferAddLit(&buf, "<power_management/>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virBufferAsprintf(&buf, "<iommu support='%s'/>\n",
|
||||||
|
caps->host.iommu ? "yes" : "no");
|
||||||
|
|
||||||
if (caps->host.offlineMigrate) {
|
if (caps->host.offlineMigrate) {
|
||||||
virBufferAddLit(&buf, "<migration_features>\n");
|
virBufferAddLit(&buf, "<migration_features>\n");
|
||||||
virBufferAdjustIndent(&buf, 2);
|
virBufferAdjustIndent(&buf, 2);
|
||||||
@ -1743,3 +1746,10 @@ virCapabilitiesInitCaches(virCapsPtr caps)
|
|||||||
virBitmapFree(cpus);
|
virBitmapFree(cpus);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
virCapabilitiesHostInitIOMMU(virCapsPtr caps)
|
||||||
|
{
|
||||||
|
caps->host.iommu = virHostHasIOMMU();
|
||||||
|
}
|
||||||
|
@ -183,6 +183,7 @@ struct _virCapsHost {
|
|||||||
int nPagesSize; /* size of pagesSize array */
|
int nPagesSize; /* size of pagesSize array */
|
||||||
unsigned int *pagesSize; /* page sizes support on the system */
|
unsigned int *pagesSize; /* page sizes support on the system */
|
||||||
unsigned char host_uuid[VIR_UUID_BUFLEN];
|
unsigned char host_uuid[VIR_UUID_BUFLEN];
|
||||||
|
bool iommu;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef int (*virDomainDefNamespaceParse)(xmlDocPtr, xmlNodePtr,
|
typedef int (*virDomainDefNamespaceParse)(xmlDocPtr, xmlNodePtr,
|
||||||
@ -327,4 +328,6 @@ void virCapsHostCacheBankFree(virCapsHostCacheBankPtr ptr);
|
|||||||
|
|
||||||
int virCapabilitiesInitCaches(virCapsPtr caps);
|
int virCapabilitiesInitCaches(virCapsPtr caps);
|
||||||
|
|
||||||
|
void virCapabilitiesHostInitIOMMU(virCapsPtr caps);
|
||||||
|
|
||||||
#endif /* __VIR_CAPABILITIES_H */
|
#endif /* __VIR_CAPABILITIES_H */
|
||||||
|
@ -58,6 +58,7 @@ virCapabilitiesFreeMachines;
|
|||||||
virCapabilitiesFreeNUMAInfo;
|
virCapabilitiesFreeNUMAInfo;
|
||||||
virCapabilitiesGetCpusForNodemask;
|
virCapabilitiesGetCpusForNodemask;
|
||||||
virCapabilitiesGetNodeInfo;
|
virCapabilitiesGetNodeInfo;
|
||||||
|
virCapabilitiesHostInitIOMMU;
|
||||||
virCapabilitiesHostSecModelAddBaseLabel;
|
virCapabilitiesHostSecModelAddBaseLabel;
|
||||||
virCapabilitiesInitCaches;
|
virCapabilitiesInitCaches;
|
||||||
virCapabilitiesInitNUMA;
|
virCapabilitiesInitNUMA;
|
||||||
|
@ -948,6 +948,9 @@ virQEMUCapsInit(virFileCachePtr cache)
|
|||||||
if (virNodeSuspendGetTargetMask(&caps->host.powerMgmt) < 0)
|
if (virNodeSuspendGetTargetMask(&caps->host.powerMgmt) < 0)
|
||||||
VIR_WARN("Failed to get host power management capabilities");
|
VIR_WARN("Failed to get host power management capabilities");
|
||||||
|
|
||||||
|
/* Add IOMMU info */
|
||||||
|
virCapabilitiesHostInitIOMMU(caps);
|
||||||
|
|
||||||
/* Add huge pages info */
|
/* Add huge pages info */
|
||||||
if (virCapabilitiesInitPages(caps) < 0)
|
if (virCapabilitiesInitPages(caps) < 0)
|
||||||
VIR_WARN("Failed to get pages info");
|
VIR_WARN("Failed to get pages info");
|
||||||
|
@ -322,6 +322,8 @@ testBuildCapabilities(virConnectPtr conn)
|
|||||||
if (virCapabilitiesAddHostFeature(caps, "nonpae") < 0)
|
if (virCapabilitiesAddHostFeature(caps, "nonpae") < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
virCapabilitiesHostInitIOMMU(caps);
|
||||||
|
|
||||||
if (VIR_ALLOC_N(caps->host.pagesSize, 4) < 0)
|
if (VIR_ALLOC_N(caps->host.pagesSize, 4) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<arch>i686</arch>
|
<arch>i686</arch>
|
||||||
</cpu>
|
</cpu>
|
||||||
<power_management/>
|
<power_management/>
|
||||||
|
<iommu support='no'/>
|
||||||
</host>
|
</host>
|
||||||
|
|
||||||
<guest>
|
<guest>
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<arch>i686</arch>
|
<arch>i686</arch>
|
||||||
</cpu>
|
</cpu>
|
||||||
<power_management/>
|
<power_management/>
|
||||||
|
<iommu support='no'/>
|
||||||
</host>
|
</host>
|
||||||
|
|
||||||
<guest>
|
<guest>
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<arch>aarch64</arch>
|
<arch>aarch64</arch>
|
||||||
</cpu>
|
</cpu>
|
||||||
<power_management/>
|
<power_management/>
|
||||||
|
<iommu support='no'/>
|
||||||
<migration_features>
|
<migration_features>
|
||||||
</migration_features>
|
</migration_features>
|
||||||
<topology>
|
<topology>
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<arch>x86_64</arch>
|
<arch>x86_64</arch>
|
||||||
</cpu>
|
</cpu>
|
||||||
<power_management/>
|
<power_management/>
|
||||||
|
<iommu support='no'/>
|
||||||
<topology>
|
<topology>
|
||||||
<cells num='4'>
|
<cells num='4'>
|
||||||
<cell id='0'>
|
<cell id='0'>
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<arch>x86_64</arch>
|
<arch>x86_64</arch>
|
||||||
</cpu>
|
</cpu>
|
||||||
<power_management/>
|
<power_management/>
|
||||||
|
<iommu support='no'/>
|
||||||
<migration_features>
|
<migration_features>
|
||||||
<live/>
|
<live/>
|
||||||
</migration_features>
|
</migration_features>
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<arch>x86_64</arch>
|
<arch>x86_64</arch>
|
||||||
</cpu>
|
</cpu>
|
||||||
<power_management/>
|
<power_management/>
|
||||||
|
<iommu support='no'/>
|
||||||
<migration_features>
|
<migration_features>
|
||||||
<live/>
|
<live/>
|
||||||
</migration_features>
|
</migration_features>
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<arch>x86_64</arch>
|
<arch>x86_64</arch>
|
||||||
</cpu>
|
</cpu>
|
||||||
<power_management/>
|
<power_management/>
|
||||||
|
<iommu support='no'/>
|
||||||
<migration_features>
|
<migration_features>
|
||||||
<live/>
|
<live/>
|
||||||
</migration_features>
|
</migration_features>
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<arch>x86_64</arch>
|
<arch>x86_64</arch>
|
||||||
</cpu>
|
</cpu>
|
||||||
<power_management/>
|
<power_management/>
|
||||||
|
<iommu support='no'/>
|
||||||
<migration_features>
|
<migration_features>
|
||||||
<live/>
|
<live/>
|
||||||
</migration_features>
|
</migration_features>
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<arch>x86_64</arch>
|
<arch>x86_64</arch>
|
||||||
</cpu>
|
</cpu>
|
||||||
<power_management/>
|
<power_management/>
|
||||||
|
<iommu support='no'/>
|
||||||
<migration_features>
|
<migration_features>
|
||||||
<live/>
|
<live/>
|
||||||
</migration_features>
|
</migration_features>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user