aboutsummaryrefslogtreecommitdiff
path: root/hw/sparc
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-04-14 12:52:59 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2022-05-12 12:29:44 +0200
commit26f88d84dab62e6eb3ec72737ccb155d06049e3a (patch)
tree70632d593ea0e08255ee8ba9db5a0fec3efc7f22 /hw/sparc
parentce9d03fb3f7a87f46a1a2fc3597f2f44541a0c9c (diff)
machine: make memory-backend a link property
Handle HostMemoryBackend creation and setting of ms->ram entirely in machine_run_board_init. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20220414165300.555321-5-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/sparc')
-rw-r--r--hw/sparc/sun4m.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 9d57491f68..d9288326d6 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -831,8 +831,7 @@ static void sun4m_hw_init(MachineState *machine)
SysBusDevice *s;
unsigned int smp_cpus = machine->smp.cpus;
unsigned int max_cpus = machine->smp.max_cpus;
- Object *ram_memdev = object_resolve_path_type(machine->ram_memdev_id,
- TYPE_MEMORY_BACKEND, NULL);
+ HostMemoryBackend *ram_memdev = machine->memdev;
NICInfo *nd = &nd_table[0];
if (machine->ram_size > hwdef->max_mem) {
@@ -852,7 +851,7 @@ static void sun4m_hw_init(MachineState *machine)
/* Create and map RAM frontend */
dev = qdev_new("memory");
- object_property_set_link(OBJECT(dev), "memdev", ram_memdev, &error_fatal);
+ object_property_set_link(OBJECT(dev), "memdev", OBJECT(ram_memdev), &error_fatal);
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0);