From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56796 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtoFb-0004TK-Ut for qemu-devel@nongnu.org; Thu, 09 Sep 2010 17:01:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OtoFa-0006k3-Oi for qemu-devel@nongnu.org; Thu, 09 Sep 2010 17:01:43 -0400 Received: from verein.lst.de ([213.95.11.210]:39215) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OtoFa-0006jt-Eq for qemu-devel@nongnu.org; Thu, 09 Sep 2010 17:01:42 -0400 Date: Thu, 9 Sep 2010 23:01:37 +0200 From: Christoph Hellwig Subject: Re: [Qemu-devel] [RFC] qed: Add QEMU Enhanced Disk format Message-ID: <20100909210137.GA30588@lst.de> References: <4C874812.9090807@redhat.com> <395D4377-00F9-4765-94C4-470BDFA1F96E@suse.de> <4C874F22.6060802@redhat.com> <20100908153857.GA30438@lst.de> <4C87BA12.5040909@codemonkey.ws> <20100908202336.GA7855@lst.de> <4C87F202.5000602@codemonkey.ws> <20100909023550.GA19336@lst.de> <4C887D9A.3020702@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C887D9A.3020702@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Kevin Wolf , Stefan Hajnoczi , Stefan Hajnoczi , qemu-devel@nongnu.org, Alexander Graf , Christoph Hellwig On Thu, Sep 09, 2010 at 09:24:26AM +0300, Avi Kivity wrote: > The other thing we can do is defragment the logical image, then > defragment the underlying file (if the filesystem supports it, issue the > appropriate ioctl, otherwise defragment to a new file which you write > linearly). What's what the defragmentation code does in a slightly optimized fashion anyway - so if you want to do it from qemu just do it that way. Don't even bother calling the filesystem ioctls directly given that they just implementa low-level helpers and the actual logic is in the userspace side of the defragmentation tools.