From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1dIu-0004i8-SZ for qemu-devel@nongnu.org; Wed, 15 Aug 2012 09:06:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1dIt-00030U-IS for qemu-devel@nongnu.org; Wed, 15 Aug 2012 09:06:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3681) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1dIt-00030L-9x for qemu-devel@nongnu.org; Wed, 15 Aug 2012 09:06:31 -0400 Message-ID: <502B9ED1.6080609@redhat.com> Date: Wed, 15 Aug 2012 15:06:25 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <5027FD32.1010609@wiesinger.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] TRIM, UNMAP and QCOW2 release of block information - Thin provisioning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Gerhard Wiesinger , Paolo Bonzini , qemu-devel@nongnu.org Am 13.08.2012 10:31, schrieb Stefan Hajnoczi: > On Sun, Aug 12, 2012 at 8:00 PM, Gerhard Wiesinger wrote: >> As far as I saw QEMU/KVM supports the trim command on IDE/SATA devices and >> the UNMAP command on SCSI devices/disks (thanks Paolo Bonzini). Will the >> qcow2 format (or other formats) use this information and also release the >> blocks for thin provisioning to save disk space on filesystems? >> >> VirtualBox also has such a feature in the new beta version: >> http://www.fb-developers.info/blog/2012/virtualbox-v4-2-is-coming/ > > This has recently been discussed, please search the list for more info > from Kevin Wolf or Paolo Bonzini. > > qcow2 marks the discarded blocks as free and will reuse them in future > allocations. It does *not* discard at the OS level. > > For raw files you can get discard to work on an xfs host file system. > In the future ext4 support can also be added. The problem with it is that passing discards through to the file system, or even handling them at all isn't always wanted. It is already a slow operation for itself, but it also makes the next write access slower and can cause fragmentation. So you'd really want some more options to configure it, and I believe to achieve what we want, changes are not only required to qemu, but to both host and guest kernel. Paolo is looking into this. Btw, the more interesting news for me in the VBox link you posted is that they seem to have implemented QED, qcow1, and read-only qcow2. Kevin