From 80376c3fc2c38fdd45354e4b0eb45031f35587ed Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Mon, 20 Dec 2010 14:33:35 +0900 Subject: qbus: register reset handler for qbus whose parent is NULL Stefan Weil reported the regression caused by ec990eb622ad46df5ddcb1e94c418c271894d416 as follows > The second regression also occurs with MIPS malta. > Networking no longer works with the default pcnet nic. > > This is caused because the reset function for pcnet is no > longer called during system boot. The result in an invalid > mac address (all zero) and a non-working nic. > > For this second regression I still have no simple solution. > Of course mips_malta.c should be converted to qdev which > would fix both problems (but only for malta system emulation). The issue is, it is assumed that all qbuses, qdeves are under main_system_bus. But there are qbuses whose parent is NULL. So it is necessary to trigger reset for those qbuses. (On the other hand, if NULL is passed to qdev_create(), its parent bus is main_system_bus.) Ideally those buses should be moved under bus controller device which is qdev. But it's not done yet. So register qbus reset handler for qbus whose parent is NULL. Reported-by: Stefan Weil Signed-off-by: "Michael S. Tsirkin" Signed-off-by: Isaku Yamahata Signed-off-by: Michael S. Tsirkin --- vl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index c4d3fc0d3d..8d6bab4032 100644 --- a/vl.c +++ b/vl.c @@ -3088,7 +3088,9 @@ int main(int argc, char **argv, char **envp) exit(1); } - qemu_register_reset((void *)qbus_reset_all, sysbus_get_default()); + /* 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(); -- cgit v1.2.1