The right thing to do is always to use qdev_reset_all (or qbus_reset_all). Call the reset method straight from qdev_reset_one.
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- hw/qdev-core.h | 7 ------- hw/qdev.c | 15 +++++---------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/hw/qdev-core.h b/hw/qdev-core.h index 7c2598e..28f12a4 100644 --- a/hw/qdev-core.h +++ b/hw/qdev-core.h @@ -218,13 +218,6 @@ char *qdev_get_fw_dev_path(DeviceState *dev); */ void qdev_machine_init(void); -/** - * @device_reset - * - * Reset a single device (by calling the reset method). - */ -void device_reset(DeviceState *dev); - const struct VMStateDescription *qdev_get_vmsd(DeviceState *dev); const char *qdev_fw_name(DeviceState *dev); diff --git a/hw/qdev.c b/hw/qdev.c index 833d571..1736d6f 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -211,7 +211,11 @@ void qdev_unplug(DeviceState *dev, Error **errp) static int qdev_reset_one(DeviceState *dev, void *opaque) { - device_reset(dev); + DeviceClass *klass = DEVICE_GET_CLASS(dev); + + if (klass->reset) { + klass->reset(dev); + } return 0; } @@ -750,15 +754,6 @@ static void device_class_init(ObjectClass *class, void *data) class->unparent = qdev_remove_from_bus; } -void device_reset(DeviceState *dev) -{ - DeviceClass *klass = DEVICE_GET_CLASS(dev); - - if (klass->reset) { - klass->reset(dev); - } -} - Object *qdev_get_machine(void) { static Object *dev; -- 1.8.0.2