qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, pbonzini@redhat.com
Subject: [Qemu-devel] [PATCH 07/15] include/hw/hw.h: Don't include qemu-common.h
Date: Tue, 15 Mar 2016 16:03:33 +0100	[thread overview]
Message-ID: <1458054221-16923-8-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1458054221-16923-1-git-send-email-armbru@redhat.com>

qemu-common.h should only be included by .c files.  Its file comment
explains why: "No header file should depend on qemu-common.h, as this
would easily lead to circular header dependencies."

hw/hw.h includes qemu-common.h, but its users generally need only
hw_error() and qemu/module.h from it.  Move the former to hw/hw.h,
include the latter there, and drop the ill-advised include.
hw/misc/cbus.c now misses hw_error(), so include hw/hw.h there.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/misc/cbus.c        | 2 +-
 include/hw/hw.h       | 4 +++-
 include/qemu-common.h | 4 ----
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/hw/misc/cbus.c b/hw/misc/cbus.c
index fafe070..0c207e3 100644
--- a/hw/misc/cbus.c
+++ b/hw/misc/cbus.c
@@ -21,7 +21,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "hw/hw.h"
 #include "hw/irq.h"
 #include "hw/devices.h"
 #include "sysemu/sysemu.h"
diff --git a/include/hw/hw.h b/include/hw/hw.h
index cd3d410..2cb69d5 100644
--- a/include/hw/hw.h
+++ b/include/hw/hw.h
@@ -2,7 +2,6 @@
 #ifndef QEMU_HW_H
 #define QEMU_HW_H
 
-#include "qemu-common.h"
 
 #if !defined(CONFIG_USER_ONLY) && !defined(NEED_CPU_H)
 #include "exec/cpu-common.h"
@@ -13,6 +12,7 @@
 #include "block/aio.h"
 #include "migration/vmstate.h"
 #include "qemu/log.h"
+#include "qemu/module.h"
 
 #ifdef NEED_CPU_H
 #if TARGET_LONG_BITS == 64
@@ -41,6 +41,8 @@ typedef void QEMUResetHandler(void *opaque);
 void qemu_register_reset(QEMUResetHandler *func, void *opaque);
 void qemu_unregister_reset(QEMUResetHandler *func, void *opaque);
 
+void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
+
 #ifdef NEED_CPU_H
 #if TARGET_LONG_BITS == 64
 #define VMSTATE_UINTTL_V(_f, _s, _v)                                  \
diff --git a/include/qemu-common.h b/include/qemu-common.h
index b8fbd9e..ba37968 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -303,10 +303,6 @@ int qemu_openpty_raw(int *aslave, char *pty_name);
     sendto(sockfd, buf, len, flags, destaddr, addrlen)
 #endif
 
-/* Error handling.  */
-
-void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
-
 struct ParallelIOArg {
     void *buffer;
     int count;
-- 
2.4.3

  parent reply	other threads:[~2016-03-15 15:03 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 01/15] include/qemu/osdep.h: Don't include qapi/error.h Markus Armbruster
2016-03-15 16:04   ` Paolo Bonzini
2016-03-15 16:26     ` Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 02/15] Use scripts/clean-includes to drop redundant qemu/typedefs.h Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 03/15] include/config.h: Unused, remove Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 04/15] Clean up includes some more Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 05/15] fw_cfg: Split fw_cfg_keys.h off fw_cfg.h Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 06/15] include/qemu/iov.h: Don't include qemu-common.h Markus Armbruster
2016-03-15 15:03 ` Markus Armbruster [this message]
2016-03-15 15:03 ` [Qemu-devel] [PATCH 08/15] hw/pci/pci.h: " Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 09/15] Move HOST_LONG_BITS from qemu-common.h to qemu/osdep.h Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 10/15] Move QEMU_ALIGN_*() " Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 11/15] Move ParallelIOArg from qemu-common.h to sysemu/char.h Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 12/15] isa: Move DMA_transfer_handler from qemu-common.h to hw/isa/isa.h Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 13/15] include/crypto: Include qapi-types.h instead of qemu-common.h Markus Armbruster
2016-03-15 15:51   ` Daniel P. Berrange
2016-03-15 16:24     ` Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers Markus Armbruster
2016-03-15 15:54   ` Daniel P. Berrange
2016-03-15 16:35     ` Markus Armbruster
2016-03-15 15:55   ` Paolo Bonzini
2016-03-15 16:31     ` Markus Armbruster
2016-03-15 17:25       ` Paolo Bonzini
2016-03-15 17:34         ` Peter Maydell
2016-03-15 17:44           ` Paolo Bonzini
2016-03-15 17:53             ` Peter Maydell
2016-03-15 19:03           ` Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 15/15] Drop superfluous qemu-common.h inclusions Markus Armbruster
2016-03-15 15:30 ` [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Paolo Bonzini
2016-03-18  8:47   ` Markus Armbruster
2016-03-18  9:05     ` Peter Maydell
2016-03-18  9:55       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1458054221-16923-8-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).