diff mbox

[38/50] qemu-common: stop including qemu/host-utils.h from qemu-common.h

Message ID 1460147350-7601-39-git-send-email-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paolo Bonzini April 8, 2016, 8:28 p.m. UTC
Move it to the actual users.  There are some inclusions of
qemu/host-utils.h in headers, but they are all necessary.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 audio/noaudio.c                         | 1 +
 audio/wavaudio.c                        | 2 +-
 contrib/ivshmem-server/ivshmem-server.c | 1 +
 hw/acpi/core.c                          | 6 ++++++
 hw/bt/sdp.c                             | 1 +
 hw/display/tc6393xb.c                   | 1 +
 include/exec/cpu-defs.h                 | 1 +
 include/hw/acpi/acpi.h                  | 7 -------
 include/qemu-common.h                   | 1 -
 include/qemu/timer.h                    | 1 -
 page_cache.c                            | 1 +
 slirp/slirp.h                           | 1 +
 stubs/slirp.c                           | 1 +
 tests/libqos/malloc.c                   | 1 +
 util/buffer.c                           | 1 +
 15 files changed, 17 insertions(+), 10 deletions(-)

Comments

Alex Bennée April 21, 2016, 10:46 a.m. UTC | #1
Paolo Bonzini <pbonzini@redhat.com> writes:

> Move it to the actual users.  There are some inclusions of
> qemu/host-utils.h in headers, but they are all necessary.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


This patch breaks the bisect:

make -k -j9
  CC    audio/spiceaudio.o
audio/spiceaudio.c: In function ‘rate_get_samples’:
audio/spiceaudio.c:107:13: error: implicit declaration of function ‘muldiv64’ [-Werror=implicit-function-declaration]
     bytes = muldiv64(ticks, info->bytes_per_second, NANOSECONDS_PER_SECOND);
             ^
audio/spiceaudio.c:107:5: error: nested extern declaration of ‘muldiv64’ [-Werror=nested-externs]
     bytes = muldiv64(ticks, info->bytes_per_second, NANOSECONDS_PER_SECOND);
     ^
cc1: all warnings being treated as errors
/home/alex/lsrc/qemu/qemu.git/rules.mak:57: recipe for target 'audio/spiceaudio.o' failed
make: *** [audio/spiceaudio.o] Error 1
make: Target 'all' not remade because of errors.

Compilation exited abnormally with code 2 at Thu Apr 21 11:45:33


