[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 0/8] include qdev core in *-user, make CPU child o
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [RFC 0/8] include qdev core in *-user, make CPU child of DeviceState |
Date: |
Wed, 22 Aug 2012 10:08:48 -0300 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Aug 22, 2012 at 12:05:44PM +0300, Avi Kivity wrote:
> On 08/21/2012 06:42 PM, Eduardo Habkost wrote:
> > So, here's a third suggestion to the CPU/DeviceState problem. Basically I
> > split
> > the qdev code into a core (that can be easily compiled into *-user), and a
> > part
> > specific to qemu-system-*.
> >
>
> I'm barging in late here, so sorry if this has been suggested and shot
> down: is it not possible to use composition here?
>
> typedef ... CPU;
>
> typedef struct CPUState {
> DeviceState qdev;
> CPU cpu;
> } CPUState;
>
> But I guess bringing qdev to -user is inevitable.
I guess it would be OK, and almost equivalent to the suggestion by
Anthony (use a different parent class for the CPU class on system-* and
*-user), as most state today is in the arch-specific classes.
The only problem I see is when some part of the CPU code starts using a
DeviceState feature (e.g. calling x86_cpu_realize() only at
qdev_init()-time). Then we have to duplicate some code to make *-user
work differently (not much code, I guess, but it would still make it
easier to break it if we have two implementations).
--
Eduardo
- Re: [Qemu-devel] [RFC 4/8] cleanup error.h, included qapi-types.h aready has stdbool.h, (continued)
- [Qemu-devel] [RFC 7/8] include core qdev code into *-user, too, Eduardo Habkost, 2012/08/21
- [Qemu-devel] [RFC 3/8] qapi-types.h doesn't really need to include qemu-common.h, Eduardo Habkost, 2012/08/21
- [Qemu-devel] [RFC 2/8] qdev: split up header so it can be used in cpu.h, Eduardo Habkost, 2012/08/21
- [Qemu-devel] [RFC 5/8] split qdev into a core and code used only by qemu-system-*, Eduardo Habkost, 2012/08/21
- Re: [Qemu-devel] [RFC 0/8] include qdev core in *-user, make CPU child of DeviceState, Avi Kivity, 2012/08/22
- Re: [Qemu-devel] [RFC 0/8] include qdev core in *-user, make CPU child of DeviceState,
Eduardo Habkost <=