spapr: Uniform DRC reset paths
commit6caf3ac6131f4981c722a48d57cb4a5af3a18675
authorDavid Gibson <david@gibson.dropbear.id.au>
Thu, 8 Jun 2017 12:18:34 +0000 (8 22:18 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 11 Jul 2017 01:04:01 +0000 (11 11:04 +1000)
tree53cd0b6af8420b13b4e46b0da2a7ccc1f819a62f
parentf8dc29834c6b90ef05ac9463624ad0a680feb379
spapr: Uniform DRC reset paths

DRC objects have a regular device reset method.  However, it only gets
called in the usual way for PCI DRCs.  Because of where CPU and LMB DRCs
are in the QOM tree, their device reset method isn't automatically called.
So, the machine manually registers reset handlers to call device_reset().

This patch removes the device reset method, and instead always explicitly
registers the reset handler from realize().  This means the callers don't
have to worry about the two cases, and we always get proper resets.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
hw/ppc/spapr.c
hw/ppc/spapr_drc.c