aboutsummaryrefslogtreecommitdiff
path: root/cpus.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2017-11-23 17:23:32 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2017-12-21 09:30:31 +0100
commit80ceb07a83375e3a0091591f96bd47bce2f640ce (patch)
tree98b54a1e8eac1adac80dde4350d0fd2f57334619 /cpus.c
parent7ce32f3005afef1feb6f6cd3a7e4f36a3ff300ab (diff)
cpu: refactor cpu_address_space_init()
Normally we create an address space for that CPU and pass that address space into the function. Let's just do it inside to unify address space creations. It'll simplify my next patch to rename those address spaces. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20171123092333.16085-3-peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'cpus.c')
-rw-r--r--cpus.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/cpus.c b/cpus.c
index 3740c4db62..83700c1716 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1787,11 +1787,8 @@ void qemu_init_vcpu(CPUState *cpu)
/* If the target cpu hasn't set up any address spaces itself,
* give it the default one.
*/
- AddressSpace *as = g_new0(AddressSpace, 1);
-
- address_space_init(as, cpu->memory, "cpu-memory");
cpu->num_ases = 1;
- cpu_address_space_init(cpu, as, 0);
+ cpu_address_space_init(cpu, 0, "cpu-memory", cpu->memory);
}
if (kvm_enabled()) {