Commit 378e2aea1b2ad216158cf172f7f218fe041f7b1f

Authored by aliguori
1 parent 52819664

block-vpc: Fix support for images > 4 GB (Kevin Wolf)

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

Signed-off-by: Kevin Wolf <kwolf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6464 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 1 additions and 1 deletions
block-vpc.c
... ... @@ -256,7 +256,7 @@ static inline int64_t get_sector_offset(BlockDriverState *bs,
256 256 if (pagetable_index >= s->max_table_entries || s->pagetable[pagetable_index] == 0xffffffff)
257 257 return -1; // not allocated
258 258  
259   - bitmap_offset = 512 * s->pagetable[pagetable_index];
  259 + bitmap_offset = 512 * (uint64_t) s->pagetable[pagetable_index];
260 260 block_offset = bitmap_offset + s->bitmap_size + (512 * pageentry_index);
261 261  
262 262 // We must ensure that we don't write to any sectors which are marked as
... ...