From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S75NT-0003oG-TR for qemu-devel@nongnu.org; Mon, 12 Mar 2012 09:33:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S75NO-0006wd-LL for qemu-devel@nongnu.org; Mon, 12 Mar 2012 09:33:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S75NO-0006w8-DW for qemu-devel@nongnu.org; Mon, 12 Mar 2012 09:33:26 -0400 Message-ID: <4F5DFBF2.5050001@redhat.com> Date: Mon, 12 Mar 2012 14:36:50 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1331112179-12726-1-git-send-email-wdongxu@linux.vnet.ibm.com> <4F5DF6BE.7020707@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/4] block: add image fragmentation statistics to qemu-img List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Dong Xu Wang , qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com Am 12.03.2012 14:26, schrieb Stefan Hajnoczi: > On Mon, Mar 12, 2012 at 1:14 PM, Kevin Wolf wrote: >> Am 12.03.2012 14:07, schrieb Stefan Hajnoczi: >>> On Wed, Mar 7, 2012 at 9:22 AM, Dong Xu Wang wrote: >>>> @@ -1126,6 +1127,14 @@ static int img_info(int argc, char **argv) >>>> printf("cluster_size: %d\n", bdi.cluster_size); >>>> } >>>> } >>>> + if (bdrv_get_fragment(bs, &bfi) >= 0) { >>> >>> I think we need a separate sub-command for fragmentation info: >>> >>> qemu-img fraginfo >>> >>> Utilities that invoke qemu-img info want it to be fast. Reading all >>> metadata from a large image can take several seconds. Since many >>> qemu-img info users don't need to see the fragmentation information, >>> it makes sense to put it in a new sub-command. >> >> Yes. If we wanted to merge it into an existing qemu-img subcommand, I >> think check would be the one, as it scans the whole image already today >> and fragmentation is something that could be added fairly easily. > > In that case we might not even need a separate interface/struct. This > would just be part of check. > > Does that sound good? Sure, that would be the only way to take advantage of the scan that bdrv_check already performs. Kevin