> ---
>  audio/noaudio.c                         | 1 +
>  audio/wavaudio.c                        | 2 +-
>  contrib/ivshmem-server/ivshmem-server.c | 1 +
>  hw/acpi/core.c                          | 6 ++++++
>  hw/bt/sdp.c                             | 1 +
>  hw/display/tc6393xb.c                   | 1 +
>  include/exec/cpu-defs.h                 | 1 +
>  include/hw/acpi/acpi.h                  | 7 -------
>  include/qemu-common.h                   | 1 -
>  include/qemu/timer.h                    | 1 -
>  page_cache.c                            | 1 +
>  slirp/slirp.h                           | 1 +
>  stubs/slirp.c                           | 1 +
>  tests/libqos/malloc.c                   | 1 +
>  util/buffer.c                           | 1 +
>  15 files changed, 17 insertions(+), 10 deletions(-)
>
> diff --git a/audio/noaudio.c b/audio/noaudio.c
> index b360c19..9ca9eaf 100644
> --- a/audio/noaudio.c
> +++ b/audio/noaudio.c
> @@ -23,6 +23,7 @@
>   */
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
> +#include "qemu/host-utils.h"
>  #include "audio.h"
>  #include "qemu/timer.h"
>
> diff --git a/audio/wavaudio.c b/audio/wavaudio.c
> index 345952e..341eec3 100644
> --- a/audio/wavaudio.c
> +++ b/audio/wavaudio.c
> @@ -22,7 +22,7 @@
>   * THE SOFTWARE.
>   */
>  #include "qemu/osdep.h"
> -#include "hw/hw.h"
> +#include "qemu/host-utils.h"
>  #include "qemu/timer.h"
>  #include "audio.h"
>
> diff --git a/contrib/ivshmem-server/ivshmem-server.c b/contrib/ivshmem-server/ivshmem-server.c
> index 172db78..bf4ee0b 100644
> --- a/contrib/ivshmem-server/ivshmem-server.c
> +++ b/contrib/ivshmem-server/ivshmem-server.c
> @@ -7,6 +7,7 @@
>   */
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
> +#include "qemu/host-utils.h"
>  #include "qemu/sockets.h"
>
>  #include <sys/mman.h>
> diff --git a/hw/acpi/core.c b/hw/acpi/core.c
> index 7925a1a..f0808c1 100644
> --- a/hw/acpi/core.c
> +++ b/hw/acpi/core.c
> @@ -491,6 +491,12 @@ void acpi_pm_tmr_update(ACPIREGS *ar, bool enable)
>      }
>  }
>
> +static inline int64_t acpi_pm_tmr_get_clock(void)
> +{
> +    return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), PM_TIMER_FREQUENCY,
> +                    NANOSECONDS_PER_SECOND);
> +}
> +
>  void acpi_pm_tmr_calc_overflow_time(ACPIREGS *ar)
>  {
>      int64_t d = acpi_pm_tmr_get_clock();
> diff --git a/hw/bt/sdp.c b/hw/bt/sdp.c
> index be26009..f67b3b8 100644
> --- a/hw/bt/sdp.c
> +++ b/hw/bt/sdp.c
> @@ -19,6 +19,7 @@
>
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
> +#include "qemu/host-utils.h"
>  #include "hw/bt.h"
>
>  struct bt_l2cap_sdp_state_s {
> diff --git a/hw/display/tc6393xb.c b/hw/display/tc6393xb.c
> index da3cece..92f7120 100644
> --- a/hw/display/tc6393xb.c
> +++ b/hw/display/tc6393xb.c
> @@ -12,6 +12,7 @@
>   */
>  #include "qemu/osdep.h"
>  #include "qapi/error.h"
> +#include "qemu/host-utils.h"
>  #include "hw/hw.h"
>  #include "hw/devices.h"
>  #include "hw/block/flash.h"
> diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h
> index 854e7e3..5f4e303 100644
> --- a/include/exec/cpu-defs.h
> +++ b/include/exec/cpu-defs.h
> @@ -23,6 +23,7 @@
>  #error cpu.h included from common code
>  #endif
>
> +#include "qemu/host-utils.h"
>  #include "qemu/queue.h"
>  #include "tcg-target.h"
>  #ifndef CONFIG_USER_ONLY
> diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
> index e0978c8..dc6ee00 100644
> --- a/include/hw/acpi/acpi.h
> +++ b/include/hw/acpi/acpi.h
> @@ -150,13 +150,6 @@ void acpi_pm_tmr_init(ACPIREGS *ar, acpi_update_sci_fn update_sci,
>                        MemoryRegion *parent);
>  void acpi_pm_tmr_reset(ACPIREGS *ar);
>
> -#include "qemu/timer.h"
> -static inline int64_t acpi_pm_tmr_get_clock(void)
> -{
> -    return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), PM_TIMER_FREQUENCY,
> -                    NANOSECONDS_PER_SECOND);
> -}
> -
>  /* PM1a_EVT: piix and ich9 don't implement PM1b. */
>  uint16_t acpi_pm1_evt_get_sts(ACPIREGS *ar);
>  void acpi_pm1_evt_power_down(ACPIREGS *ar);
> diff --git a/include/qemu-common.h b/include/qemu-common.h
> index dc041fc..cd3139b 100644
> --- a/include/qemu-common.h
> +++ b/include/qemu-common.h
> @@ -21,7 +21,6 @@
>  #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
>
>  #include "qemu/option.h"
> -#include "qemu/host-utils.h"
>
>  /* FIXME: Remove NEED_CPU_H.  */
>  #ifdef NEED_CPU_H
> diff --git a/include/qemu/timer.h b/include/qemu/timer.h
> index 309f3d0..d97ddfb 100644
> --- a/include/qemu/timer.h
> +++ b/include/qemu/timer.h
> @@ -3,7 +3,6 @@
>
>  #include "qemu-common.h"
>  #include "qemu/notify.h"
> -#include "qemu/host-utils.h"
>  #include "sysemu/cpus.h"
>
>  #define NANOSECONDS_PER_SECOND 1000000000LL
> diff --git a/page_cache.c b/page_cache.c
> index cb8a69e..37a66e4 100644
> --- a/page_cache.c
> +++ b/page_cache.c
> @@ -16,6 +16,7 @@
>  #include <glib.h>
>
>  #include "qemu-common.h"
> +#include "qemu/host-utils.h"
>  #include "migration/page_cache.h"
>
>  #ifdef DEBUG_CACHE
> diff --git a/slirp/slirp.h b/slirp/slirp.h
> index c99ebb9..223da91 100644
> --- a/slirp/slirp.h
> +++ b/slirp/slirp.h
> @@ -1,6 +1,7 @@
>  #ifndef __COMMON_H__
>  #define __COMMON_H__
>
> +#include "qemu/host-utils.h"
>  #include "slirp_config.h"
>
>  #ifdef _WIN32
> diff --git a/stubs/slirp.c b/stubs/slirp.c
> index dcae51f..42f7e1a 100644
> --- a/stubs/slirp.c
> +++ b/stubs/slirp.c
> @@ -1,5 +1,6 @@
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
> +#include "qemu/host-utils.h"
>  #include "slirp/slirp.h"
>
>  void slirp_pollfds_fill(GArray *pollfds, uint32_t *timeout)
> diff --git a/tests/libqos/malloc.c b/tests/libqos/malloc.c
> index c0df52f..793fe69 100644
> --- a/tests/libqos/malloc.c
> +++ b/tests/libqos/malloc.c
> @@ -13,6 +13,7 @@
>  #include "qemu/osdep.h"
>  #include "libqos/malloc.h"
>  #include "qemu-common.h"
> +#include "qemu/host-utils.h"
>  #include <glib.h>
>
>  typedef QTAILQ_HEAD(MemList, MemBlock) MemList;
> diff --git a/util/buffer.c b/util/buffer.c
> index a6118bf..f59bacc 100644
> --- a/util/buffer.c
> +++ b/util/buffer.c
> @@ -19,6 +19,7 @@
>   */
>
>  #include "qemu/osdep.h"
> +#include "qemu/host-utils.h"
>  #include "qemu/buffer.h"
>  #include "trace.h"


