From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TY20t-0004wC-JW for qemu-devel@nongnu.org; Mon, 12 Nov 2012 16:57:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TY20q-00024t-HE for qemu-devel@nongnu.org; Mon, 12 Nov 2012 16:57:51 -0500 Received: from cantor2.suse.de ([195.135.220.15]:55509 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TY20q-00024i-7b for qemu-devel@nongnu.org; Mon, 12 Nov 2012 16:57:48 -0500 Message-ID: <50A170D6.9020408@suse.de> Date: Mon, 12 Nov 2012 22:57:42 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1352473012-20500-1-git-send-email-ehabkost@redhat.com> <1352473012-20500-4-git-send-email-ehabkost@redhat.com> In-Reply-To: <1352473012-20500-4-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 03/24] qemu-common.h: comment about usage rules List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: peter.maydell@linaro.org, riku.voipio@iki.fi, qemu-devel@nongnu.org, blauwirbel@gmail.com, Anthony Liguori , Igor Mammedov Am 09.11.2012 15:56, schrieb Eduardo Habkost: > Every time we make a tiny change on a header file, we often find > circular header dependency problems. To avoid this nightmare, we need t= o > stop including qemu-common.h on other headers, and we should gradually "from other headers" as below? > move the declarations from the catchall qemu-common.h header to their > specific headers. >=20 > This simply adds a comment documenting the rules about qemu-common.h, > hoping that people will see it before including qemu-common.h from othe= r > header files, and before adding more declarations to qemu-common.h. This reminds me that I had once posted a patch moving a declaration I had once added for Cocoa to a new ui/ui.h... seems it never made it to master, I'll go search, maybe we can smuggle that in now. ;) >=20 > Signed-off-by: Eduardo Habkost > --- > qemu-common.h | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) >=20 > diff --git a/qemu-common.h b/qemu-common.h > index ac9985c..ea43bfa 100644 > --- a/qemu-common.h > +++ b/qemu-common.h > @@ -1,5 +1,14 @@ > =20 > -/* Common header file that is included by all of qemu. */ > +/* Common header file that is included by all of qemu. "QEMU", while at it. > + * > + * This file is supposed to be included only by .c files. No header fi= le should > + * depend on qemu-common.h, as this would easily lead to circular head= er > + * dependencies. > + * > + * If a header files uses a definition from qemu-common.h, that defini= tion "a header file" > + * must be moved to a separate header file, and the header that uses i= t > + * must include that header. > + */ > #ifndef QEMU_COMMON_H > #define QEMU_COMMON_H > =20 I'll fix this up myself to spare you a resend and me another full review. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg