[Top][All Lists]
[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: |
Sat, 9 May 2009 22:06:37 +0100 |
User-agent: |
KMail/1.9.9 |
On Saturday 09 May 2009, Anthony Liguori wrote:
> Paul Brook wrote:
> > On Wednesday 06 May 2009, Paul Brook wrote:
> >>>> 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.
> >
> > Oh, the other thing is that constructors don't work when you put objects
> > in a static library. You need am explicit dependency to pull in objects.
>
> Not if you enable -Wl,--whole-archive. It ends up looking like:
>
> gcc -o test-stub -g -Wall -O test-stub.c -Wl,--whole-archive libtest.a
> -Wl,--no-whole-archive -L.
>
> And I've confirmed this works.
Yes, but, eww. Plus it means you've got to pull in absolutely everything,
whether you want it or not.
Paul
- Re: [Qemu-devel] [RFC] New device API, (continued)
- Re: [Qemu-devel] [RFC] New device API, Anthony Liguori, 2009/05/05
- Re: [Qemu-devel] [RFC] New device API, Edgar E. Iglesias, 2009/05/05
- Re: [Qemu-devel] [RFC] New device API, Paul Brook, 2009/05/05
- Re: [Qemu-devel] [RFC] New device API, malc, 2009/05/09
- Re: [Qemu-devel] [RFC] New device API, Anthony Liguori, 2009/05/09
- Re: [Qemu-devel] [RFC] New device API, Andreas Färber, 2009/05/10
- Re: [Qemu-devel] [RFC] New device API, malc, 2009/05/10
- Re: [Qemu-devel] [RFC] New device API, Anthony Liguori, 2009/05/09
Re: [Qemu-devel] [RFC] New device API, Edgar E. Iglesias, 2009/05/05
Re: [Qemu-devel] [RFC] New device API, Zachary Amsden, 2009/05/07