Re: [PATCH] hw/display/cg3: Fix crash when introspecting cgthree from the CLI
Markus Armbruster <[email protected]>
| Newsgroups | org.nongnu.qemu-trivial,org.nongnu.qemu-devel |
|---|---|
| Message-ID | <[email protected]> |
Thomas Huth <[email protected]> writes: > From: Thomas Huth <[email protected]> > > QEMU currently crashes when introspecting the cgthree device from the > command line interface: > > $ ./qemu-system-sparc -device cgthree,help > Segmentation fault (core dumped) > > This happens because the memory_region_init_rom() function internally > calls qemu_ram_alloc_internal() that needs the current_machine pointer > to be set up - which is not the case here since the machine has not > been created yet. > > There does not seem to be a compelling reason for initializing the > memory regions from the instance_init function, so let's simply move > the code into the realize() function instead to fix this issue. > > Signed-off-by: Thomas Huth <[email protected]> Tested-by: Markus Armbruster <[email protected]>