memory: Move assignment to ram_block to memory_region_init_*
commit0a75601853c00f3729fa62c49ec0d4bb1e3d9bc1
authorFam Zheng <famz@redhat.com>
Tue, 1 Mar 2016 06:18:19 +0000 (1 14:18 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 7 Mar 2016 12:18:28 +0000 (7 13:18 +0100)
tree9bbc82f3283b969e716970d1403f212fe832bb97
parent528f46af6ecd1e300db18684969104d4067b867b
memory: Move assignment to ram_block to memory_region_init_*

We don't force "const" qualifiers with pointers in QEMU, but it's still
good to keep a clean function interface. Assigning to mr->ram_block is
in this sense ugly - one initializer mutating its owning object's state.

Move it to memory_region_init_*, where mr->ram_addr is assigned.

Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <1456813104-25902-3-git-send-email-famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
exec.c
memory.c