qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] block: write checksum back to footer after check


From: Zhang Shengju
Subject: [Qemu-devel] [PATCH] block: write checksum back to footer after check
Date: Tue, 13 Mar 2012 22:38:13 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

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 <address@hidden>
---
 block/vpc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/block/vpc.c b/block/vpc.c
index 6b4816f..12aecd4 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.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]