Skip to contentSkip to conversation

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

PATCH In review Michael S. Tsirkin 3 participants 3 messages Mar 11, 2015

lore
Share & tools
lore
#0 lore raw

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

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

---
 include/hw/boards.h | 4 ----
 exec.c              | 2 ++
 2 files changed, 2 insertions(+), 4 deletions(-)
include/hw/boards.h +0 -4
index cd6deb0..f44d6f5 100644
@@ -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
exec.c +2 -0
index fe64009..bc37c7b 100644
@@ -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"
Signature · 1 line
MST
Acked-by on v1 1/1
#1 lore raw
Quoted 37 lines · 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

---
 include/hw/boards.h | 4 ----
 exec.c              | 2 ++
 2 files changed, 2 insertions(+), 4 deletions(-)
include/hw/boards.h +0 -4
index cd6deb0..f44d6f5 100644
@@ -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
exec.c +0 -0
index fe64009..bc37c7b 100644

exec.c line 34

Quoted 9 lines
exec.c +2 -0
@@ -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 on v1 1/1
#2 lore raw
In reply to Michael S. Tsirkin

Am 11.03.2015 um 07:58 schrieb Michael S. Tsirkin:

Quoted 36 lines

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

---
 include/hw/boards.h | 4 ----
 exec.c              | 2 ++
 2 files changed, 2 insertions(+), 4 deletions(-)
include/hw/boards.h +0 -4
index cd6deb0..f44d6f5 100644
@@ -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
exec.c +0 -0
index fe64009..bc37c7b 100644

exec.c line 34

Quoted 9 lines
exec.c +2 -0
@@ -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"

Thanks,
Andreas

Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu,
Graham Norton; HRB 21284 (AG Nürnberg)