Thanks for the information. Hopefully, there will be better debug/tracing 
facility for this. This is useful for sysadmin to ensure the whole storage 
stack is functioning as expected.

ching


On 28/01/2014 06:46 PM, Paolo Bonzini wrote:
Il 28/01/2014 11:31, ching ha scritto:
My config is Gentoo x64 stable branch, kernel 3.10, libvirt 1.1.3, qemu 1.5, 
lvm2(non-thin) on ssd

How can i check that if:
1. qemu receives trim/unmap from guest
2. qemu is punching hole/issue blkdiscards/writing zeros?

First of all, I suggest that you use current QEMU git.  The trim/unmap feature 
was completed after 1.7 was released.

To use trim/discard, you need to use the discard=on option for QEMU's -drive 
command-line option.  You also need to use cache=none (because of a Linux 
kernel bug, QEMU may disable thin provisioning in other cache modes).

In libvirt, this means adding cache='none and discard='on' like this:

    <driver name='qemu' type='qcow2' cache='none' discard='on'/>

You can check if QEMU is punching a hole into a file using "qemu-img map" on the file.  
You must not run "qemu-img map" while the VM is running though; that can give incorrect 
results.  There is no equivalent for block devices yet.

Paolo


Reply via email to