hw: Reduce "qemu/accel.h" inclusion
cover hw: Reduce "qemu/accel.h" inclusion
Another trivial series, restricting "qemu/accel.h".
Philippe Mathieu-Daudé (2):
typedefs: Forward-declare AccelState
hw: Reduce "qemu/accel.h" inclusion
hw/core/machine.c | 1 + include/hw/boards.h | 1 - include/qemu/accel.h | 4 ++-- include/qemu/typedefs.h | 1 + 4 files changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
2.38.1
PATCH 1/2 typedefs: Forward-declare AccelState
Forward-declare AccelState in "qemu/typedefs.h" so structures using a reference of it (like MachineState in "hw/boards.h") don't have to include "qemu/accel.h".
--- include/qemu/accel.h | 4 ++-- include/qemu/typedefs.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-)
include/qemu/accel.h +2 -2
@@ -26,10 +26,10 @@#include "qom/object.h" #include "exec/hwaddr.h" -typedef struct AccelState { +struct AccelState {/*< private >*/ Object parent_obj; -}AccelState ; +}; typedef struct AccelClass { /*< private >*/
include/qemu/typedefs.h +1 -0
@@ -21,6 +21,7 @@* Incomplete struct types * Please keep this list in case-insensitive alphabetical order. */ +typedef struct AccelState AccelState ;typedef struct AdapterInfo AdapterInfo ;typedef struct AddressSpace AddressSpace ;typedef struct AioContext AioContext ;
Signature · 1 line
2.38.1
Re: [PATCH-for-8.0 1/2] typedefs: Forward-declare AccelState
Quoted 5 lines · Philippe Mathieu-Daudé
Forward-declare AccelState in "
qemu/typedefs.h" so structures using a reference of it (like MachineState in "hw/boards.h") don't have to include "qemu/accel.h".Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Re: [PATCH-for-8.0 1/2] typedefs: Forward-declare AccelState
In reply to Philippe Mathieu-DaudéQuoted 9 lines · Philippe Mathieu-Daudé
Forward-declare AccelState in "
qemu/typedefs.h" so structures using a reference of it (like MachineState in "hw/boards.h") don't have to include "qemu/accel.h".Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- include/qemu/accel.h | 4 ++-- include/qemu/typedefs.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-)
r~
PATCH 2/2 hw: Reduce "qemu/accel.h" inclusion
In reply to Philippe Mathieu-DaudéMove "qemu/accel.h" include from the heavily included "hw/boards.h" to hw/core/machine.c, the single file using the AccelState definition.
--- hw/core/machine.c | 1 + include/hw/boards.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)
hw/core/machine.c +1 -0
@@ -12,6 +12,7 @@#include "qemu/osdep.h" #include "qemu/option.h" +#include "qemu/accel.h" #include "qapi/qmp/qerror.h" #include "sysemu/replay.h" #include "qemu/units.h"
include/hw/boards.h +0 -1
@@ -6,7 +6,6 @@#include "exec/memory.h" #include "sysemu/hostmem.h" #include "sysemu/blockdev.h" -#include "qemu/accel.h" #include "qapi/qapi-types-machine.h" #include "qemu/module.h" #include "qom/object.h"
Signature · 1 line
2.38.1
Quoted 3 lines · Philippe Mathieu-Daudé
Move "
qemu/accel.h" include from the heavily included "hw/boards.h" tohw/core/machine.c, the single file using the AccelState definition.
Do you mean accel_init_interfaces() and ACCEL_GET_CLASS? I don't see AccelState explicitly.
Anyway,
Quoted 30 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/core/machine.c | 1 + include/hw/boards.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)hw/core/machine.c +1
-0@@ -12,6 +12,7 @@#include "qemu/osdep.h" #include "qemu/option.h" +#include "qemu/accel.h" #include "qapi/qmp/qerror.h" #include "sysemu/replay.h" #include "qemu/units.h" include/hw/boards.h +0
-1@@ -6,7 +6,6 @@#include "exec/memory.h" #include "sysemu/hostmem.h" #include "sysemu/blockdev.h" -#include "qemu/accel.h" #include "qapi/qapi-types-machine.h" #include "qemu/module.h" #include "qom/object.h"
Quoted 8 lines · Fabiano Rosas
Quoted 3 lines · Philippe Mathieu-Daudé
Move "
qemu/accel.h" include from the heavily included "hw/boards.h" tohw/core/machine.c, the single file using the AccelState definition.Do you mean
accel_init_interfaces()andACCEL_GET_CLASS? I don't see AccelState explicitly.
Oops you are right...
Paolo, do you mind fixing with:
Move "qemu/accel.h" include from the heavily included "hw/boards.h" to hw/core/machine.c, the single file using accel-related definitions.
or do you want me to respin a v2?
Quoted 3 lines
Anyway,
Reviewed-by Fabiano Rosas <[email protected]>
Thanks!
Quoted 5 lines
Quoted 5 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/core/machine.c | 1 + include/hw/boards.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)
Quoted 8 lines · Philippe Mathieu-Daudé
Quoted 6 lines · Fabiano Rosas
Quoted 3 lines · Philippe Mathieu-Daudé
Move "
qemu/accel.h" include from the heavily included "hw/boards.h" tohw/core/machine.c, the single file using the AccelState definition.
Quoted 8 lines
Quoted 2 lines
Do you mean
accel_init_interfaces()andACCEL_GET_CLASS? I don't see AccelState explicitly.Paolo, do you mind fixing with:
Move "
qemu/accel.h" include from the heavily included "hw/boards.h" tohw/core/machine.c, the single file using accel-related definitions.
Can do, thanks for the suggestion.
Paolo
Quoted 10 lines · Philippe Mathieu-Daudé
Move "
qemu/accel.h" include from the heavily included "hw/boards.h" tohw/core/machine.c, the single file using the AccelState definition.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
hw/core/machine.c | 1 +
include/hw/boards.h | 1 -2 files changed, 1 insertion(+), 1 deletion(-)
Quoted 24 lines
hw/core/machine.c +0
-0@@ -12,6 +12,7 @@
#include "qemu/osdep.h"
#include "qemu/option.h"
+#include "qemu/accel.h"
#include "qapi/qmp/qerror.h"
#include "sysemu/replay.h"
#include "qemu/units.h"include/hw/boards.h +0
-1@@ -6,7 +6,6 @@ #include "exec/memory.h" #include "sysemu/hostmem.h" #include "sysemu/blockdev.h" -#include "qemu/accel.h" #include "qapi/qapi-types-machine.h" #include "qemu/module.h" #include "qom/object.h"
Paolo Bonzini
AppliedQueued, thanks.
Paolo