From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0eBC-0000dL-Gt for qemu-devel@nongnu.org; Tue, 07 Jan 2014 16:27:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0eB7-0004Gv-TC for qemu-devel@nongnu.org; Tue, 07 Jan 2014 16:27:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:64280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0eB7-0004Gr-Kd for qemu-devel@nongnu.org; Tue, 07 Jan 2014 16:27:13 -0500 Date: Tue, 7 Jan 2014 21:27:07 +0000 From: "Richard W.M. Jones" Message-ID: <20140107212707.GD4802@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 Using qcow2 format, it also doesn't appear to work: $ /tmp/sparsetest.sh Formatting '/tmp/test1', fmt=qcow2 size=104857600 encryption=off cluster_size=65536 lazy_refcounts=off Formatting '/tmp/test2', fmt=qcow2 size=104857600 encryption=off cluster_size=65536 lazy_refcounts=off 136K /tmp/test1 136K /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 17M /tmp/test1 17M /tmp/test2 $ ll -h /tmp/test{1,2} -rw-r--r--. 1 rjones rjones 17M Jan 7 21:24 /tmp/test1 -rw-r--r--. 1 rjones rjones 17M Jan 7 21:24 /tmp/test2 $ qemu-img info /tmp/test1 image: /tmp/test1 file format: qcow2 virtual size: 100M (104857600 bytes) disk size: 16M cluster_size: 65536 $ qemu-img info /tmp/test2 image: /tmp/test2 file format: qcow2 virtual size: 100M (104857600 bytes) disk size: 16M cluster_size: 65536 ---------------------------------------------------------------------- A frustrating aspect of this is there's no diagnostics or way to probe if UNMAP is supported all the way through. This will be critical for virt-sparsify, since we'd like to be able to tell the user in advance whether or not in-place sparsification is going to work, and even better, why not. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org