From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7oFq-000537-AI for qemu-devel@nongnu.org; Mon, 27 Jan 2014 10:37:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7oFj-0007RY-B9 for qemu-devel@nongnu.org; Mon, 27 Jan 2014 10:37:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7oFj-0007RD-2k for qemu-devel@nongnu.org; Mon, 27 Jan 2014 10:37:35 -0500 Date: Mon, 27 Jan 2014 16:37:25 +0100 From: Stefan Hajnoczi Message-ID: <20140127153725.GB23974@stefanha-thinkpad.redhat.com> References: <1389612246-9545-1-git-send-email-pl@kamp.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1389612246-9545-1-git-send-email-pl@kamp.de> Subject: Re: [Qemu-devel] [PATCH] block/vmdk: add basic .bdrv_check support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org On Mon, Jan 13, 2014 at 12:24:06PM +0100, Peter Lieven wrote: > + for (;;) { > + if (sector_num >= total_sectors) { > + return 0; > + } > + extent = find_extent(s, sector_num, extent); > + if (!extent) { > + fprintf(stderr, "ERROR: could not find extend for sector %ld\n", > + sector_num); s/extend/extent/ Please use PRId64 instead of %ld so this works on 32-bit hosts. > + break; > + } > + ret = get_cluster_offset(bs, extent, NULL, sector_num << BDRV_SECTOR_BITS, > + 0, &cluster_offset); > + if (ret == VMDK_ERROR) { > + fprintf(stderr, > + "ERROR: could not get cluster_offset for sector %ld\n", PRId64 > + sector_num); > + break; > + } > + if (ret == VMDK_OK && cluster_offset >= bdrv_getlength(extent->file)) { > + fprintf(stderr, > + "ERROR: cluster offset for sector %ld points after EOF\n", PRId64