[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 7/7] apic: qdev conversion cleanup
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v2 7/7] apic: qdev conversion cleanup |
Date: |
Wed, 16 Jun 2010 20:19:01 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Blue Swirl <address@hidden> writes:
> On Tue, Jun 15, 2010 at 8:17 AM, Markus Armbruster <address@hidden> wrote:
>> Blue Swirl <address@hidden> writes:
>>
>>> On Mon, Jun 14, 2010 at 9:36 AM, Markus Armbruster <address@hidden> wrote:
>>>> Blue Swirl <address@hidden> writes:
>>>>
>>>>> Make APICState completely private to apic.c by using DeviceState
>>>>> in external APIs.
>>>>
>>>> Could you explain why this is an improvement?
>>>
>>> Outside of apic.c, there is no need to access APICState fields so we
>>> can remove that privilege. We can move the device instantiation to the
>>> board level where it belongs.
>>
>> Moving the definition of struct APICState into apic.c is a clear win.
>> But what does widening argument types from APICState to DeviceState
>> accomplish? The compiler won't be able to catch certain stupid type
>> errors anymore; what do we gain for that loss?
>
> More beautiful architecture. This is how for example Sparc devices
> work: there are almost no global functions, all but a few are static.
I'd take the static type checking any day. But it's your funeral, I
guess :)