Re: [RFC PATCH 14/30] [RFC] qemu: block: Always set discard for storage nodes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 19.04.2018 um 17:25 hat Peter Krempa geschrieben:
> According to my research it seems that qemu always sets discard for the
> storage nodes. Replicate this in our generator.
> ---
>  src/qemu/qemu_block.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
> index 44662a4603..0357d93384 100644
> --- a/src/qemu/qemu_block.c
> +++ b/src/qemu/qemu_block.c
> @@ -1155,7 +1155,10 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src,
>          if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, fileprops) < 0)
>              goto cleanup;
> 
> -        if (virJSONValueObjectAdd(fileprops, "b:read-only", src->readonly, NULL) < 0)
> +        if (virJSONValueObjectAdd(fileprops,
> +                                  "b:read-only", src->readonly,
> +                                  "s:discard", "unmap",
> +                                  NULL) < 0)
>              goto cleanup;
>      }

Looks correct to me. The QEMU default means that discard requests made
by the guest are ignored (already at the format level), but discard
requests made by a format driver to the protocol layer are honoured
(e.g. qcow2 discarding data when an internal snapshot is deleted).

Kevin

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux