memory: use mr->ram_addr in "is this RAM?" assertions
commitec05ec26f940564b1e07bf88857035ec27e21dd8
authorPaolo Bonzini <pbonzini@redhat.com>
Sun, 29 Mar 2015 07:31:43 +0000 (29 09:31 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 5 Jun 2015 15:10:00 +0000 (5 17:10 +0200)
treec9fdeb52da1302c3eec2a3792c5a711c03a76ae5
parent5f2cb94688bd0b2c88e0fc1ac3c4582965b7b106
memory: use mr->ram_addr in "is this RAM?" assertions

mr->terminates alone doesn't guarantee that we are looking at a RAM region.
mr->ram_addr also has to be checked, in order to distinguish RAM and I/O
regions.

So, do the following:

1) add a new define RAM_ADDR_INVALID, and test it in the assertions
instead of mr->terminates

2) IOMMU regions were not setting mr->ram_addr to a bogus value, initialize
it in the instance_init function so that the new assertions would fire
for IOMMU regions as well.

Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
memory.c