qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 4/7] block-vpc: Fix support for images > 4 GB


From: Kevin Wolf
Subject: [Qemu-devel] [PATCH 4/7] block-vpc: Fix support for images > 4 GB
Date: Mon, 26 Jan 2009 17:59:25 +0100

This patch fixes the truncation of sector offsets to 32 bits.

Signed-off-by: Kevin Wolf <address@hidden>
---
 block-vpc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/block-vpc.c b/block-vpc.c
index 3c92bb3..51644e6 100644
--- a/block-vpc.c
+++ b/block-vpc.c
@@ -207,7 +207,7 @@ static inline int seek_to_sector(BlockDriverState *bs, 
int64_t sector_num)
     if (pagetable_index > s->max_table_entries || 
s->pagetable[pagetable_index] == 0xffffffff)
        return -1; // not allocated
 
-    bitmap_offset = 512 * s->pagetable[pagetable_index];
+    bitmap_offset = 512 * (uint64_t) s->pagetable[pagetable_index];
     block_offset = bitmap_offset + 512 + (512 * pageentry_index);
 
 //    printf("sector: %" PRIx64 ", index: %x, offset: %x, bioff: %" PRIx64 ", 
bloff: %" PRIx64 "\n",
-- 
1.6.0.2





reply via email to

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