[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 22/29] Include hw/boards.h a bit less
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v2 22/29] Include hw/boards.h a bit less |
Date: |
Thu, 08 Aug 2019 13:57:45 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
Eduardo Habkost <address@hidden> writes:
> On Wed, Aug 07, 2019 at 08:05:50PM +0200, Philippe Mathieu-Daudé wrote:
>> On 8/7/19 7:57 PM, Eduardo Habkost wrote:
>> > On Wed, Aug 07, 2019 at 07:26:56PM +0200, Philippe Mathieu-Daudé wrote:
>> >> On 8/6/19 5:14 PM, Markus Armbruster wrote:
>> >>> hw/boards.h pulls in almost 60 headers. The less we include it into
>> >>> headers, the better. As a first step, drop superfluous inclusions,
>> >>> and downgrade some more to what's actually needed. Gets rid of just
>> >>> one inclusion into a header.
>> >>>
>> >>> Cc: Eduardo Habkost <address@hidden>
>> >>> Cc: Marcel Apfelbaum <address@hidden>
>> >>> Signed-off-by: Markus Armbruster <address@hidden>
>> >>> ---
>> > [...]
>> >>> diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c
>> >>> index bcacdd1d8f..34a9f6f7a9 100644
>> >>> --- a/target/i386/hax-all.c
>> >>> +++ b/target/i386/hax-all.c
>> >>> @@ -33,7 +33,6 @@
>> >>> #include "sysemu/reset.h"
>> >>> #include "sysemu/sysemu.h"
>> >>> #include "qemu/main-loop.h"
>> >>> -#include "hw/boards.h"
>> >>>
>> >>> #define DEBUG_HAX 0
>> >>
>> >> include/sysemu/hax.h misses to include "hw/boards.h":
>> >
>> > I don't understand. I don't see any reason for the sysemu/hax.h
>> > header to include hw/boards.h.
>>
>> Ah, you are right, the AccelClass is defined in include/sysemu/accel.h:
>>
>> typedef struct AccelClass {
>> /*< private >*/
>> ObjectClass parent_class;
>> /*< public >*/
>>
>> const char *name;
>> int (*init_machine)(MachineState *ms);
>> ...
>>
>> So this is where "hw/boards.h" has to be included (it is where
>> MachineState is defined).
>
> As far as I can see, accel.h doesn't need the full MachineState
> struct definition and doesn't need boards.h. It just needs the
> MachineState typedef, which is defined at typedefs.h.
>
> hax-all.c, on the other hand, needs the full MachineState struct
> definition and is expected to include hw/boards.h.
Yes, and I'll fix it. Thanks!
>> >> target/i386/hax-all.c: In function 'hax_accel_init':
>> >> target/i386/hax-all.c:354:26: error: dereferencing pointer to incomplete
>> >> type 'MachineState {aka struct MachineState}'
>> >> int ret = hax_init(ms->ram_size);
- [Qemu-devel] [PATCH v2 23/29] numa: Don't include hw/boards.h into sysemu/numa.h, (continued)
[Qemu-devel] [PATCH v2 08/29] Include sysemu/reset.h a lot less, Markus Armbruster, 2019/08/06
[Qemu-devel] [PATCH v2 28/29] sysemu: Move the VMChangeStateEntry typedef to qemu/typedefs.h, Markus Armbruster, 2019/08/06
[Qemu-devel] [PATCH v2 20/29] Include qemu/main-loop.h less, Markus Armbruster, 2019/08/06
[Qemu-devel] [PATCH v2 26/29] Clean up inclusion of sysemu/sysemu.h, Markus Armbruster, 2019/08/06