From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVTn5-0004jH-Bb for qemu-devel@nongnu.org; Thu, 25 Apr 2013 17:33:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVTn0-0007Ic-NP for qemu-devel@nongnu.org; Thu, 25 Apr 2013 17:33:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVTn0-0007IX-Ez for qemu-devel@nongnu.org; Thu, 25 Apr 2013 17:33:14 -0400 Date: Fri, 26 Apr 2013 00:33:02 +0300 From: "Michael S. Tsirkin" Message-ID: <20130425213302.GA5321@redhat.com> References: <1366316544-1428-1-git-send-email-lersek@redhat.com> <1366316544-1428-8-git-send-email-lersek@redhat.com> <87li86xwk6.fsf@codemonkey.ws> <20130425201106.GG11821@otherpad.lan.raisama.net> <87bo928hm7.fsf@codemonkey.ws> <20130425205741.GI11821@otherpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130425205741.GI11821@otherpad.lan.raisama.net> 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) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Laszlo Ersek , qemu-devel@nongnu.org, Anthony Liguori 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 writes: > > > > > On Thu, Apr 25, 2013 at 02:03:05PM -0500, Anthony Liguori wrote: > > >> Laszlo Ersek writes: > > >> > --- /dev/null > > >> > +++ b/hw/i386/acpi.h > > >> > + > > >> > +#include > > >> > > >> 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