aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kvm-all.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kvm-all.c b/kvm-all.c
index f4851c0..3b6b5ed 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -290,7 +290,7 @@ void kvm_physical_sync_dirty_bitmap(target_phys_addr_t start_addr,
return;
}
- alloc_size = mem->memory_size >> TARGET_PAGE_BITS / sizeof(d.dirty_bitmap);
+ alloc_size = ((mem->memory_size >> TARGET_PAGE_BITS) + 7) / 8;
d.dirty_bitmap = qemu_mallocz(alloc_size);
d.slot = mem->slot;