Skip to contentSkip to conversation

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

Qemu-devel Anthony Liguori 1 participant 1 message Jan 27, 2009

lore
Share & tools
lore
#0 lore raw

Revision: 6464

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6464
Author:   aliguori
Date:     2009-01-27 14:29:15 +0000 (Tue, 27 Jan 2009)

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

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

Modified Paths:
--------------
trunk/block-vpc.c

Modified: trunk/block-vpc.c
===================================================================

block-vpc.c +1 -1
@@ -256,7 +256,7 @@
     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