mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-14 07:31:30 +00:00
conf: domcaps: Report <memoryBacking>
We need to report via domcapabilities if specifying shared memory is supported without hugepages or numa config in order to find out if domain has suitable setup to make virtiofs work. The solution is to report source types of memory backing to determine if memfd is a valid option. Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
439eaf6399
commit
e27e22585a
@ -290,6 +290,34 @@
|
||||
<domainCapabilities>
|
||||
</pre>
|
||||
|
||||
<h3><a id="elementsMemoryBacking">Memory Backing</a></h3>
|
||||
|
||||
<p>
|
||||
The <code>memory backing</code> element indicates whether or not
|
||||
<a href="formatdomain.html#memory-backing">memory backing</a>
|
||||
is supported.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<domainCapabilities>
|
||||
...
|
||||
<memoryBacking supported='yes'>
|
||||
<enum name='sourceType'>
|
||||
<value>anonymous</value>
|
||||
<value>file</value>
|
||||
<value>memfd</value>
|
||||
</enum>
|
||||
</memoryBacking>
|
||||
...
|
||||
<domainCapabilities>
|
||||
</pre>
|
||||
|
||||
<dl>
|
||||
<dt><code>sourceType</code></dt>
|
||||
<dd>Options for the <code>type</code> attribute of the
|
||||
<memoryBacking><source> element.</dd>
|
||||
</dl>
|
||||
|
||||
<h3><a id="elementsDevices">Devices</a></h3>
|
||||
|
||||
<p>
|
||||
|
@ -37,6 +37,9 @@
|
||||
<optional>
|
||||
<ref name="cpu"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="memoryBacking"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="devices"/>
|
||||
</optional>
|
||||
@ -165,6 +168,13 @@
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name="memoryBacking">
|
||||
<element name="memoryBacking">
|
||||
<ref name="supported"/>
|
||||
<ref name="enum"/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name="devices">
|
||||
<element name="devices">
|
||||
<optional>
|
||||
|
@ -457,6 +457,18 @@ virDomainCapsCPUFormat(virBuffer *buf,
|
||||
virBufferAddLit(buf, "</cpu>\n");
|
||||
}
|
||||
|
||||
static void
|
||||
virDomainCapsMemoryBackingFormat(virBuffer *buf,
|
||||
const virDomainCapsMemoryBacking *memoryBacking)
|
||||
{
|
||||
FORMAT_PROLOGUE(memoryBacking);
|
||||
|
||||
ENUM_PROCESS(memoryBacking, sourceType, virDomainMemorySourceTypeToString);
|
||||
|
||||
FORMAT_EPILOGUE(memoryBacking);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
virDomainCapsDeviceDiskFormat(virBuffer *buf,
|
||||
const virDomainCapsDeviceDisk *disk)
|
||||
@ -632,6 +644,8 @@ virDomainCapsFormat(const virDomainCaps *caps)
|
||||
virDomainCapsOSFormat(&buf, &caps->os);
|
||||
virDomainCapsCPUFormat(&buf, &caps->cpu);
|
||||
|
||||
virDomainCapsMemoryBackingFormat(&buf, &caps->memoryBacking);
|
||||
|
||||
virBufferAddLit(&buf, "<devices>\n");
|
||||
virBufferAdjustIndent(&buf, 2);
|
||||
|
||||
|
@ -62,6 +62,13 @@ struct _virDomainCapsOS {
|
||||
virDomainCapsLoader loader; /* Info about virDomainLoaderDef */
|
||||
};
|
||||
|
||||
STATIC_ASSERT_ENUM(VIR_DOMAIN_MEMORY_SOURCE_LAST);
|
||||
typedef struct _virDomainCapsMemoryBacking virDomainCapsMemoryBacking;
|
||||
struct _virDomainCapsMemoryBacking {
|
||||
virTristateBool supported;
|
||||
virDomainCapsEnum sourceType; /* virDomainMemorySource */
|
||||
};
|
||||
|
||||
STATIC_ASSERT_ENUM(VIR_DOMAIN_DISK_DEVICE_LAST);
|
||||
STATIC_ASSERT_ENUM(VIR_DOMAIN_DISK_BUS_LAST);
|
||||
STATIC_ASSERT_ENUM(VIR_DOMAIN_DISK_MODEL_LAST);
|
||||
@ -196,6 +203,7 @@ struct _virDomainCaps {
|
||||
|
||||
virDomainCapsOS os;
|
||||
virDomainCapsCPU cpu;
|
||||
virDomainCapsMemoryBacking memoryBacking;
|
||||
virDomainCapsDeviceDisk disk;
|
||||
virDomainCapsDeviceGraphics graphics;
|
||||
virDomainCapsDeviceVideo video;
|
||||
|
Loading…
x
Reference in New Issue
Block a user