From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7qxD-0001ee-Ku for qemu-devel@nongnu.org; Mon, 27 Jan 2014 13:30:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7qx5-000713-7w for qemu-devel@nongnu.org; Mon, 27 Jan 2014 13:30:39 -0500 Received: from mx.ipv6.kamp.de ([2a02:248:0:51::16]:50483 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7qx4-0006y6-ME for qemu-devel@nongnu.org; Mon, 27 Jan 2014 13:30:31 -0500 Message-ID: <52E6A5BA.5030608@kamp.de> Date: Mon, 27 Jan 2014 19:30:18 +0100 From: Peter Lieven MIME-Version: 1.0 References: <1389612246-9545-1-git-send-email-pl@kamp.de> <20140127153725.GB23974@stefanha-thinkpad.redhat.com> In-Reply-To: <20140127153725.GB23974@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: Stefan Hajnoczi Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org Am 27.01.2014 16:37, schrieb Stefan Hajnoczi: > 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 will send a respin. Peter