qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC] New device API


From: Paul Brook
Subject: Re: [Qemu-devel] [RFC] New device API
Date: Wed, 6 May 2009 01:52:01 +0100
User-agent: KMail/1.9.9

> > The attached patch is my attempt at a new internal API for device
> > creation in qemu.
>
> Instead of recreating constructors, I think we should just use GCC's
> constructor attribute.  This gives us ordering which will be important
> when dealing with buses.

The reason I'm not using constructors is because you have to workaround 
ordering issues. All constructors are run before main(), so there's a very 
limited amount they can actually do, and constructor priorities are not 
available on all hosts.

> I think the layering is not quite right with qdev.
>
> Not all devices fit into the parameters of register_mmio/connect_irq.
> When dealing with bus devices (like PCI devices), I think you really
> have to model the constructs that the bus expose.  Note, this starts to
> look very similar to the Linux kernel's layered device model.
> 
> For instance, the following makes sense to me (from an x86 perspective):
> <snip>

Hmm, I'll think about this a bit.

Paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]