--
Alex Bennée
Paolo Bonzini May 9, 2016, 9:39 a.m. UTC | #2
On 21/04/2016 12:46, Alex Bennée wrote:
> 
>> > Move it to the actual users.  There are some inclusions of
>> > qemu/host-utils.h in headers, but they are all necessary.
>> >
>> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> This patch breaks the bisect:

Thanks, fixed.

Paolo
diff mbox

Patch

diff --git a/audio/noaudio.c b/audio/noaudio.c
index b360c19..9ca9eaf 100644
--- a/audio/noaudio.c
+++ b/audio/noaudio.c
@@ -23,6 +23,7 @@ 
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "qemu/host-utils.h"
 #include "audio.h"
 #include "qemu/timer.h"
 
diff --git a/audio/wavaudio.c b/audio/wavaudio.c
index 345952e..341eec3 100644
--- a/audio/wavaudio.c
+++ b/audio/wavaudio.c
@@ -22,7 +22,7 @@ 
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "hw/hw.h"
+#include "qemu/host-utils.h"
 #include "qemu/timer.h"
 #include "audio.h"
 
diff --git a/contrib/ivshmem-server/ivshmem-server.c b/contrib/ivshmem-server/ivshmem-server.c
index 172db78..bf4ee0b 100644
--- a/contrib/ivshmem-server/ivshmem-server.c
+++ b/contrib/ivshmem-server/ivshmem-server.c
@@ -7,6 +7,7 @@ 
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "qemu/host-utils.h"
 #include "qemu/sockets.h"
 
 #include <sys/mman.h>
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index 7925a1a..f0808c1 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -491,6 +491,12 @@  void acpi_pm_tmr_update(ACPIREGS *ar, bool enable)
     }
 }
 
