Received: from eggs.gnu.org ([2001:4830:134:3::10]:56884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZB4jy-0001dp-N6 for qemu-devel@nongnu.org; Fri, 03 Jul 2015 13:27:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZB4ju-00032F-Ia for qemu-devel@nongnu.org; Fri, 03 Jul 2015 13:27:06 -0400 From: Markus Armbruster References: <1435933104-15216-1-git-send-email-peter.maydell@linaro.org> Date: Fri, 03 Jul 2015 19:26:53 +0200 In-Reply-To: <1435933104-15216-1-git-send-email-peter.maydell@linaro.org> (Peter Maydell's message of "Fri, 3 Jul 2015 15:18:24 +0100") Message-ID: <87twtlywwy.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] Stop including qemu-common.h in memory.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org, patches@linaro.org Peter Maydell writes: > Including qemu-common.h from other header files is generally a bad > idea, because it means it's very easy to end up with a circular > dependency. For instance, if we wanted to include memory.h from > qom/cpu.h we'd end up with this loop: > memory.h -> qemu-common.h -> cpu.h -> cpu-qom.h -> qom/cpu.h -> memory.h > > Remove the include from memory.h. This requires us to fix up a few > other files which were inadvertently getting declarations indirectly > through memory.h. > > The biggest change is splitting the fprintf_function typedef out > into its own header so other headers can get at it without having > to include qemu-common.h. Why not simply put it in qemu/typedefs.h? > Signed-off-by: Peter Maydell > --- > I originally wrote this because I thought I was going to need to > include memory.h in qom/cpu.h. In fact I managed to avoid that in > the end, but this still seems like useful cleanup. Yup.