From: Michal Privoznik
Date: Fri, 11 May 2018 13:08:53 +0000 (+0200)
Subject: conf: Introduce memoryBacking/discard
X-Git-Tag: v4.4.0-rc1~205
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2300c92fe0d596258ed2f7da1b867d0ce2112f90;p=thirdparty%2Flibvirt.git
conf: Introduce memoryBacking/discard
QEMU has possibility to call madvise(.., MADV_REMOVE) in some
cases. Expose this feature to users by new element/attribute
discard.
Signed-off-by: Michal Privoznik
Reviewed-by: Ján Tomko
---
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 072f9a0fdc..80172c18d0 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1016,6 +1016,7 @@
<source type="file|anonymous"/>
<access mode="shared|private"/>
<allocation mode="immediate|ondemand"/>
+ <discard/>
</memoryBacking>
...
</domain>
@@ -1070,6 +1071,14 @@
numa node by memAccess
allocation
Specify when allocate the memory
+
discard
+
When set and supported by hypervisor the memory
+ content is discarded just before guest shuts down (or
+ when DIMM module is unplugged). Please note that this is
+ just an optimization and is not guaranteed to work in
+ all cases (e.g. when hypervisor crashes).
+ Since 4.4.0 (QEMU/KVM only)
+
@@ -1608,7 +1617,7 @@
<cpu>
...
<numa>
- <cell id='0' cpus='0-3' memory='512000' unit='KiB'/>
+ <cell id='0' cpus='0-3' memory='512000' unit='KiB' discard='yes'/>
<cell id='1' cpus='4-7' memory='512000' unit='KiB' memAccess='shared'/>
</numa>
...
@@ -1634,6 +1643,13 @@
memAccess can control whether the memory is to be
mapped as "shared" or "private". This is valid only for
hugepages-backed memory and nvdimm modules.
+
+ Each cell element can have an optional
+ discard attribute which fine tunes the discard
+ feature for given numa node as described under
+ Memory Backing.
+ Accepted values are yes and no.
+ Since 4.4.0
+ An optional attribute discard
+ (since 4.4.0) that provides
+ capability to fine tune discard of data on per module
+ basis. Accepted values are yes and
+ no. The feature is described here:
+ Memory Backing.
+ This attribute is allowed only for
+ model='dimm'.
+