]> git.proxmox.com Git - qemu.git/commit - memory.c
memory: separate building the final memory map into two steps
authorAvi Kivity <avi@redhat.com>
Tue, 26 Jul 2011 11:26:12 +0000 (14:26 +0300)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 29 Jul 2011 13:25:43 +0000 (08:25 -0500)
commitb8af1afbfbc157e058f27ab5382527350b814ee7
treeabf9eed361bff11531e4ad2b6adca04f08849ee6
parent3e9d69e737025e987be3ce804f667ffeb07e4c53
memory: separate building the final memory map into two steps

Instead of adding and deleting regions in one pass, do a delete
pass followed by an add pass.  This fixes the following case:

from:
  0x0000-0x0fff ram  (a1)
  0x1000-0x1fff mmio (a2)
  0x2000-0x2fff ram  (a3)

to:
  0x0000-0x2fff ram  (b1)

The single pass algorithm removed a1, added b2, then removed a2 and a3,
which caused the wrong memory map to be built.  The two pass algorithm
removes a1, a2, and a3, then adds b1.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
memory.c