From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzk35-0001OV-Pq for qemu-devel@nongnu.org; Thu, 18 Jul 2013 04:58:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uzk34-00043W-1e for qemu-devel@nongnu.org; Thu, 18 Jul 2013 04:58:55 -0400 Received: from mail-wg0-x232.google.com ([2a00:1450:400c:c00::232]:59684) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzk0Q-0003Wt-DS for qemu-devel@nongnu.org; Thu, 18 Jul 2013 04:56:10 -0400 Received: by mail-wg0-f50.google.com with SMTP id k14so2672927wgh.5 for ; Thu, 18 Jul 2013 01:56:09 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51E7AD9D.9000906@redhat.com> Date: Thu, 18 Jul 2013 10:55:57 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1373992168-26043-1-git-send-email-pbonzini@redhat.com> <1373992168-26043-13-git-send-email-pbonzini@redhat.com> <20130718072537.GJ29052@T430s.nay.redhat.com> In-Reply-To: <20130718072537.GJ29052@T430s.nay.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 12/17] qemu-img: add a "map" subcommand List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: famz@redhat.com Cc: pl@kamp.de, qemu-devel@nongnu.org, stefanha@redhat.com Il 18/07/2013 09:25, Fam Zheng ha scritto: >> > + /* Probe up to 1 G at a time. */ >> > + sector_num = (curr.start + curr.length) >> BDRV_SECTOR_BITS; >> > + nsectors_left = DIV_ROUND_UP(length, BDRV_SECTOR_SIZE) - sector_num; >> > + n = MAX(1 << (30 - BDRV_SECTOR_BITS), nsectors_left); >> > + ret = get_block_status(bs, sector_num, &n, &depth); > Am I misunderstanding here, n is at least 1G, but in your comment it's > up to 1 G at a time? > You're right, it should be MIN. Paolo