[libvirt] [PATCH v1 7/7] qemu: Enable memory-backend-file.discard-data whenever possible

Peter Krempa pkrempa at redhat.com
Tue Apr 17 08:05:41 UTC 2018


On Thu, Apr 12, 2018 at 18:39:52 +0200, Michal Privoznik wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1480668
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  src/qemu/qemu_command.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index f864350bd5..67350719aa 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -3148,6 +3148,12 @@ qemuBuildMemoryBackendStr(virJSONValuePtr *backendProps,
>                                    NULL) < 0)
>              goto cleanup;
>  
> +        if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD) &&
> +            virJSONValueObjectAdd(props,
> +                                  "B:discard-data", true,

This code path is used also for NVDIMMs, and since the documentaion for
the option states that:

    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.

I'm not sure whether this is right.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180417/95892bee/attachment-0001.sig>


More information about the libvir-list mailing list