Re: [Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-28 Thread 陳韋任
On Wed, Mar 28, 2012 at 04:25:54PM +0800, Zhi Yong Wu wrote: > On Wed, Mar 28, 2012 at 4:05 PM, 陳韋任 wrote: > >> Il 28/03/2012 09:53, Zhi Yong Wu ha scritto: > >> > By the way, why have we not add one QOM cookbook to docs? It is very > >> > useful for us newbiew to learn. > > > >  You can write wha

Re: [Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-28 Thread 陳韋任
> Il 28/03/2012 09:53, Zhi Yong Wu ha scritto: > > By the way, why have we not add one QOM cookbook to docs? It is very > > useful for us newbiew to learn. You can write what you learn during this work. This should be a good start! :) Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab

Re: [Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-28 Thread Zhi Yong Wu
On Wed, Mar 28, 2012 at 4:05 PM, 陳韋任 wrote: >> Il 28/03/2012 09:53, Zhi Yong Wu ha scritto: >> > By the way, why have we not add one QOM cookbook to docs? It is very >> > useful for us newbiew to learn. > >  You can write what you learn during this work. This should be a good > start! :) You know,

Re: [Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-28 Thread Paolo Bonzini
Il 28/03/2012 09:53, Zhi Yong Wu ha scritto: > By the way, why have we not add one QOM cookbook to docs? It is very > useful for us newbiew to learn. Yes, that would be useful. It takes time to write docs unfortunately. :( Paolo

Re: [Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-28 Thread Zhi Yong Wu
By the way, why have we not add one QOM cookbook to docs? It is very useful for us newbiew to learn. On Wed, Mar 28, 2012 at 2:41 PM, Paolo Bonzini wrote: > Il 27/03/2012 23:21, Zhi Yong Wu ha scritto: >>> Yes, that's correct.  Everything that uses PROP_PTR needs to become a >> But i didn't see t

Re: [Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-28 Thread Zhi Yong Wu
On Wed, Mar 28, 2012 at 2:41 PM, Paolo Bonzini wrote: > Il 27/03/2012 23:21, Zhi Yong Wu ha scritto: >>> Yes, that's correct.  Everything that uses PROP_PTR needs to become a >> But i didn't see that that stuff which uses PROP_PTR become a link in >> current QEMU code. > > Yes, that's why I wrote

Re: [Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-27 Thread Paolo Bonzini
Il 27/03/2012 23:21, Zhi Yong Wu ha scritto: >> Yes, that's correct. Everything that uses PROP_PTR needs to become a > But i didn't see that that stuff which uses PROP_PTR become a link in > current QEMU code. Yes, that's why I wrote "needs to become". In order to use links, you need two things:

Re: [Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-27 Thread Zhi Yong Wu
On Tue, Mar 27, 2012 at 10:50 PM, Paolo Bonzini wrote: > Il 27/03/2012 16:18, Zhi Yong Wu ha scritto: >> On Tue, Mar 27, 2012 at 9:58 PM, Paolo Bonzini wrote: >>> Il 27/03/2012 13:59, Zhi Yong Wu ha scritto: On Tue, Mar 27, 2012 at 6:15 PM, Paolo Bonzini wrote: > Il 27/03/2012 11:06, Zh

Re: [Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-27 Thread Paolo Bonzini
Il 27/03/2012 16:18, Zhi Yong Wu ha scritto: > On Tue, Mar 27, 2012 at 9:58 PM, Paolo Bonzini wrote: >> Il 27/03/2012 13:59, Zhi Yong Wu ha scritto: >>> On Tue, Mar 27, 2012 at 6:15 PM, Paolo Bonzini wrote: Il 27/03/2012 11:06, Zhi Yong Wu ha scritto: > +#define DEFINE_HOSTDEV_PROP_P

Re: [Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-27 Thread Zhi Yong Wu
On Tue, Mar 27, 2012 at 9:58 PM, Paolo Bonzini wrote: > Il 27/03/2012 13:59, Zhi Yong Wu ha scritto: >> On Tue, Mar 27, 2012 at 6:15 PM, Paolo Bonzini wrote: >>> Il 27/03/2012 11:06, Zhi Yong Wu ha scritto: +#define DEFINE_HOSTDEV_PROP_PEER(_n, _s, _f)             \ +    DEFINE_

Re: [Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-27 Thread Paolo Bonzini
Il 27/03/2012 13:59, Zhi Yong Wu ha scritto: > On Tue, Mar 27, 2012 at 6:15 PM, Paolo Bonzini wrote: >> Il 27/03/2012 11:06, Zhi Yong Wu ha scritto: >>> +#define DEFINE_HOSTDEV_PROP_PEER(_n, _s, _f) \ >>> +DEFINE_HOSTDEV_PROP(_n, _s, _f, hostdev_prop_netdev, >>> NetCli

Re: [Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-27 Thread Zhi Yong Wu
On Tue, Mar 27, 2012 at 6:15 PM, Paolo Bonzini wrote: > Il 27/03/2012 11:06, Zhi Yong Wu ha scritto: >> +#define DEFINE_HOSTDEV_PROP_PEER(_n, _s, _f)             \ >> +    DEFINE_HOSTDEV_PROP(_n, _s, _f, hostdev_prop_netdev, >> NetClientState*) >>> > >>> > This should be simply a l

Re: [Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-27 Thread Paolo Bonzini
Il 27/03/2012 11:06, Zhi Yong Wu ha scritto: >>> >> +#define DEFINE_HOSTDEV_PROP_PEER(_n, _s, _f) \ >>> >> +DEFINE_HOSTDEV_PROP(_n, _s, _f, hostdev_prop_netdev, >>> >> NetClientState*) >> > >> > This should be simply a link property. > IMHO, i don't fully understand what link mean.

Re: [Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-27 Thread Zhi Yong Wu
On Tue, Mar 27, 2012 at 4:23 PM, Paolo Bonzini wrote: > Il 26/03/2012 07:40, zwu.ker...@gmail.com ha scritto: >> +#define DEFINE_HOSTDEV_PROP_PEER(_n, _s, _f)             \ >> +    DEFINE_HOSTDEV_PROP(_n, _s, _f, hostdev_prop_netdev, NetClientState*) > > This should be simply a link property. IMHO

Re: [Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-27 Thread Paolo Bonzini
Il 26/03/2012 07:40, zwu.ker...@gmail.com ha scritto: > +#define DEFINE_HOSTDEV_PROP_PEER(_n, _s, _f) \ > +DEFINE_HOSTDEV_PROP(_n, _s, _f, hostdev_prop_netdev, NetClientState*) This should be simply a link property. Paolo

Re: [Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-25 Thread Zhi Yong Wu
A lot of property get/set functions in qdev-properties.c are related to DeviceState. So i have to copy and modify some of them here to apply our host device model. In the future, we should make those functions more generic. On Mon, Mar 26, 2012 at 1:40 PM, wrote: > From: Zhi Yong Wu > > Signed-

[Qemu-devel] [RFC 1/9] hostdev: introduce the infrastructure for host device model

2012-03-25 Thread zwu . kernel
From: Zhi Yong Wu Signed-off-by: Zhi Yong Wu --- include/qemu/hostdev.h | 128 ++ qom/Makefile |2 +- qom/hostdev.c | 333 3 files changed, 462 insertions(+), 1 deletions(-) create mode 100644 include/qem