From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=46641 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ou4EO-0001S4-Gp for qemu-devel@nongnu.org; Fri, 10 Sep 2010 10:05:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ou4EM-0001pq-Vi for qemu-devel@nongnu.org; Fri, 10 Sep 2010 10:05:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15003) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ou4EM-0001pj-ML for qemu-devel@nongnu.org; Fri, 10 Sep 2010 10:05:30 -0400 Message-ID: <4C8A3B1C.4040807@redhat.com> Date: Fri, 10 Sep 2010 17:05:16 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [RFC] qed: Add QEMU Enhanced Disk format References: <4C8663C4.1090508@redhat.com> <4C866773.2030103@codemonkey.ws> <4C86BC6B.5010809@codemonkey.ws> <4C874812.9090807@redhat.com> <4C87860A.3060904@codemonkey.ws> <4C888287.8020209@redhat.com> <4C88D7CC.5000806@codemonkey.ws> <4C8A1311.8070903@redhat.com> <4C8A15C4.40201@redhat.com> <20100910134701.GA28831@lst.de> In-Reply-To: <20100910134701.GA28831@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: Kevin Wolf , Stefan Hajnoczi , Stefan Hajnoczi , qemu-devel@nongnu.org On 09/10/2010 04:47 PM, Christoph Hellwig wrote: > On Fri, Sep 10, 2010 at 12:33:09PM +0100, Stefan Hajnoczi wrote: >>> btw, despite being not properly designed, qcow2 is able to support TRIM. >>> ?qed isn't able to, except by leaking clusters on shutdown. ?TRIM support is >>> required unless you're okay with the image growing until it is no longer >>> sparse (the lack of TRIM support in guests make sparse image formats >>> somewhat of a joke, but nobody seems to notice). >> Anthony has started writing up notes on trim for qed: >> http://wiki.qemu.org/Features/QED/Trim >> >> I need to look at the actual ATA and SCSI specs for how this will >> work. The issue I am concerned with is sub-cluster trim operations. >> If the trim region is less than a cluster, then both qed and qcow2 >> don't really have a way to handle it. Perhaps we could punch a hole >> in the file, given a userspace interface to do this, but that isn't >> ideal because we're losing sparseness again. > ATA TRIM doesn't have a granularity, it's always sector sized. SCSI > WRITE SAME with the unmap bit or UNMAP as well as my virtio_blk support > for discarding blocks export topoligy information about the required > minimum discard request size. I export it from qemu the same way as > we export other topology information and at least Linux hosts can use > it. Ok, thanks for the correction. > Note that ATA allows simply ignoring TRIM requests that we can't handle, > and if we don't set the bit that guarantees TRIMed regions to be zeroed > we don't even have to zero out the regions. It would be nice to support it. TRIM is important to recover space, otherwise images grow and grow and there's no point in using a sparse format in the first place. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.