Right, but I just wanted to emphasize that disabling "Enable Discard" for that disk will cause qemu to ignore these UNMAP commands and not pass it on to the underlying storage.
So if you've got this flag disabled, there's no reason to use fstrim. It makes sense to use it only when enabling "Discard enabled".


Regards,
Idan

On Sun, Jun 18, 2017 at 11:13 AM, Fabrice Bacchella <fabrice.bacchella@orange.fr> wrote:

> Le 18 juin 2017 à 08:00, Idan Shaby <ishaby@redhat.com> a écrit :
> If you don't need live discarding, shutdown the VM and disable the "Enable Discard" option. That will cause qemu to ignore the live UNMAP SCSI commands coming from the guest and not pass it on to the underlying storage.
> Note that this makes fstrim completely redundant, as the purpose of the command is to discard unused blocks under the given path.

Redundant ? Useless you mean ? From my comprehension, the purpose to fstrim is to send UNMAP SCSI on batch instead of mount -o discard that send them synchronously.