mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
qemu: add memfd source type
Add a new memoryBacking source type "memfd", supported by QEMU (when the capability is available). A memfd is a specialized anonymous memory kind. As such, an anonymous source type could be automatically using a memfd. However, there are some complications when migrating from different memory backends in qemu (mainly due to the internal object naming at this point, but there could be more). For now, it is simpler and safer to simply introduce a new source type "memfd". Eventually, the "anonymous" type could learn to use memfd transparently in a separate change. The main benefits are that it doesn't need to create filesystem files, and it also enforces sealing, providing a bit more safety. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
committed by
Michal Privoznik
parent
a6fd5b596a
commit
24b74d187c
@@ -1126,7 +1126,7 @@
|
||||
</hugepages>
|
||||
<nosharepages/>
|
||||
<locked/>
|
||||
<source type="file|anonymous"/>
|
||||
<source type="file|anonymous|memfd"/>
|
||||
<access mode="shared|private"/>
|
||||
<allocation mode="immediate|ondemand"/>
|
||||
<discard/>
|
||||
@@ -1177,9 +1177,10 @@
|
||||
suitable for the specific environment at the same time to mitigate
|
||||
the risks described above. <span class="since">Since 1.0.6</span></dd>
|
||||
<dt><code>source</code></dt>
|
||||
<dd>Using the <code>type</code> attribute, it's possible to provide
|
||||
"file" to utilize file memorybacking or keep the default
|
||||
"anonymous".</dd>
|
||||
<dd>Using the <code>type</code> attribute, it's possible to
|
||||
provide "file" to utilize file memorybacking or keep the
|
||||
default "anonymous". <span class="since">Since 4.10.0</span>,
|
||||
you may choose "memfd" backing. (QEMU/KVM only)</dd>
|
||||
<dt><code>access</code></dt>
|
||||
<dd>Using the <code>mode</code> attribute, specify if the memory is
|
||||
to be "shared" or "private". This can be overridden per numa node by
|
||||
|
||||
@@ -655,6 +655,7 @@
|
||||
<choice>
|
||||
<value>file</value>
|
||||
<value>anonymous</value>
|
||||
<value>memfd</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</element>
|
||||
|
||||
Reference in New Issue
Block a user