]> git.proxmox.com Git - qemu.git/commitdiff
block-vpc: Fix support for images > 4 GB (Kevin Wolf)
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Tue, 27 Jan 2009 14:29:15 +0000 (14:29 +0000)
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Tue, 27 Jan 2009 14:29:15 +0000 (14:29 +0000)
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

block-vpc.c

index f46ff8cd73c2c7f4a9c46490a0ec45936cfda5b3..3eea506e7cff43b5ebd6577a66a52de837a415cb 100644 (file)
@@ -256,7 +256,7 @@ static inline int64_t get_sector_offset(BlockDriverState *bs,
     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 + s->bitmap_size + (512 * pageentry_index);
 
     // We must ensure that we don't write to any sectors which are marked as