Patchwork [RFC,1/9] make qbus_reset_all public

login
register
mail settings
Submitter Paolo Bonzini
Date June 6, 2011, 4:26 p.m.
Message ID <1307377620-7538-2-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/98991/
State New
Headers show

Comments

Paolo Bonzini - June 6, 2011, 4:26 p.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/qdev.c |    7 +++----
 hw/qdev.h |    2 +-
 vl.c      |    2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)

Patch

diff --git a/hw/qdev.c b/hw/qdev.c
index 9519f5d..ccfe68d 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -344,9 +344,8 @@  void qdev_reset_all(DeviceState *dev)
     qdev_walk_children(dev, qdev_reset_one, qbus_reset_one, NULL);
 }
 
-void qbus_reset_all_fn(void *opaque)
+void qbus_reset_all(BusState *bus)
 {
-    BusState *bus = opaque;
     qbus_walk_children(bus, qdev_reset_one, qbus_reset_one, NULL);
 }
 
@@ -766,7 +765,7 @@  void qbus_create_inplace(BusState *bus, BusInfo *info,
     } else if (bus != main_system_bus) {
         /* TODO: once all bus devices are qdevified,
            only reset handler for main_system_bus should be registered here. */
-        qemu_register_reset(qbus_reset_all_fn, bus);
+        qemu_register_reset((void (*)(void *))qbus_reset_all, bus);
     }
 }
 
@@ -792,7 +791,7 @@  void qbus_free(BusState *bus)
         bus->parent->num_child_bus--;
     } else {
         assert(bus != main_system_bus); /* main_system_bus is never freed */
-        qemu_unregister_reset(qbus_reset_all_fn, bus);
+        qemu_unregister_reset((void (*)(void *))qbus_reset_all, bus);
     }
     qemu_free((void*)bus->name);
     if (bus->qdev_allocated) {
diff --git a/hw/qdev.h b/hw/qdev.h
index 8a13ec9..0ecd31a 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -200,7 +200,7 @@  int qbus_walk_children(BusState *bus, qdev_walkerfn *devfn,
 int qdev_walk_children(DeviceState *dev, qdev_walkerfn *devfn,
                        qbus_walkerfn *busfn, void *opaque);
 void qdev_reset_all(DeviceState *dev);
-void qbus_reset_all_fn(void *opaque);
+void qbus_reset_all(BusState *bus);
 
 void qbus_free(BusState *bus);
 
diff --git a/vl.c b/vl.c
index b362871..d359917 100644
--- a/vl.c
+++ b/vl.c
@@ -3266,7 +3266,7 @@  int main(int argc, char **argv, char **envp)
 
     /* TODO: once all bus devices are qdevified, this should be done
      * when bus is created by qdev.c */
-    qemu_register_reset(qbus_reset_all_fn, sysbus_get_default());
+    qemu_register_reset((void (*)(void *))qbus_reset_all, sysbus_get_default());
     qemu_run_machine_init_done_notifiers();
 
     qemu_system_reset();