From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W86CA-0006OT-Sc for qemu-devel@nongnu.org; Tue, 28 Jan 2014 05:47:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W86C2-0006tr-GF for qemu-devel@nongnu.org; Tue, 28 Jan 2014 05:47:06 -0500 Received: from mail-qc0-x22f.google.com ([2607:f8b0:400d:c01::22f]:55891) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W86C2-0006tB-CN for qemu-devel@nongnu.org; Tue, 28 Jan 2014 05:46:58 -0500 Received: by mail-qc0-f175.google.com with SMTP id x13so245572qcv.34 for ; Tue, 28 Jan 2014 02:46:57 -0800 (PST) Sender: Paolo Bonzini Message-ID: <52E78A9C.2010903@redhat.com> Date: Tue, 28 Jan 2014 11:46:52 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <42130e08.kqhkiG.143d8676094@gmail.com> In-Reply-To: <42130e08.kqhkiG.143d8676094@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] check trim/unmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: ching , qemu-devel@nongnu.org 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: 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