+static inline int64_t acpi_pm_tmr_get_clock(void)
+{
+    return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), PM_TIMER_FREQUENCY,
+                    NANOSECONDS_PER_SECOND);
+}
+
 void acpi_pm_tmr_calc_overflow_time(ACPIREGS *ar)
 {
     int64_t d = acpi_pm_tmr_get_clock();
diff --git a/hw/bt/sdp.c b/hw/bt/sdp.c
index be26009..f67b3b8 100644
--- a/hw/bt/sdp.c
+++ b/hw/bt/sdp.c
@@ -19,6 +19,7 @@ 
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "qemu/host-utils.h"
 #include "hw/bt.h"
 
 struct bt_l2cap_sdp_state_s {
diff --git a/hw/display/tc6393xb.c b/hw/display/tc6393xb.c
index da3cece..92f7120 100644
--- a/hw/display/tc6393xb.c
+++ b/hw/display/tc6393xb.c
@@ -12,6 +12,7 @@ 
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "qemu/host-utils.h"
 #include "hw/hw.h"
 #include "hw/devices.h"
 #include "hw/block/flash.h"
diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h
index 854e7e3..5f4e303 100644
--- a/include/exec/cpu-defs.h
+++ b/include/exec/cpu-defs.h
@@ -23,6 +23,7 @@ 
 #error cpu.h included from common code
 #endif
 
+#include "qemu/host-utils.h"
 #include "qemu/queue.h"
 #include "tcg-target.h"
 #ifndef CONFIG_USER_ONLY
diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index e0978c8..dc6ee00 100644
--- a/include/hw/acpi/acpi.h
+++ b/include/hw/acpi/acpi.h
@@ -150,13 +150,6 @@  void acpi_pm_tmr_init(ACPIREGS *ar, acpi_update_sci_fn update_sci,
                       MemoryRegion *parent);
 void acpi_pm_tmr_reset(ACPIREGS *ar);
 
-#include "qemu/timer.h"
-static inline int64_t acpi_pm_tmr_get_clock(void)
-{
-    return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), PM_TIMER_FREQUENCY,
-                    NANOSECONDS_PER_SECOND);
-}
-
 /* PM1a_EVT: piix and ich9 don't implement PM1b. */
 uint16_t acpi_pm1_evt_get_sts(ACPIREGS *ar);
 void acpi_pm1_evt_power_down(ACPIREGS *ar);
diff --git a/include/qemu-common.h b/include/qemu-common.h
index dc041fc..cd3139b 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -21,7 +21,6 @@ 
 #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
 
 #include "qemu/option.h"
-#include "qemu/host-utils.h"
 
 /* FIXME: Remove NEED_CPU_H.  */
 #ifdef NEED_CPU_H
diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index 309f3d0..d97ddfb 100644
--- a/include/qemu/timer.h
+++ b/include/qemu/timer.h
@@ -3,7 +3,6 @@ 
 
 #include "qemu-common.h"
 #include "qemu/notify.h"
-#include "qemu/host-utils.h"
 #include "sysemu/cpus.h"
 
 #define NANOSECONDS_PER_SECOND 1000000000LL
diff --git a/page_cache.c b/page_cache.c
index cb8a69e..37a66e4 100644
--- a/page_cache.c
+++ b/page_cache.c
@@ -16,6 +16,7 @@ 
 #include <glib.h>
 
 #include "qemu-common.h"
+#include "qemu/host-utils.h"
 #include "migration/page_cache.h"
 
 #ifdef DEBUG_CACHE
diff --git a/slirp/slirp.h b/slirp/slirp.h
index c99ebb9..223da91 100644
--- a/slirp/slirp.h
+++ b/slirp/slirp.h
@@ -1,6 +1,7 @@ 
 #ifndef __COMMON_H__
 #define __COMMON_H__
 
+#include "qemu/host-utils.h"
 #include "slirp_config.h"
 
 #ifdef _WIN32
diff --git a/stubs/slirp.c b/stubs/slirp.c
index dcae51f..42f7e1a 100644
--- a/stubs/slirp.c
+++ b/stubs/slirp.c
@@ -1,5 +1,6 @@ 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "qemu/host-utils.h"
 #include "slirp/slirp.h"
 
 void slirp_pollfds_fill(GArray *pollfds, uint32_t *timeout)
diff --git a/tests/libqos/malloc.c b/tests/libqos/malloc.c
index c0df52f..793fe69 100644
--- a/tests/libqos/malloc.c
+++ b/tests/libqos/malloc.c
@@ -13,6 +13,7 @@ 
 #include "qemu/osdep.h"
 #include "libqos/malloc.h"
 #include "qemu-common.h"
+#include "qemu/host-utils.h"
 #include <glib.h>
 
 typedef QTAILQ_HEAD(MemList, MemBlock) MemList;
diff --git a/util/buffer.c b/util/buffer.c
index a6118bf..f59bacc 100644
--- a/util/buffer.c
+++ b/util/buffer.c
@@ -19,6 +19,7 @@ 
  */
 
 #include "qemu/osdep.h"
+#include "qemu/host-utils.h"
 #include "qemu/buffer.h"
 #include "trace.h"