On Fri, May 11, 2018 at 05:09:17PM +0200, Michal Privoznik wrote:
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 <mprivozn(a)redhat.com>
---
docs/formatdomain.html.in | 34 +++++++++++++++++++++++--
docs/schemas/cputypes.rng | 5 ++++
docs/schemas/domaincommon.rng | 10 ++++++++
src/conf/domain_conf.c | 36 ++++++++++++++++++++++++++-
src/conf/domain_conf.h | 3 +++
src/conf/numa_conf.c | 27 ++++++++++++++++++++
src/conf/numa_conf.h | 3 +++
src/libvirt_private.syms | 1 +
tests/qemuxml2argvdata/hugepages-pages.xml | 3 ++-
tests/qemuxml2argvdata/hugepages-pages3.xml | 4 +--
tests/qemuxml2argvdata/hugepages-pages7.xml | 4 +--
tests/qemuxml2xmloutdata/hugepages-pages.xml | 3 ++-
tests/qemuxml2xmloutdata/hugepages-pages3.xml | 4 +--
13 files changed, 126 insertions(+), 11 deletions(-)
diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
index 9307dd93d3..bf42946a99 100644
--- a/src/conf/numa_conf.c
+++ b/src/conf/numa_conf.c
@@ -77,6 +77,7 @@ struct _virDomainNuma {
virBitmapPtr nodeset; /* host memory nodes where this guest node resides */
virDomainNumatuneMemMode mode; /* memory mode selection */
virDomainMemoryAccess memAccess; /* shared memory access configuration */
+ int discard; /* discard-data for memory-backend-file, virTristateBool */
s/int/virTristateBool/
struct _virDomainNumaDistance {
unsigned int value; /* locality value for node i->j or j->i */
@@ -967,6 +980,7 @@ virDomainNumaDefCPUFormatXML(virBufferPtr buf,
virDomainNumaPtr def)
{
virDomainMemoryAccess memAccess;
+ int discard;
here too.
char *cpustr;
size_t ncells = virDomainNumaGetNodeCount(def);
size_t i;
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano