Re: [Qemu-devel] [PATCH 1/2] qdev: add HotplugHandler->post_plug() callback

2018-07-12 Thread Igor Mammedov
On Wed, 11 Jul 2018 18:48:21 +0200 Paolo Bonzini wrote: > On 11/07/2018 17:22, Igor Mammedov wrote: > > It also seems wrong to call _plug handler on maybe partially > > initialized device so perhaps we should first finish devices/children > > realization then do reset and only after that call _pl

Re: [Qemu-devel] [PATCH 1/2] qdev: add HotplugHandler->post_plug() callback

2018-07-11 Thread Paolo Bonzini
On 11/07/2018 17:22, Igor Mammedov wrote: > It also seems wrong to call _plug handler on maybe partially > initialized device so perhaps we should first finish devices/children > realization then do reset and only after that call _plug() handler I agree but this is too dangerous until we look at p

Re: [Qemu-devel] [PATCH 1/2] qdev: add HotplugHandler->post_plug() callback

2018-07-11 Thread Igor Mammedov
On Tue, 10 Jul 2018 16:50:36 +0100 Stefan Hajnoczi wrote: > The ->pre_plug() callback is invoked before the device is realized. The > ->plug() callback is invoked when the device is being realized but > before it is reset. > > This patch adds a ->post_plug() callback which is invoked after th

Re: [Qemu-devel] [PATCH 1/2] qdev: add HotplugHandler->post_plug() callback

2018-07-11 Thread Igor Mammedov
On Wed, 11 Jul 2018 15:32:12 +0200 Paolo Bonzini wrote: > 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

Re: [Qemu-devel] [PATCH 1/2] qdev: add HotplugHandler->post_plug() callback

2018-07-11 Thread Paolo Bonzini
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.

Re: [Qemu-devel] [PATCH 1/2] qdev: add HotplugHandler->post_plug() callback

2018-07-11 Thread Stefan Hajnoczi
On Tue, Jul 10, 2018 at 04:50:36PM +0100, Stefan Hajnoczi wrote: > The ->pre_plug() callback is invoked before the device is realized. The > ->plug() callback is invoked when the device is being realized but > before it is reset. > > This patch adds a ->post_plug() callback which is invoked after

Re: [Qemu-devel] [PATCH 1/2] qdev: add HotplugHandler->post_plug() callback

2018-07-11 Thread Paolo Bonzini
On 10/07/2018 17:50, Stefan Hajnoczi wrote: > The ->pre_plug() callback is invoked before the device is realized. The > ->plug() callback is invoked when the device is being realized but > before it is reset. > > This patch adds a ->post_plug() callback which is invoked after the > device has bee

[Qemu-devel] [PATCH 1/2] qdev: add HotplugHandler->post_plug() callback

2018-07-10 Thread Stefan Hajnoczi
The ->pre_plug() callback is invoked before the device is realized. The ->plug() callback is invoked when the device is being realized but before it is reset. This patch adds a ->post_plug() callback which is invoked after the device has been reset. This callback is needed by HotplugHandlers tha