Re: [Qemu-devel] [RFC 4/8] qdev: link based hotplug

2014-03-24 Thread Michael S. Tsirkin
On Mon, Mar 24, 2014 at 01:20:46PM +0100, Andreas Färber wrote: > Am 21.03.2014 11:35, schrieb Igor Mammedov: > > BTW not related to hotplug but why I used link<>s: > > > > I've added link<>s as an attempt to visualize Andreas' idea to use them for > > Anthony's :) > > > hotplug and mgmt. It has

Re: [Qemu-devel] [RFC 4/8] qdev: link based hotplug

2014-03-24 Thread Andreas Färber
Am 21.03.2014 11:35, schrieb Igor Mammedov: > BTW not related to hotplug but why I used link<>s: > > I've added link<>s as an attempt to visualize Andreas' idea to use them for Anthony's :) > hotplug and mgmt. It has it's own benefits if we try to provide more or > less uniform QOM interface vie

Re: [Qemu-devel] [RFC 4/8] qdev: link based hotplug

2014-03-24 Thread Igor Mammedov
On Fri, 21 Mar 2014 12:45:01 +0100 Paolo Bonzini wrote: > Il 21/03/2014 11:35, Igor Mammedov ha scritto: > > On Thu, 20 Mar 2014 19:03:57 +0100 > > Paolo Bonzini wrote: > > > >> Il 20/03/2014 17:20, Igor Mammedov ha scritto: > > > > What about just looking up on the QOM tree until you f

Re: [Qemu-devel] [RFC 4/8] qdev: link based hotplug

2014-03-21 Thread Paolo Bonzini
Il 21/03/2014 11:35, Igor Mammedov ha scritto: > On Thu, 20 Mar 2014 19:03:57 +0100 > Paolo Bonzini wrote: > >> Il 20/03/2014 17:20, Igor Mammedov ha scritto: > > What about just looking up on the QOM tree until you find a > HotplugHandler, if the device doesn't have a bus or the bus

Re: [Qemu-devel] [RFC 4/8] qdev: link based hotplug

2014-03-21 Thread Igor Mammedov
On Thu, 20 Mar 2014 19:03:57 +0100 Paolo Bonzini wrote: > Il 20/03/2014 17:20, Igor Mammedov ha scritto: > >> > > >> > What about just looking up on the QOM tree until you find a > >> > HotplugHandler, if the device doesn't have a bus or the bus doesn't have > >> > a hotplug handler link itself?

Re: [Qemu-devel] [RFC 4/8] qdev: link based hotplug

2014-03-20 Thread Paolo Bonzini
Il 20/03/2014 17:20, Igor Mammedov ha scritto: > > What about just looking up on the QOM tree until you find a > HotplugHandler, if the device doesn't have a bus or the bus doesn't have > a hotplug handler link itself? This is similar to how FWPathProvider works. it does so "hotplug_handler_get

Re: [Qemu-devel] [RFC 4/8] qdev: link based hotplug

2014-03-20 Thread Igor Mammedov
On Thu, 20 Mar 2014 17:12:17 +0100 Paolo Bonzini wrote: > Il 20/03/2014 16:01, Igor Mammedov ha scritto: > > +/* > > + * Returns path to link<> that should be set/unset on dev hotplug. > > + * Used for link based bussless devices hotplug. > > + */ > > +char* (*hotplug_path)(De

Re: [Qemu-devel] [RFC 4/8] qdev: link based hotplug

2014-03-20 Thread Paolo Bonzini
Il 20/03/2014 16:01, Igor Mammedov ha scritto: +/* + * Returns path to link<> that should be set/unset on dev hotplug. + * Used for link based bussless devices hotplug. + */ +char* (*hotplug_path)(DeviceState *dev); + What about just looking up on the QOM tree until you find

[Qemu-devel] [RFC 4/8] qdev: link based hotplug

2014-03-20 Thread Igor Mammedov
Signed-off-by: Igor Mammedov --- hw/core/hotplug.c | 30 ++ hw/core/qdev.c | 15 +++ include/hw/hotplug.h |2 ++ include/hw/qdev-core.h |6 ++ 4 files changed, 53 insertions(+), 0 deletions(-) diff --git a/hw/core/hotplug.c b