qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: write checksum back to footer after check
@ 2012-03-13 14:38 Zhang Shengju
  2012-03-13 14:58 ` Kevin Wolf
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Shengju @ 2012-03-13 14:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, yongjun_wei

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 <sean_zhang@trendmicro.com.cn>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] block: write checksum back to footer after check
  2012-03-13 14:38 [Qemu-devel] [PATCH] block: write checksum back to footer after check Zhang Shengju
@ 2012-03-13 14:58 ` Kevin Wolf
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2012-03-13 14:58 UTC (permalink / raw)
  To: Zhang Shengju; +Cc: yongjun_wei, qemu-devel

Am 13.03.2012 15:38, schrieb 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 <sean_zhang@trendmicro.com.cn>

Thanks, applied to the block branch.

Kevin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-13 14:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-13 14:38 [Qemu-devel] [PATCH] block: write checksum back to footer after check Zhang Shengju
2012-03-13 14:58 ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).