diff mbox

exec: don't include hw/boards for linux-user

Message ID 20150311075850-mutt-send-email-mst@redhat.com
State New
Headers show

Commit Message

Michael S. Tsirkin March 11, 2015, 6:58 a.m. UTC
As noted by Andreas, hw/boards.h shouldn't be used outside softmmu code.
Include it conditionally, and drop the (now unnecessary) ifdef guards in
hw/boards.h

Reported-by: Andreas Färber <afaerber@suse.de>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/boards.h | 4 ----
 exec.c              | 2 ++
 2 files changed, 2 insertions(+), 4 deletions(-)

Comments

Paolo Bonzini March 11, 2015, 7:08 a.m. UTC | #1
On 11/03/2015 07:58, Michael S. Tsirkin wrote:
> As noted by Andreas, hw/boards.h shouldn't be used outside softmmu code.
> Include it conditionally, and drop the (now unnecessary) ifdef guards in
> hw/boards.h
> 
> Reported-by: Andreas Färber <afaerber@suse.de>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  include/hw/boards.h | 4 ----
>  exec.c              | 2 ++
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/include/hw/boards.h b/include/hw/boards.h
> index cd6deb0..f44d6f5 100644
> --- a/include/hw/boards.h
> +++ b/include/hw/boards.h
> @@ -3,8 +3,6 @@
>  #ifndef HW_BOARDS_H
>  #define HW_BOARDS_H
>  
> -#if !defined(CONFIG_USER_ONLY)
> -
>  #include "qemu/typedefs.h"
>  #include "sysemu/blockdev.h"
>  #include "sysemu/accel.h"
> @@ -158,5 +156,3 @@ struct MachineState {
>  };
>  
>  #endif
> -
> -#endif
> diff --git a/exec.c b/exec.c
> index fe64009..bc37c7b 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -26,7 +26,9 @@
>  #include "cpu.h"
>  #include "tcg.h"
>  #include "hw/hw.h"
> +#if !defined(CONFIG_USER_ONLY)
>  #include "hw/boards.h"
> +#endif
>  #include "hw/qdev.h"
>  #include "qemu/osdep.h"
>  #include "sysemu/kvm.h"
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Andreas Färber March 11, 2015, 11:10 a.m. UTC | #2
Am 11.03.2015 um 07:58 schrieb Michael S. Tsirkin:
> As noted by Andreas, hw/boards.h shouldn't be used outside softmmu code.
> Include it conditionally, and drop the (now unnecessary) ifdef guards in
> hw/boards.h
> 
> Reported-by: Andreas Färber <afaerber@suse.de>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  include/hw/boards.h | 4 ----
>  exec.c              | 2 ++
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/include/hw/boards.h b/include/hw/boards.h
> index cd6deb0..f44d6f5 100644
> --- a/include/hw/boards.h
> +++ b/include/hw/boards.h
> @@ -3,8 +3,6 @@
>  #ifndef HW_BOARDS_H
>  #define HW_BOARDS_H
>  
> -#if !defined(CONFIG_USER_ONLY)
> -
>  #include "qemu/typedefs.h"
>  #include "sysemu/blockdev.h"
>  #include "sysemu/accel.h"
> @@ -158,5 +156,3 @@ struct MachineState {
>  };
>  
>  #endif
> -
> -#endif
> diff --git a/exec.c b/exec.c
> index fe64009..bc37c7b 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -26,7 +26,9 @@
>  #include "cpu.h"
>  #include "tcg.h"
>  #include "hw/hw.h"
> +#if !defined(CONFIG_USER_ONLY)
>  #include "hw/boards.h"
> +#endif
>  #include "hw/qdev.h"
>  #include "qemu/osdep.h"
>  #include "sysemu/kvm.h"

Reviewed-by: Andreas Färber <afaerber@suse.de>

Thanks,
Andreas
diff mbox

Patch

diff --git a/include/hw/boards.h b/include/hw/boards.h
index cd6deb0..f44d6f5 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -3,8 +3,6 @@ 
 #ifndef HW_BOARDS_H
 #define HW_BOARDS_H
 
-#if !defined(CONFIG_USER_ONLY)
-
 #include "qemu/typedefs.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/accel.h"
@@ -158,5 +156,3 @@  struct MachineState {
 };
 
 #endif
-
-#endif
diff --git a/exec.c b/exec.c
index fe64009..bc37c7b 100644
--- a/exec.c
+++ b/exec.c
@@ -26,7 +26,9 @@ 
 #include "cpu.h"
 #include "tcg.h"
 #include "hw/hw.h"
+#if !defined(CONFIG_USER_ONLY)
 #include "hw/boards.h"
+#endif
 #include "hw/qdev.h"
 #include "qemu/osdep.h"
 #include "sysemu/kvm.h"