hostmem-file: Add "discard-data" option
commit11ae6ed8affdd131e735bac39b21e7d3cde66f7b
authorEduardo Habkost <ehabkost@redhat.com>
Thu, 24 Aug 2017 19:23:15 +0000 (24 16:23 -0300)
committerEduardo Habkost <ehabkost@redhat.com>
Tue, 19 Sep 2017 12:09:23 +0000 (19 09:09 -0300)
tree8d566e05954e76f90df30bf1d1f3ee38de7509bb
parent0f81d3353029d26c6f8731a65d8052c532b1ced6
hostmem-file: Add "discard-data" option

The new option can be used to indicate that the file contents can
be destroyed and don't need to be flushed to disk when QEMU exits
or when the memory backend object is removed.

Internally, it will trigger a madvise(MADV_REMOVE) call when the
memory backend is removed.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20170824192315.5897-4-ehabkost@redhat.com>
[ehabkost: fixup: improved documentation]
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Tested-by: Zack Cornelius <zack.cornelius@kove.net>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
backends/hostmem-file.c
qemu-options.hx