From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0Xxp-00069j-8a for qemu-devel@nongnu.org; Tue, 07 Jan 2014 09:49:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0Xxj-00011Y-4U for qemu-devel@nongnu.org; Tue, 07 Jan 2014 09:49:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0Xxi-00011Q-Sj for qemu-devel@nongnu.org; Tue, 07 Jan 2014 09:48:59 -0500 Message-ID: <52CC13D6.6000607@redhat.com> Date: Tue, 07 Jan 2014 15:48:54 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20140102161503.GA14565@redhat.com> In-Reply-To: <20140102161503.GA14565@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Richard W.M. Jones" Cc: Teng-Feng Yang , qemu-devel@nongnu.org Il 02/01/2014 17:15, Richard W.M. Jones ha scritto: > > My (possibly weak) understanding of the upstream qemu code is that > unmap/discard/trim is not supported in qcow2. It is only supported in > raw files when using a POSIX-like host OS which has either of: > > - block devices supporting BLKDISCARDZEROES > - files on XFS > - files on other filesystems that support FALLOC_FL_PUNCH_HOLE (eg ext4) It doesn't have to support BLKDISCARDZEROES, only BLKDISCARD. I test it with scsi_debug using both lbprz=0 and lbprz=1 (which becomes BLKDISCARDZEROES unset and set respectively). Otherwise this is correct. > Having said that, I did some tests using libguestfs and I could not > show that unmap was working, either using raw or qcow2 (both on ext4), > with virtio-scsi, and recent kernel & qemu. I did not see any errors, > but also I don't see what I'm doing wrong. Can you share more? Paolo