* [PATCH 00/11] hw/core: Cleanup and reorder headers
@ 2024-01-15 9:48 Zhao Liu
2024-01-15 9:48 ` [PATCH 01/11] MAINTAINERS: Update hw/core/cpu.c entry Zhao Liu
` (10 more replies)
0 siblings, 11 replies; 17+ messages in thread
From: Zhao Liu @ 2024-01-15 9:48 UTC (permalink / raw)
To: Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang
Cc: qemu-devel, Zhao Liu
From: Zhao Liu <zhao1.liu@intel.com>
Identify unused headers by full compilation (tested by "./configure" and
then "make") and reorder headers in alphabetical order.
In addition, update a file entry in MAINTAINERS file.
Zhao Liu (11):
MAINTAINERS: Update hw/core/cpu.c entry
hw/core: Cleanup unused included headers in cpu-common.c
hw/core: Reorder included headers in cpu-common.c
hw/core: Reorder included headers in cpu-sysemu.c
hw/core: Cleanup unused included headers in machine-qmp-cmds.c
hw/core: Cleanup unused included header in machine.c
hw/core: Reorder included header in machine.c
hw/core: Cleanup unnecessary included header in null-machine.c
hw/core: Reorder included headers in null-machine.c
hw/core: Cleanup unused included headers in numa.c
hw/core: Reorder included headers in numa.c
MAINTAINERS | 3 ++-
hw/core/cpu-common.c | 17 ++++++-----------
hw/core/cpu-sysemu.c | 3 ++-
hw/core/machine-qmp-cmds.c | 4 +---
hw/core/machine.c | 22 +++++++++++-----------
hw/core/null-machine.c | 6 +++---
hw/core/numa.c | 20 +++++++-------------
7 files changed, 32 insertions(+), 43 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 01/11] MAINTAINERS: Update hw/core/cpu.c entry
2024-01-15 9:48 [PATCH 00/11] hw/core: Cleanup and reorder headers Zhao Liu
@ 2024-01-15 9:48 ` Zhao Liu
2024-01-15 11:09 ` Philippe Mathieu-Daudé
2024-01-15 9:48 ` [PATCH 02/11] hw/core: Cleanup unused included headers in cpu-common.c Zhao Liu
` (9 subsequent siblings)
10 siblings, 1 reply; 17+ messages in thread
From: Zhao Liu @ 2024-01-15 9:48 UTC (permalink / raw)
To: Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang
Cc: qemu-devel, Zhao Liu
From: Zhao Liu <zhao1.liu@intel.com>
The hw/core/cpu.c was split as hw/core/cpu-common.c and
hw/core/cpu-sysemu.c in the commit df4fd7d5c8a3 ("cpu: Split as
cpu-common / cpu-sysemu").
Update the related entry.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
MAINTAINERS | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index b406fb20c059..529313eba27e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1867,7 +1867,8 @@ M: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
R: Philippe Mathieu-Daudé <philmd@linaro.org>
R: Yanan Wang <wangyanan55@huawei.com>
S: Supported
-F: hw/core/cpu.c
+F: hw/core/cpu-common.c
+F: hw/core/cpu-sysemu.c
F: hw/core/machine-qmp-cmds.c
F: hw/core/machine.c
F: hw/core/machine-smp.c
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 02/11] hw/core: Cleanup unused included headers in cpu-common.c
2024-01-15 9:48 [PATCH 00/11] hw/core: Cleanup and reorder headers Zhao Liu
2024-01-15 9:48 ` [PATCH 01/11] MAINTAINERS: Update hw/core/cpu.c entry Zhao Liu
@ 2024-01-15 9:48 ` Zhao Liu
2024-01-15 10:41 ` Peter Maydell
2024-01-15 9:48 ` [PATCH 03/11] hw/core: Reorder " Zhao Liu
` (8 subsequent siblings)
10 siblings, 1 reply; 17+ messages in thread
From: Zhao Liu @ 2024-01-15 9:48 UTC (permalink / raw)
To: Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang
Cc: qemu-devel, Zhao Liu
From: Zhao Liu <zhao1.liu@intel.com>
Remove unused headers in cpu-common.c:
* qemu/notify.h
* qemu/log.h
* qemu/main-loop.h
* exec/cpu-common.h
* qemu/error-report.h
* qemu/qemu-print.h
Though hw/core/cpu.h has been included by sysemu/hw_accel.h, to keep
the dependency clear, still directly include hw/core/cpu.h in this file.
Tested by "./configure" and then "make".
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
hw/core/cpu-common.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c
index 3ccfe882e2c3..bb21dfc03029 100644
--- a/hw/core/cpu-common.c
+++ b/hw/core/cpu-common.c
@@ -19,16 +19,11 @@
*/
#include "qemu/osdep.h"
+
#include "qapi/error.h"
#include "hw/core/cpu.h"
#include "sysemu/hw_accel.h"
-#include "qemu/notify.h"
-#include "qemu/log.h"
-#include "qemu/main-loop.h"
#include "exec/log.h"
-#include "exec/cpu-common.h"
-#include "qemu/error-report.h"
-#include "qemu/qemu-print.h"
#include "sysemu/tcg.h"
#include "hw/boards.h"
#include "hw/qdev-properties.h"
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 03/11] hw/core: Reorder included headers in cpu-common.c
2024-01-15 9:48 [PATCH 00/11] hw/core: Cleanup and reorder headers Zhao Liu
2024-01-15 9:48 ` [PATCH 01/11] MAINTAINERS: Update hw/core/cpu.c entry Zhao Liu
2024-01-15 9:48 ` [PATCH 02/11] hw/core: Cleanup unused included headers in cpu-common.c Zhao Liu
@ 2024-01-15 9:48 ` Zhao Liu
2024-01-15 9:48 ` [PATCH 04/11] hw/core: Reorder included headers in cpu-sysemu.c Zhao Liu
` (7 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Zhao Liu @ 2024-01-15 9:48 UTC (permalink / raw)
To: Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang
Cc: qemu-devel, Zhao Liu
From: Zhao Liu <zhao1.liu@intel.com>
Reorder the header files (except qemu/osdep.h) in alphabetical order.
Tested by "./configure" and then "make".
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
hw/core/cpu-common.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c
index bb21dfc03029..1b785a6965ea 100644
--- a/hw/core/cpu-common.c
+++ b/hw/core/cpu-common.c
@@ -20,15 +20,15 @@
#include "qemu/osdep.h"
-#include "qapi/error.h"
-#include "hw/core/cpu.h"
-#include "sysemu/hw_accel.h"
#include "exec/log.h"
-#include "sysemu/tcg.h"
#include "hw/boards.h"
+#include "hw/core/cpu.h"
#include "hw/qdev-properties.h"
-#include "trace.h"
+#include "qapi/error.h"
#include "qemu/plugin.h"
+#include "sysemu/hw_accel.h"
+#include "sysemu/tcg.h"
+#include "trace.h"
CPUState *cpu_by_arch_id(int64_t id)
{
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 04/11] hw/core: Reorder included headers in cpu-sysemu.c
2024-01-15 9:48 [PATCH 00/11] hw/core: Cleanup and reorder headers Zhao Liu
` (2 preceding siblings ...)
2024-01-15 9:48 ` [PATCH 03/11] hw/core: Reorder " Zhao Liu
@ 2024-01-15 9:48 ` Zhao Liu
2024-01-15 9:48 ` [PATCH 05/11] hw/core: Cleanup unused included headers in machine-qmp-cmds.c Zhao Liu
` (6 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Zhao Liu @ 2024-01-15 9:48 UTC (permalink / raw)
To: Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang
Cc: qemu-devel, Zhao Liu
From: Zhao Liu <zhao1.liu@intel.com>
Reorder the header files (except qemu/osdep.h) in alphabetical order.
Tested by "./configure" and then "make".
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
hw/core/cpu-sysemu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/core/cpu-sysemu.c b/hw/core/cpu-sysemu.c
index d0d6a910f97c..c2cb05830076 100644
--- a/hw/core/cpu-sysemu.c
+++ b/hw/core/cpu-sysemu.c
@@ -19,9 +19,10 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
+
#include "hw/core/cpu.h"
#include "hw/core/sysemu-cpu-ops.h"
+#include "qapi/error.h"
bool cpu_paging_enabled(const CPUState *cpu)
{
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 05/11] hw/core: Cleanup unused included headers in machine-qmp-cmds.c
2024-01-15 9:48 [PATCH 00/11] hw/core: Cleanup and reorder headers Zhao Liu
` (3 preceding siblings ...)
2024-01-15 9:48 ` [PATCH 04/11] hw/core: Reorder included headers in cpu-sysemu.c Zhao Liu
@ 2024-01-15 9:48 ` Zhao Liu
2024-01-15 9:48 ` [PATCH 06/11] hw/core: Cleanup unused included header in machine.c Zhao Liu
` (5 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Zhao Liu @ 2024-01-15 9:48 UTC (permalink / raw)
To: Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang
Cc: qemu-devel, Zhao Liu
From: Zhao Liu <zhao1.liu@intel.com>
Remove unused headers in machine-qmp-cmds.c:
* qemu/main-loop.h
* qemu/uuid.h
* sysemu/hostmem.h
Tested by "./configure" and then "make".
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
hw/core/machine-qmp-cmds.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 3860a50c3b7b..1b2b4cce5386 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -8,6 +8,7 @@
*/
#include "qemu/osdep.h"
+
#include "hw/acpi/vmgenid.h"
#include "hw/boards.h"
#include "hw/intc/intc.h"
@@ -19,10 +20,7 @@
#include "qapi/qmp/qobject.h"
#include "qapi/qobject-input-visitor.h"
#include "qapi/type-helpers.h"
-#include "qemu/main-loop.h"
-#include "qemu/uuid.h"
#include "qom/qom-qobject.h"
-#include "sysemu/hostmem.h"
#include "sysemu/hw_accel.h"
#include "sysemu/numa.h"
#include "sysemu/runstate.h"
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 06/11] hw/core: Cleanup unused included header in machine.c
2024-01-15 9:48 [PATCH 00/11] hw/core: Cleanup and reorder headers Zhao Liu
` (4 preceding siblings ...)
2024-01-15 9:48 ` [PATCH 05/11] hw/core: Cleanup unused included headers in machine-qmp-cmds.c Zhao Liu
@ 2024-01-15 9:48 ` Zhao Liu
2024-01-15 9:48 ` [PATCH 07/11] hw/core: Reorder " Zhao Liu
` (4 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Zhao Liu @ 2024-01-15 9:48 UTC (permalink / raw)
To: Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang
Cc: qemu-devel, Zhao Liu
From: Zhao Liu <zhao1.liu@intel.com>
Remove unused header in cpu-common.c:
* qapi/error.h
Tested by "./configure" and then "make".
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
hw/core/machine.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index fb5afdcae4cc..554c4f5df2da 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -11,11 +11,11 @@
*/
#include "qemu/osdep.h"
+
#include "qemu/accel.h"
#include "sysemu/replay.h"
#include "hw/boards.h"
#include "hw/loader.h"
-#include "qapi/error.h"
#include "qapi/qapi-visit-machine.h"
#include "qom/object_interfaces.h"
#include "sysemu/cpus.h"
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 07/11] hw/core: Reorder included header in machine.c
2024-01-15 9:48 [PATCH 00/11] hw/core: Cleanup and reorder headers Zhao Liu
` (5 preceding siblings ...)
2024-01-15 9:48 ` [PATCH 06/11] hw/core: Cleanup unused included header in machine.c Zhao Liu
@ 2024-01-15 9:48 ` Zhao Liu
2024-01-15 9:48 ` [PATCH 08/11] hw/core: Cleanup unnecessary included header in null-machine.c Zhao Liu
` (3 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Zhao Liu @ 2024-01-15 9:48 UTC (permalink / raw)
To: Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang
Cc: qemu-devel, Zhao Liu
From: Zhao Liu <zhao1.liu@intel.com>
Reorder the header files (except qemu/osdep.h) in alphabetical order.
Tested by "./configure" and then "make".
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
hw/core/machine.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 554c4f5df2da..50e69b1cf1b8 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -12,25 +12,25 @@
#include "qemu/osdep.h"
-#include "qemu/accel.h"
-#include "sysemu/replay.h"
+#include "audio/audio.h"
+#include "exec/confidential-guest-support.h"
#include "hw/boards.h"
#include "hw/loader.h"
+#include "hw/mem/nvdimm.h"
+#include "hw/pci/pci_bridge.h"
+#include "hw/virtio/virtio-net.h"
+#include "hw/virtio/virtio-pci.h"
+#include "migration/global_state.h"
#include "qapi/qapi-visit-machine.h"
+#include "qemu/accel.h"
#include "qom/object_interfaces.h"
#include "sysemu/cpus.h"
+#include "sysemu/qtest.h"
#include "sysemu/sysemu.h"
+#include "sysemu/replay.h"
#include "sysemu/reset.h"
#include "sysemu/runstate.h"
#include "sysemu/xen.h"
-#include "sysemu/qtest.h"
-#include "hw/pci/pci_bridge.h"
-#include "hw/mem/nvdimm.h"
-#include "migration/global_state.h"
-#include "exec/confidential-guest-support.h"
-#include "hw/virtio/virtio-pci.h"
-#include "hw/virtio/virtio-net.h"
-#include "audio/audio.h"
GlobalProperty hw_compat_8_2[] = {};
const size_t hw_compat_8_2_len = G_N_ELEMENTS(hw_compat_8_2);
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 08/11] hw/core: Cleanup unnecessary included header in null-machine.c
2024-01-15 9:48 [PATCH 00/11] hw/core: Cleanup and reorder headers Zhao Liu
` (6 preceding siblings ...)
2024-01-15 9:48 ` [PATCH 07/11] hw/core: Reorder " Zhao Liu
@ 2024-01-15 9:48 ` Zhao Liu
2024-01-15 9:48 ` [PATCH 09/11] hw/core: Reorder included headers " Zhao Liu
` (2 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Zhao Liu @ 2024-01-15 9:48 UTC (permalink / raw)
To: Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang
Cc: qemu-devel, Zhao Liu
From: Zhao Liu <zhao1.liu@intel.com>
Remove the unnecessary header (hw/core/cpu.h) since the hw/boards.h
has already included that header.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
hw/core/null-machine.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c
index f586a4bef543..a0c7acc19cc3 100644
--- a/hw/core/null-machine.c
+++ b/hw/core/null-machine.c
@@ -12,10 +12,10 @@
*/
#include "qemu/osdep.h"
+
#include "qemu/error-report.h"
#include "hw/boards.h"
#include "exec/address-spaces.h"
-#include "hw/core/cpu.h"
static void machine_none_init(MachineState *mch)
{
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 09/11] hw/core: Reorder included headers in null-machine.c
2024-01-15 9:48 [PATCH 00/11] hw/core: Cleanup and reorder headers Zhao Liu
` (7 preceding siblings ...)
2024-01-15 9:48 ` [PATCH 08/11] hw/core: Cleanup unnecessary included header in null-machine.c Zhao Liu
@ 2024-01-15 9:48 ` Zhao Liu
2024-01-15 9:48 ` [PATCH 10/11] hw/core: Cleanup unused included headers in numa.c Zhao Liu
2024-01-15 9:48 ` [PATCH 11/11] hw/core: Reorder " Zhao Liu
10 siblings, 0 replies; 17+ messages in thread
From: Zhao Liu @ 2024-01-15 9:48 UTC (permalink / raw)
To: Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang
Cc: qemu-devel, Zhao Liu
From: Zhao Liu <zhao1.liu@intel.com>
Reorder the header files (except qemu/osdep.h) in alphabetical order.
Tested by "./configure" and then "make".
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
hw/core/null-machine.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c
index a0c7acc19cc3..3d411de3396a 100644
--- a/hw/core/null-machine.c
+++ b/hw/core/null-machine.c
@@ -13,9 +13,9 @@
#include "qemu/osdep.h"
-#include "qemu/error-report.h"
-#include "hw/boards.h"
#include "exec/address-spaces.h"
+#include "hw/boards.h"
+#include "qemu/error-report.h"
static void machine_none_init(MachineState *mch)
{
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 10/11] hw/core: Cleanup unused included headers in numa.c
2024-01-15 9:48 [PATCH 00/11] hw/core: Cleanup and reorder headers Zhao Liu
` (8 preceding siblings ...)
2024-01-15 9:48 ` [PATCH 09/11] hw/core: Reorder included headers " Zhao Liu
@ 2024-01-15 9:48 ` Zhao Liu
2024-01-15 9:48 ` [PATCH 11/11] hw/core: Reorder " Zhao Liu
10 siblings, 0 replies; 17+ messages in thread
From: Zhao Liu @ 2024-01-15 9:48 UTC (permalink / raw)
To: Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang
Cc: qemu-devel, Zhao Liu
From: Zhao Liu <zhao1.liu@intel.com>
Remove unused header in numa.c:
* sysemu/hostmem.h
* exec/cpu-common.h
* exec/ramlist.h
* qemu/bitmap.h
* hw/core/cpu.h
* hw/mem/pc-dimm.h
* migration/vmstate.h
Though sysemu/numa.h has been included by sysemu/hostmem.h which is
included by hw/boards.h, to keep the dependency clear, still directly
include sysemu/numa.h in this file.
Tested by "./configure" and then "make".
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
hw/core/numa.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/hw/core/numa.c b/hw/core/numa.c
index f08956ddb0ff..ab3f2858ac51 100644
--- a/hw/core/numa.c
+++ b/hw/core/numa.c
@@ -23,20 +23,14 @@
*/
#include "qemu/osdep.h"
+
#include "qemu/units.h"
-#include "sysemu/hostmem.h"
#include "sysemu/numa.h"
-#include "exec/cpu-common.h"
-#include "exec/ramlist.h"
-#include "qemu/bitmap.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
#include "qapi/opts-visitor.h"
#include "qapi/qapi-visit-machine.h"
#include "sysemu/qtest.h"
-#include "hw/core/cpu.h"
-#include "hw/mem/pc-dimm.h"
-#include "migration/vmstate.h"
#include "hw/boards.h"
#include "hw/mem/memory-device.h"
#include "qemu/option.h"
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 11/11] hw/core: Reorder included headers in numa.c
2024-01-15 9:48 [PATCH 00/11] hw/core: Cleanup and reorder headers Zhao Liu
` (9 preceding siblings ...)
2024-01-15 9:48 ` [PATCH 10/11] hw/core: Cleanup unused included headers in numa.c Zhao Liu
@ 2024-01-15 9:48 ` Zhao Liu
10 siblings, 0 replies; 17+ messages in thread
From: Zhao Liu @ 2024-01-15 9:48 UTC (permalink / raw)
To: Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang
Cc: qemu-devel, Zhao Liu
From: Zhao Liu <zhao1.liu@intel.com>
Reorder the header files (except qemu/osdep.h) in alphabetical order.
Tested by "./configure" and then "make".
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
hw/core/numa.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/core/numa.c b/hw/core/numa.c
index ab3f2858ac51..aff080d48aa1 100644
--- a/hw/core/numa.c
+++ b/hw/core/numa.c
@@ -24,18 +24,18 @@
#include "qemu/osdep.h"
-#include "qemu/units.h"
+#include "hw/boards.h"
+#include "hw/mem/memory-device.h"
#include "sysemu/numa.h"
-#include "qemu/error-report.h"
+#include "sysemu/qtest.h"
#include "qapi/error.h"
#include "qapi/opts-visitor.h"
#include "qapi/qapi-visit-machine.h"
-#include "sysemu/qtest.h"
-#include "hw/boards.h"
-#include "hw/mem/memory-device.h"
-#include "qemu/option.h"
+#include "qemu/error-report.h"
#include "qemu/config-file.h"
#include "qemu/cutils.h"
+#include "qemu/option.h"
+#include "qemu/units.h"
QemuOptsList qemu_numa_opts = {
.name = "numa",
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 02/11] hw/core: Cleanup unused included headers in cpu-common.c
2024-01-15 9:48 ` [PATCH 02/11] hw/core: Cleanup unused included headers in cpu-common.c Zhao Liu
@ 2024-01-15 10:41 ` Peter Maydell
2024-01-15 14:45 ` Zhao Liu
0 siblings, 1 reply; 17+ messages in thread
From: Peter Maydell @ 2024-01-15 10:41 UTC (permalink / raw)
To: Zhao Liu
Cc: Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang, qemu-devel, Zhao Liu
On Mon, 15 Jan 2024 at 09:37, Zhao Liu <zhao1.liu@linux.intel.com> wrote:
>
> From: Zhao Liu <zhao1.liu@intel.com>
>
> Remove unused headers in cpu-common.c:
> * qemu/notify.h
> * qemu/log.h
> * qemu/main-loop.h
> * exec/cpu-common.h
> * qemu/error-report.h
> * qemu/qemu-print.h
>
> Though hw/core/cpu.h has been included by sysemu/hw_accel.h, to keep
> the dependency clear, still directly include hw/core/cpu.h in this file.
>
> Tested by "./configure" and then "make".
>
> Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
> ---
> hw/core/cpu-common.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
Something seems to be wrong with your analysis of what
includes it is OK to drop. For instance, this file uses
the function qemu_log(), which is why it includes
qemu/log.h.
thanks
-- PMM
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 01/11] MAINTAINERS: Update hw/core/cpu.c entry
2024-01-15 9:48 ` [PATCH 01/11] MAINTAINERS: Update hw/core/cpu.c entry Zhao Liu
@ 2024-01-15 11:09 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 17+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-15 11:09 UTC (permalink / raw)
To: Zhao Liu, Eduardo Habkost, Marcel Apfelbaum, Yanan Wang
Cc: qemu-devel, Zhao Liu
On 15/1/24 10:48, Zhao Liu wrote:
> From: Zhao Liu <zhao1.liu@intel.com>
>
> The hw/core/cpu.c was split as hw/core/cpu-common.c and
> hw/core/cpu-sysemu.c in the commit df4fd7d5c8a3 ("cpu: Split as
> cpu-common / cpu-sysemu").
>
> Update the related entry.
>
> Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
> ---
> MAINTAINERS | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Oops, thanks!
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 02/11] hw/core: Cleanup unused included headers in cpu-common.c
2024-01-15 10:41 ` Peter Maydell
@ 2024-01-15 14:45 ` Zhao Liu
2024-01-15 16:07 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 17+ messages in thread
From: Zhao Liu @ 2024-01-15 14:45 UTC (permalink / raw)
To: Peter Maydell
Cc: Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang, qemu-devel, Zhao Liu
Hi Peter,
On Mon, Jan 15, 2024 at 10:41:48AM +0000, Peter Maydell wrote:
> Date: Mon, 15 Jan 2024 10:41:48 +0000
> From: Peter Maydell <peter.maydell@linaro.org>
> Subject: Re: [PATCH 02/11] hw/core: Cleanup unused included headers in
> cpu-common.c
>
> On Mon, 15 Jan 2024 at 09:37, Zhao Liu <zhao1.liu@linux.intel.com> wrote:
> >
> > From: Zhao Liu <zhao1.liu@intel.com>
> >
> > Remove unused headers in cpu-common.c:
> > * qemu/notify.h
> > * qemu/log.h
> > * qemu/main-loop.h
> > * exec/cpu-common.h
> > * qemu/error-report.h
> > * qemu/qemu-print.h
> >
> > Though hw/core/cpu.h has been included by sysemu/hw_accel.h, to keep
> > the dependency clear, still directly include hw/core/cpu.h in this file.
> >
> > Tested by "./configure" and then "make".
> >
> > Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
> > ---
> > hw/core/cpu-common.c | 7 +------
> > 1 file changed, 1 insertion(+), 6 deletions(-)
>
> Something seems to be wrong with your analysis of what
> includes it is OK to drop. For instance, this file uses
> the function qemu_log(), which is why it includes
> qemu/log.h.
>
I'm not sure about this, since qemu/log.h has been included by exec/log.h,
so could we just include exec/log.h and omit qemu/log.h in this file?
It seems enough for the compilation to omit qemu/log.h and only include
exec/log.h.
Regards,
Zhao
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 02/11] hw/core: Cleanup unused included headers in cpu-common.c
2024-01-15 14:45 ` Zhao Liu
@ 2024-01-15 16:07 ` Philippe Mathieu-Daudé
2024-01-15 16:36 ` Zhao Liu
0 siblings, 1 reply; 17+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-15 16:07 UTC (permalink / raw)
To: Zhao Liu, Peter Maydell
Cc: Eduardo Habkost, Marcel Apfelbaum, Yanan Wang, qemu-devel,
Zhao Liu
On 15/1/24 15:45, Zhao Liu wrote:
> Hi Peter,
>
> On Mon, Jan 15, 2024 at 10:41:48AM +0000, Peter Maydell wrote:
>> Date: Mon, 15 Jan 2024 10:41:48 +0000
>> From: Peter Maydell <peter.maydell@linaro.org>
>> Subject: Re: [PATCH 02/11] hw/core: Cleanup unused included headers in
>> cpu-common.c
>>
>> On Mon, 15 Jan 2024 at 09:37, Zhao Liu <zhao1.liu@linux.intel.com> wrote:
>>>
>>> From: Zhao Liu <zhao1.liu@intel.com>
>>>
>>> Remove unused headers in cpu-common.c:
>>> * qemu/notify.h
>>> * qemu/log.h
>>> * qemu/main-loop.h
>>> * exec/cpu-common.h
>>> * qemu/error-report.h
>>> * qemu/qemu-print.h
>>>
>>> Though hw/core/cpu.h has been included by sysemu/hw_accel.h, to keep
>>> the dependency clear, still directly include hw/core/cpu.h in this file.
>>>
>>> Tested by "./configure" and then "make".
>>>
>>> Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
>>> ---
>>> hw/core/cpu-common.c | 7 +------
>>> 1 file changed, 1 insertion(+), 6 deletions(-)
>>
>> Something seems to be wrong with your analysis of what
>> includes it is OK to drop. For instance, this file uses
>> the function qemu_log(), which is why it includes
>> qemu/log.h.
>>
>
> I'm not sure about this, since qemu/log.h has been included by exec/log.h,
> so could we just include exec/log.h and omit qemu/log.h in this file?
We try to avoid implicit header inclusions, because if "exec/log.h" is
reworked and "qemu/log.h" removed, then files using declarations
implicitly declared start to fail building, and we need to clean
unrelated files.
> It seems enough for the compilation to omit qemu/log.h and only include
> exec/log.h.
>
> Regards,
> Zhao
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 02/11] hw/core: Cleanup unused included headers in cpu-common.c
2024-01-15 16:07 ` Philippe Mathieu-Daudé
@ 2024-01-15 16:36 ` Zhao Liu
0 siblings, 0 replies; 17+ messages in thread
From: Zhao Liu @ 2024-01-15 16:36 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Peter Maydell, Eduardo Habkost, Marcel Apfelbaum, Yanan Wang,
qemu-devel, Zhao Liu
On Mon, Jan 15, 2024 at 05:07:52PM +0100, Philippe Mathieu-Daudé wrote:
> Date: Mon, 15 Jan 2024 17:07:52 +0100
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: Re: [PATCH 02/11] hw/core: Cleanup unused included headers in
> cpu-common.c
>
> On 15/1/24 15:45, Zhao Liu wrote:
> > Hi Peter,
> >
> > On Mon, Jan 15, 2024 at 10:41:48AM +0000, Peter Maydell wrote:
> > > Date: Mon, 15 Jan 2024 10:41:48 +0000
> > > From: Peter Maydell <peter.maydell@linaro.org>
> > > Subject: Re: [PATCH 02/11] hw/core: Cleanup unused included headers in
> > > cpu-common.c
> > >
> > > On Mon, 15 Jan 2024 at 09:37, Zhao Liu <zhao1.liu@linux.intel.com> wrote:
> > > >
> > > > From: Zhao Liu <zhao1.liu@intel.com>
> > > >
> > > > Remove unused headers in cpu-common.c:
> > > > * qemu/notify.h
> > > > * qemu/log.h
> > > > * qemu/main-loop.h
> > > > * exec/cpu-common.h
> > > > * qemu/error-report.h
> > > > * qemu/qemu-print.h
> > > >
> > > > Though hw/core/cpu.h has been included by sysemu/hw_accel.h, to keep
> > > > the dependency clear, still directly include hw/core/cpu.h in this file.
> > > >
> > > > Tested by "./configure" and then "make".
> > > >
> > > > Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
> > > > ---
> > > > hw/core/cpu-common.c | 7 +------
> > > > 1 file changed, 1 insertion(+), 6 deletions(-)
> > >
> > > Something seems to be wrong with your analysis of what
> > > includes it is OK to drop. For instance, this file uses
> > > the function qemu_log(), which is why it includes
> > > qemu/log.h.
> > >
> >
> > I'm not sure about this, since qemu/log.h has been included by exec/log.h,
> > so could we just include exec/log.h and omit qemu/log.h in this file?
>
> We try to avoid implicit header inclusions, because if "exec/log.h" is
> reworked and "qemu/log.h" removed, then files using declarations
> implicitly declared start to fail building, and we need to clean
> unrelated files.
Thanks! I see. Let me rework this series.
Regards,
Zhao
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2024-01-15 16:24 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-15 9:48 [PATCH 00/11] hw/core: Cleanup and reorder headers Zhao Liu
2024-01-15 9:48 ` [PATCH 01/11] MAINTAINERS: Update hw/core/cpu.c entry Zhao Liu
2024-01-15 11:09 ` Philippe Mathieu-Daudé
2024-01-15 9:48 ` [PATCH 02/11] hw/core: Cleanup unused included headers in cpu-common.c Zhao Liu
2024-01-15 10:41 ` Peter Maydell
2024-01-15 14:45 ` Zhao Liu
2024-01-15 16:07 ` Philippe Mathieu-Daudé
2024-01-15 16:36 ` Zhao Liu
2024-01-15 9:48 ` [PATCH 03/11] hw/core: Reorder " Zhao Liu
2024-01-15 9:48 ` [PATCH 04/11] hw/core: Reorder included headers in cpu-sysemu.c Zhao Liu
2024-01-15 9:48 ` [PATCH 05/11] hw/core: Cleanup unused included headers in machine-qmp-cmds.c Zhao Liu
2024-01-15 9:48 ` [PATCH 06/11] hw/core: Cleanup unused included header in machine.c Zhao Liu
2024-01-15 9:48 ` [PATCH 07/11] hw/core: Reorder " Zhao Liu
2024-01-15 9:48 ` [PATCH 08/11] hw/core: Cleanup unnecessary included header in null-machine.c Zhao Liu
2024-01-15 9:48 ` [PATCH 09/11] hw/core: Reorder included headers " Zhao Liu
2024-01-15 9:48 ` [PATCH 10/11] hw/core: Cleanup unused included headers in numa.c Zhao Liu
2024-01-15 9:48 ` [PATCH 11/11] hw/core: Reorder " Zhao Liu
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).