Skip to contentSkip to conversation

Register only one qbus_reset_all_fn() for system bus

PATCH New Dmitry Eremin-Solenikov 1 participant 1 message Mar 10, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Register only one qbus_reset_all_fn() for system bus

Currently reset handler is registered for System bus twice: once during bus creation and once in vl.c. Remove the second qemu_register_reset() invocation. Also while we are at it, remove incorrect check at qbus_create_inplace(): when system bus is created, main_system_bus is NULL (as it's not yet created, it cannot be set), so the check is just wrong.

---
 hw/qdev.c |    2 +-
 vl.c      |    3 ---
 2 files changed, 1 insertions(+), 4 deletions(-)
hw/qdev.c +1 -1
index 1aa1ea0..0a3c8ce 100644
@@ -762,7 +762,7 @@ void qbus_create_inplace(BusState *bus, BusInfo *info,
     if (parent) {
         QLIST_INSERT_HEAD(&parent->child_bus, bus, sibling);
         parent->num_child_bus++;
-    } else if (bus != main_system_bus) {
+    } else {
         /* 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);
vl.c +0 -3
index 91be92e..24923db 100644
@@ -3120,9 +3120,6 @@ int main(int argc, char **argv, char **envp)
         exit(1);
     }
 
-    /* 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_run_machine_init_done_notifiers();
 
     qemu_system_reset();
Signature · 1 line
1.7.2.3