Revision 80376c3f
b/hw/qdev.c | ||
---|---|---|
333 | 333 |
qbus_walk_children(bus, qdev_reset_one, qbus_reset_one, NULL); |
334 | 334 |
} |
335 | 335 |
|
336 |
void qbus_reset_all_fn(void *opaque) |
|
337 |
{ |
|
338 |
BusState *bus = opaque; |
|
339 |
qbus_reset_all(bus); |
|
340 |
} |
|
341 |
|
|
336 | 342 |
/* can be used as ->unplug() callback for the simple cases */ |
337 | 343 |
int qdev_simple_unplug_cb(DeviceState *dev) |
338 | 344 |
{ |
... | ... | |
754 | 760 |
if (parent) { |
755 | 761 |
QLIST_INSERT_HEAD(&parent->child_bus, bus, sibling); |
756 | 762 |
parent->num_child_bus++; |
763 |
} else if (bus != main_system_bus) { |
|
764 |
/* TODO: once all bus devices are qdevified, |
|
765 |
only reset handler for main_system_bus should be registered here. */ |
|
766 |
qemu_register_reset(qbus_reset_all_fn, bus); |
|
757 | 767 |
} |
758 |
|
|
759 | 768 |
} |
760 | 769 |
|
761 | 770 |
BusState *qbus_create(BusInfo *info, DeviceState *parent, const char *name) |
... | ... | |
778 | 787 |
if (bus->parent) { |
779 | 788 |
QLIST_REMOVE(bus, sibling); |
780 | 789 |
bus->parent->num_child_bus--; |
790 |
} else { |
|
791 |
assert(bus != main_system_bus); /* main_system_bus is never freed */ |
|
792 |
qemu_unregister_reset(qbus_reset_all_fn, bus); |
|
781 | 793 |
} |
782 | 794 |
qemu_free((void*)bus->name); |
783 | 795 |
if (bus->qdev_allocated) { |
b/hw/qdev.h | ||
---|---|---|
199 | 199 |
qbus_walkerfn *busfn, void *opaque); |
200 | 200 |
void qdev_reset_all(DeviceState *dev); |
201 | 201 |
void qbus_reset_all(BusState *bus); |
202 |
void qbus_reset_all_fn(void *opaque); |
|
203 |
|
|
202 | 204 |
void qbus_free(BusState *bus); |
203 | 205 |
|
204 | 206 |
#define FROM_QBUS(type, dev) DO_UPCAST(type, qbus, dev) |
b/vl.c | ||
---|---|---|
3088 | 3088 |
exit(1); |
3089 | 3089 |
} |
3090 | 3090 |
|
3091 |
qemu_register_reset((void *)qbus_reset_all, sysbus_get_default()); |
|
3091 |
/* TODO: once all bus devices are qdevified, this should be done |
|
3092 |
* when bus is created by qdev.c */ |
|
3093 |
qemu_register_reset(qbus_reset_all_fn, sysbus_get_default()); |
|
3092 | 3094 |
qemu_run_machine_init_done_notifiers(); |
3093 | 3095 |
|
3094 | 3096 |
qemu_system_reset(); |
Also available in: Unified diff