macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" devices
commit3d81f594fdcd6c2737a52dcb19552a298f2af9e1
authorMarkus Armbruster <armbru@redhat.com>
Tue, 9 Jun 2020 12:23:24 +0000 (9 14:23 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 15 Jun 2020 19:36:21 +0000 (15 21:36 +0200)
treeb8ad5d95a3bd29c0e057de1932b9ba03e3dd04e6
parent5e769ecf509089c053bb247ae48a360ef8e87d66
macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" devices

cuda_init() creates a "mos6522-cuda" device, but it's never realized.
Affects machines mac99 with via=cuda (default) and g3beige.

pmu_init() creates a "mos6522-pmu" device, but it's never realized.
Affects machine mac99 with via=pmu and via=pmu-adb,

In theory, a device becomes real only on realize.  In practice, the
transition from unreal to real is a fuzzy one.  The work to make a
device real can be spread between realize methods (fine),
instance_init methods (wrong), and board code wiring up the device
(fine as long as it effectively happens on realize).  Depending on
what exactly is done where, a device can work even when we neglect
to realize it.

These two appear to work.  Nevertheless, it's a clear misuse of the
interface.  Even when it works today (more or less by chance), it can
break tomorrow.

Fix by realizing them in cuda_realize() and pmu_realize(),
respectively.

Fixes: 6dca62a0000f95e0b7020aa00d0ca9b2c421f341
Cc: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200609122339.937862-10-armbru@redhat.com>
hw/misc/macio/cuda.c
hw/misc/macio/pmu.c