qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Purpose of qemu-common.h (was Re: [PATCH v4 7/7] hw/i38


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] Purpose of qemu-common.h (was Re: [PATCH v4 7/7] hw/i386: build ACPI MADT (APIC) for fw_cfg clients)
Date: Fri, 26 Apr 2013 00:33:02 +0300

On Thu, Apr 25, 2013 at 05:57:41PM -0300, Eduardo Habkost wrote:
> On Thu, Apr 25, 2013 at 03:45:04PM -0500, Anthony Liguori wrote:
> > Eduardo Habkost <address@hidden> writes:
> > 
> > > On Thu, Apr 25, 2013 at 02:03:05PM -0500, Anthony Liguori wrote:
> > >> Laszlo Ersek <address@hidden> writes:
> > >> > --- /dev/null
> > >> > +++ b/hw/i386/acpi.h
> > >> > +
> > >> > +#include <stddef.h>
> > >> 
> > >> QEMU style would normally be to use qemu-common.h here but honestly I
> > >> prefer using system headers when it's possible.  Just FYI.
> > >
> > > I thought we were actively trying to stop including qemu-common.h from
> > > other header files, because it easily leads to unexpected (and hard to
> > > fix) circular header dependencies.
> > 
> > The problem is qemu-common including other headers, not other headers
> > including qemu-common...
> 
> Well, it depends on what's the stated purpose/rules of qemu-common.h. If
> its purpose if to allow .c files to have many commonly-used definitions
> available without including commonly-used header files one by one,
> qemu-common.h will inevitably include other QEMU header files.
> 
> > 
> > But like I said in my original note, I don't like using qemu-common in
> > headers anyway.
> 
> Agreed on this specific case. But I would really like to clarify the
> purpose of qemu-common.h, because I always believed that it was supposed
> to be a "includes lots of other stuff" header, not a "is included by
> lots of other stuff" header (and it can't be both).
> 
> 
> BTW, qemu-common.h already have a comment stating the following:
> 
> """
> This file is supposed to be included only by .c files. No header file should
> depend on qemu-common.h, as this would easily lead to circular header
> dependencies.
> """
> 
> If this is not true, we must correct it.

I think most of these should be switched to include
qemu/typedefs.h. qemu-common used to have all typedefs
a while ago.


> -- 
> Eduardo



reply via email to

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