From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFpeR-0002kf-02 for qemu-devel@nongnu.org; Thu, 05 Apr 2012 12:35:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SFpeM-0002Ih-0Q for qemu-devel@nongnu.org; Thu, 05 Apr 2012 12:35:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46984) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFpeL-0002Gg-OT for qemu-devel@nongnu.org; Thu, 05 Apr 2012 12:35:05 -0400 From: Kevin Wolf Date: Thu, 5 Apr 2012 17:51:49 +0200 Message-Id: <1333641144-13612-12-git-send-email-kwolf@redhat.com> In-Reply-To: <1333641144-13612-1-git-send-email-kwolf@redhat.com> References: <1333641144-13612-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 11/46] block/vpc: write checksum back to footer after check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Zhang Shengju After validation check, the 'checksum' is not written back to footer, which leave it with zero. This results in errors while loadding it under Microsoft's Hyper-V environment, and also errors from utilities like Citrix's vhd-util. Signed-off-by: Zhang Shengju Signed-off-by: Kevin Wolf --- block/vpc.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index 706faf3..5cd13d1 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -189,6 +189,9 @@ static int vpc_open(BlockDriverState *bs, int flags) fprintf(stderr, "block-vpc: The header checksum of '%s' is " "incorrect.\n", bs->filename); + /* Write 'checksum' back to footer, or else will leave it with zero. */ + footer->checksum = be32_to_cpu(checksum); + // The visible size of a image in Virtual PC depends on the geometry // rather than on the size stored in the footer (the size in the footer // is too large usually) -- 1.7.6.5