
Am 2018-02-12 um 13:40 schrieb Idan Shaby:
On Mon, Feb 12, 2018 at 1:55 PM, Matthias Leopold <matthias.leopold@meduniwien.ac.at <mailto:matthias.leopold@meduniwien.ac.at>> wrote:
Hi Idan,
thanks for your answer. But i'm still confused, because i thought that the content of /sys/block/dm-X/queue/discard* in the VM OS should depend on the setting of the "discard=(unmap|ignore)" setting in the qemu-kvm command. Unexpectedly it's the same in both cases (it's >0, saying discard is 'on'). I was then trying to inquire about the TRIM/UNMAP capability of block devices in the VM with "sdparm -p lbp /dev/sdx", but i always get "Logical block provisioning (SBC) mode subpage failed".
The file /sys/block/dm-X/queue/discard_max_bytes in sysfs tells you whether your underlying storage supports discard. The flag discard=unmap of the VM in qemu means that qemu will not throw away the UNMAP commands comming from the guest OS (by default it does throw them away). From what I know, the file in sysfs and the VM flag are not related.
Thank you, i will now finally accept it ;-) Just for the records: This is where i got my info from: https://chrisirwin.ca/posts/discard-with-kvm/ Matthias