From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0e6Q-0004uy-Tt for qemu-devel@nongnu.org; Tue, 07 Jan 2014 16:22:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0e6M-0002T5-4N for qemu-devel@nongnu.org; Tue, 07 Jan 2014 16:22:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0e6L-0002Su-Ql for qemu-devel@nongnu.org; Tue, 07 Jan 2014 16:22:18 -0500 Date: Tue, 7 Jan 2014 21:22:10 +0000 From: "Richard W.M. Jones" Message-ID: <20140107212210.GB4802@redhat.com> References: <20140102161503.GA14565@redhat.com> <52CC13D6.6000607@redhat.com> <20140107202708.GB1273@redhat.com> <52CC6811.4000107@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52CC6811.4000107@redhat.com> Subject: Re: [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Teng-Feng Yang , qemu-devel@nongnu.org On Tue, Jan 07, 2014 at 09:48:17PM +0100, Paolo Bonzini wrote: > Il 07/01/2014 21:27, Richard W.M. Jones ha scritto: > > Not much more what I said in the original email (especially see the > > attached script which you can download from the bottom of this page: > > https://lists.gnu.org/archive/html/qemu-devel/2014-01/msg00084.html ) > > > > Basically it tries to dd /dev/zero into the virtio-scsi device exposed > > by qemu, then calls sg_unmap (there are two devices, it only unmaps > > the first so we can hopefully see the difference), but it doesn't seem > > to have any effect on the underlying file. The underlying file is a > > regular raw-format file on ext4. > > > > I called sg_readcap/sg_vpd and we seem to have all the right > > capability bits exposed. > > > > This script won't work with regular libguestfs. I compiled a special > > appliance that had the sg tools included. > > Try again with the pull request of > http://permalink.gmane.org/gmane.comp.emulators.qemu/248421 No difference from before, as far as I can see. Here is the output of sparsetest.sh: 0 /tmp/test1 0 /tmp/test2 Read Capacity results: Protection: prot_en=0, p_type=0, p_i_exponent=0 Logical block provisioning: lbpme=1, lbprz=0 Last logical block address=204799 (0x31fff), Number of logical blocks=204800 Logical block length=512 bytes Logical blocks per physical block exponent=0 Lowest aligned logical block address=0 Hence: Device size: 104857600 bytes, 100.0 MiB, 0.10 GB Block limits VPD page (SBC): Write same no zero (WSNZ): 1 Maximum compare and write length: 0 blocks Optimal transfer length granularity: 0 blocks Maximum transfer length: 0 blocks Optimal transfer length: 0 blocks Maximum prefetch length: 0 blocks Maximum unmap LBA count: 2097152 Maximum unmap block descriptor count: 255 Optimal unmap granularity: 8 Unmap granularity alignment valid: 0 Unmap granularity alignment: 0 Maximum write same length: 0x0 blocks 16M /tmp/test1 <--- note both file disk 16M /tmp/test2 <--- usages are the same Those are raw files on ext4. I'll try qcow2 and follow up. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v