On 11/07/2018 15:29, Stefan Hajnoczi wrote: >> if (dev->hotplugged) { >> device_reset(dev); >> + >> + if (hotplug_ctrl) { > In the final patch I will move this out of if (dev->hotplugged) since > the other HotplugHandler callbacks are also invoked unconditionally.
I'm not even sure why the reset is needed (removing it would also fix the bug!), and why it's only done on hotplug; however, it is probably there because it updates some bus-level state, so it's dangerous to remove it. Paolo >> + hotplug_handler_post_plug(hotplug_ctrl, dev, &local_err); >> + if (local_err != NULL) { >> + goto child_realize_fail; >> + } >> + } >> } >> dev->pending_deleted_event = false;