All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] misc: clean up includes
@ 2026-01-16 12:58 Peter Maydell
  2026-01-16 12:58 ` [PATCH 1/4] mshv: Clean " Peter Maydell
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Peter Maydell @ 2026-01-16 12:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Magnus Kulke, Wei Liu, Warner Losh, Kyle Evans, Richard Henderson,
	Helge Deller, Michael Roth, Kostiantyn Kostiuk, Marcelo Tosatti

This patchset is the result of running scripts/clean-includes
as updated with my changes in the v2 patchset I just posted:
https://patchew.org/QEMU/20260116124005.925382-1-peter.maydell@linaro.org/

It makes the usual set of cleanups to #include lines:
    * Ensure .c files include qemu/osdep.h first.
    * Including it in a .h is redundant, since the .c  already includes
      it.  Drop such inclusions.
    * Likewise, including headers qemu/osdep.h includes is redundant.
      Drop these, too.

I have split the changes it proposes into five categories:
 (1) changes to mshv related files
 (2) changes to bsd-user files
 (3) changes where a .c file included a system header that
     osdep.h already provides
 (4) changes where .h files either included osdep.h or
     else some system header that osdep.h provides

The only change the updated script proposes which is not in
any patch in this series is to hw/virtio/cbor-helpers.c: I am
waiting to find out if we should put this file on the
exclude-list.

thanks
-- PMM

Peter Maydell (4):
  mshv: Clean up includes
  bsd-user: Clean up includes
  misc: Clean up includes
  all: Clean up includes

 accel/mshv/irq.c                   | 3 +--
 accel/mshv/mshv-all.c              | 1 -
 bsd-user/bsd-mem.h                 | 3 ---
 bsd-user/bsd-proc.c                | 1 -
 bsd-user/freebsd/os-proc.h         | 2 --
 bsd-user/qemu-bsd.h                | 1 -
 hw/core/machine-qmp-cmds.c         | 1 -
 hw/scsi/lasi_ncr710.h              | 1 -
 hw/scsi/ncr53c710.h                | 1 -
 include/hw/core/loader.h           | 1 -
 include/hw/i386/tdvf.h             | 1 -
 include/hw/ppc/spapr_fadump.h      | 1 -
 include/hw/riscv/iommu.h           | 1 -
 include/system/accel-irq.h         | 1 -
 include/system/mshv.h              | 1 -
 linux-user/alpha/target_proc.h     | 1 -
 qga/commands-windows-ssh.h         | 1 -
 qga/vss-win32/vss-debug.h          | 1 -
 semihosting/arm-compat-semi-stub.c | 1 -
 target/arm/cpu32-stubs.c           | 1 -
 target/i386/kvm/kvm.c              | 1 -
 target/i386/kvm/vmsr_energy.h      | 2 --
 target/i386/mshv/mshv-cpu.c        | 1 -
 target/i386/mshv/x86.c             | 1 -
 target/loongarch/csr.c             | 1 -
 target/riscv/csr.c                 | 1 -
 tools/i386/qemu-vmsr-helper.c      | 1 -
 util/cpuinfo-aarch64.c             | 1 -
 28 files changed, 1 insertion(+), 33 deletions(-)

-- 
2.47.3



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/4] mshv: Clean up includes
  2026-01-16 12:58 [PATCH 0/4] misc: clean up includes Peter Maydell
@ 2026-01-16 12:58 ` Peter Maydell
  2026-01-16 13:07   ` Philippe Mathieu-Daudé
  2026-01-16 12:58 ` [PATCH 2/4] bsd-user: " Peter Maydell
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Peter Maydell @ 2026-01-16 12:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Magnus Kulke, Wei Liu, Warner Losh, Kyle Evans, Richard Henderson,
	Helge Deller, Michael Roth, Kostiantyn Kostiuk, Marcelo Tosatti

This commit was created with scripts/clean-includes:
 ./scripts/clean-includes '--git' 'mshv' 'accel/mshv' 'target/i386/mshv' 'include/system/mshv.h'

All .c should include qemu/osdep.h first.  The script performs three
related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c  already includes
  it.  Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant.
  Drop these, too.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 accel/mshv/irq.c            | 3 +--
 accel/mshv/mshv-all.c       | 1 -
 include/system/mshv.h       | 1 -
 target/i386/mshv/mshv-cpu.c | 1 -
 target/i386/mshv/x86.c      | 1 -
 5 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/accel/mshv/irq.c b/accel/mshv/irq.c
index adf8f337d9..3c238c33c3 100644
--- a/accel/mshv/irq.c
+++ b/accel/mshv/irq.c
@@ -10,8 +10,8 @@
  * SPDX-License-Identifier: GPL-2.0-or-later
  */
 
-#include "linux/mshv.h"
 #include "qemu/osdep.h"
+#include "linux/mshv.h"
 #include "qemu/error-report.h"
 #include "hw/hyperv/hvhdk_mini.h"
 #include "hw/hyperv/hvgdk_mini.h"
@@ -20,7 +20,6 @@
 #include "system/mshv.h"
 #include "system/mshv_int.h"
 #include "trace.h"
-#include <stdint.h>
 #include <sys/ioctl.h>
 
 #define MSHV_IRQFD_RESAMPLE_FLAG (1 << MSHV_IRQFD_BIT_RESAMPLE)
diff --git a/accel/mshv/mshv-all.c b/accel/mshv/mshv-all.c
index 4675cb886f..bed0fa298e 100644
--- a/accel/mshv/mshv-all.c
+++ b/accel/mshv/mshv-all.c
@@ -41,7 +41,6 @@
 #include "system/reset.h"
 #include "trace.h"
 #include <err.h>
-#include <stdint.h>
 #include <sys/ioctl.h>
 
 #define TYPE_MSHV_ACCEL ACCEL_CLASS_NAME("mshv")
diff --git a/include/system/mshv.h b/include/system/mshv.h
index 8b1fc20c80..75286baf16 100644
--- a/include/system/mshv.h
+++ b/include/system/mshv.h
@@ -14,7 +14,6 @@
 #ifndef QEMU_MSHV_H
 #define QEMU_MSHV_H
 
-#include "qemu/osdep.h"
 #include "qemu/accel.h"
 #include "hw/hyperv/hyperv-proto.h"
 #include "hw/hyperv/hvhdk.h"
diff --git a/target/i386/mshv/mshv-cpu.c b/target/i386/mshv/mshv-cpu.c
index 1c3db02188..586383b882 100644
--- a/target/i386/mshv/mshv-cpu.c
+++ b/target/i386/mshv/mshv-cpu.c
@@ -13,7 +13,6 @@
 #include "qemu/osdep.h"
 #include "qemu/error-report.h"
 #include "qemu/memalign.h"
-#include "qemu/typedefs.h"
 
 #include "system/mshv.h"
 #include "system/mshv_int.h"
diff --git a/target/i386/mshv/x86.c b/target/i386/mshv/x86.c
index d574b3bc52..0700cc05ef 100644
--- a/target/i386/mshv/x86.c
+++ b/target/i386/mshv/x86.c
@@ -13,7 +13,6 @@
 #include "cpu.h"
 #include "emulate/x86_decode.h"
 #include "emulate/x86_emu.h"
-#include "qemu/typedefs.h"
 #include "qemu/error-report.h"
 #include "system/mshv.h"
 
-- 
2.47.3



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/4] bsd-user: Clean up includes
  2026-01-16 12:58 [PATCH 0/4] misc: clean up includes Peter Maydell
  2026-01-16 12:58 ` [PATCH 1/4] mshv: Clean " Peter Maydell
@ 2026-01-16 12:58 ` Peter Maydell
  2026-01-16 13:06   ` Philippe Mathieu-Daudé
  2026-01-16 14:28   ` Warner Losh
  2026-01-16 12:58 ` [PATCH 3/4] misc: " Peter Maydell
  2026-01-16 12:58 ` [PATCH 4/4] all: " Peter Maydell
  3 siblings, 2 replies; 11+ messages in thread
From: Peter Maydell @ 2026-01-16 12:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Magnus Kulke, Wei Liu, Warner Losh, Kyle Evans, Richard Henderson,
	Helge Deller, Michael Roth, Kostiantyn Kostiuk, Marcelo Tosatti

This commit was created with scripts/clean-includes:
 ./scripts/clean-includes '--git' 'bsd-user' 'bsd-user'

All .c should include qemu/osdep.h first.  The script performs three
related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c  already includes
  it.  Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant.
  Drop these, too.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 bsd-user/bsd-mem.h         | 3 ---
 bsd-user/bsd-proc.c        | 1 -
 bsd-user/freebsd/os-proc.h | 2 --
 bsd-user/qemu-bsd.h        | 1 -
 4 files changed, 7 deletions(-)

diff --git a/bsd-user/bsd-mem.h b/bsd-user/bsd-mem.h
index 416d0f8c23..a118e57260 100644
--- a/bsd-user/bsd-mem.h
+++ b/bsd-user/bsd-mem.h
@@ -49,11 +49,8 @@
 #ifndef BSD_USER_BSD_MEM_H
 #define BSD_USER_BSD_MEM_H
 
-#include <sys/types.h>
 #include <sys/ipc.h>
-#include <sys/mman.h>
 #include <sys/shm.h>
-#include <fcntl.h>
 
 #include "qemu-bsd.h"
 #include "exec/mmap-lock.h"
diff --git a/bsd-user/bsd-proc.c b/bsd-user/bsd-proc.c
index ca3c1bf94f..8dcac9608d 100644
--- a/bsd-user/bsd-proc.c
+++ b/bsd-user/bsd-proc.c
@@ -19,7 +19,6 @@
 #include "qemu/osdep.h"
 
 #include <sys/param.h>
-#include <sys/types.h>
 #include <sys/cpuset.h>
 #include <sys/resource.h>
 #include <sys/wait.h>
diff --git a/bsd-user/freebsd/os-proc.h b/bsd-user/freebsd/os-proc.h
index 3003c8cb63..cc53215138 100644
--- a/bsd-user/freebsd/os-proc.h
+++ b/bsd-user/freebsd/os-proc.h
@@ -23,10 +23,8 @@
 #include <sys/param.h>
 #include <sys/procctl.h>
 #include <sys/signal.h>
-#include <sys/types.h>
 #include <sys/procdesc.h>
 #include <sys/wait.h>
-#include <unistd.h>
 
 #include "target_arch_cpu.h"
 
diff --git a/bsd-user/qemu-bsd.h b/bsd-user/qemu-bsd.h
index ffc64bb244..56affcd31d 100644
--- a/bsd-user/qemu-bsd.h
+++ b/bsd-user/qemu-bsd.h
@@ -20,7 +20,6 @@
 #ifndef QEMU_BSD_H
 #define QEMU_BSD_H
 
-#include <sys/types.h>
 #include <sys/resource.h>
 #include <sys/ipc.h>
 #include <sys/msg.h>
-- 
2.47.3



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/4] misc: Clean up includes
  2026-01-16 12:58 [PATCH 0/4] misc: clean up includes Peter Maydell
  2026-01-16 12:58 ` [PATCH 1/4] mshv: Clean " Peter Maydell
  2026-01-16 12:58 ` [PATCH 2/4] bsd-user: " Peter Maydell
@ 2026-01-16 12:58 ` Peter Maydell
  2026-01-16 13:20   ` Markus Armbruster
  2026-01-16 13:37   ` Philippe Mathieu-Daudé
  2026-01-16 12:58 ` [PATCH 4/4] all: " Peter Maydell
  3 siblings, 2 replies; 11+ messages in thread
From: Peter Maydell @ 2026-01-16 12:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Magnus Kulke, Wei Liu, Warner Losh, Kyle Evans, Richard Henderson,
	Helge Deller, Michael Roth, Kostiantyn Kostiuk, Marcelo Tosatti

This commit deals with various .c files that included system
headers that are already pulled in by osdep.h, where the .c
file includes osdep.h already itself.

This commit was created with scripts/clean-includes:
 ./scripts/clean-includes '--git' 'misc' 'hw/core' 'semihosting' 'target/arm' 'target/i386/kvm/kvm.c' 'target/loongarch' 'target/riscv' 'tools' 'util'

All .c should include qemu/osdep.h first.  The script performs three
related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c  already includes
  it.  Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant.
  Drop these, too.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/core/machine-qmp-cmds.c         | 1 -
 semihosting/arm-compat-semi-stub.c | 1 -
 target/arm/cpu32-stubs.c           | 1 -
 target/i386/kvm/kvm.c              | 1 -
 target/loongarch/csr.c             | 1 -
 target/riscv/csr.c                 | 1 -
 tools/i386/qemu-vmsr-helper.c      | 1 -
 util/cpuinfo-aarch64.c             | 1 -
 8 files changed, 8 deletions(-)

diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 79cbcdd63e..e62cb4ec88 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -30,7 +30,6 @@
 #include "system/runstate.h"
 #include "system/system.h"
 #include "hw/s390x/storage-keys.h"
-#include <sys/stat.h>
 
 /*
  * QMP query for enabled and present accelerators
diff --git a/semihosting/arm-compat-semi-stub.c b/semihosting/arm-compat-semi-stub.c
index bfa3681e26..40199c9842 100644
--- a/semihosting/arm-compat-semi-stub.c
+++ b/semihosting/arm-compat-semi-stub.c
@@ -6,7 +6,6 @@
 
 #include "qemu/osdep.h"
 #include "semihosting/semihost.h"
-#include <glib.h>
 
 bool semihosting_arm_compatible(void)
 {
diff --git a/target/arm/cpu32-stubs.c b/target/arm/cpu32-stubs.c
index f0ce159572..9e50bb1b0b 100644
--- a/target/arm/cpu32-stubs.c
+++ b/target/arm/cpu32-stubs.c
@@ -3,7 +3,6 @@
 #include "qemu/osdep.h"
 #include "target/arm/cpu.h"
 #include "target/arm/internals.h"
-#include <glib.h>
 
 void arm_cpu_sme_finalize(ARMCPU *cpu, Error **errp)
 {
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 7b9b740a8e..0c940d4b64 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -21,7 +21,6 @@
 #include <sys/utsname.h>
 #include <sys/syscall.h>
 #include <sys/resource.h>
-#include <sys/time.h>
 
 #include <linux/kvm.h>
 #include <linux/kvm_para.h>
diff --git a/target/loongarch/csr.c b/target/loongarch/csr.c
index 332a1396cc..fff2312f87 100644
--- a/target/loongarch/csr.c
+++ b/target/loongarch/csr.c
@@ -2,7 +2,6 @@
 /*
  * Copyright (c) 2025 Loongson Technology Corporation Limited
  */
-#include <stddef.h>
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "csr.h"
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index 05c7ec8352..5064483917 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -31,7 +31,6 @@
 #include "qapi/error.h"
 #include "tcg/insn-start-words.h"
 #include "internals.h"
-#include <stdbool.h>
 
 /* CSR function table public API */
 void riscv_get_csr_ops(int csrno, riscv_csr_operations *ops)
diff --git a/tools/i386/qemu-vmsr-helper.c b/tools/i386/qemu-vmsr-helper.c
index 6c0f4fe870..f12fd3c3e8 100644
--- a/tools/i386/qemu-vmsr-helper.c
+++ b/tools/i386/qemu-vmsr-helper.c
@@ -20,7 +20,6 @@
 
 #include "qemu/osdep.h"
 #include <getopt.h>
-#include <stdbool.h>
 #include <sys/ioctl.h>
 #ifdef CONFIG_LIBCAP_NG
 #include <cap-ng.h>
diff --git a/util/cpuinfo-aarch64.c b/util/cpuinfo-aarch64.c
index 57468890c3..288074c08f 100644
--- a/util/cpuinfo-aarch64.c
+++ b/util/cpuinfo-aarch64.c
@@ -26,7 +26,6 @@
 #if defined(__OpenBSD__) && !defined(CONFIG_ELF_AUX_INFO)
 # include <machine/armreg.h>
 # include <machine/cpu.h>
-# include <sys/types.h>
 # include <sys/sysctl.h>
 #endif
 
-- 
2.47.3



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/4] all: Clean up includes
  2026-01-16 12:58 [PATCH 0/4] misc: clean up includes Peter Maydell
                   ` (2 preceding siblings ...)
  2026-01-16 12:58 ` [PATCH 3/4] misc: " Peter Maydell
@ 2026-01-16 12:58 ` Peter Maydell
  2026-01-16 13:06   ` Philippe Mathieu-Daudé
  3 siblings, 1 reply; 11+ messages in thread
From: Peter Maydell @ 2026-01-16 12:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Magnus Kulke, Wei Liu, Warner Losh, Kyle Evans, Richard Henderson,
	Helge Deller, Michael Roth, Kostiantyn Kostiuk, Marcelo Tosatti

This commit was created with scripts/clean-includes:
 ./scripts/clean-includes '--git' 'all' '--all'

and manually edited to remove one change to hw/virtio/cbor-helpers.c.
All these changes are header files that include osdep.h or some
system header that osdep.h pulls in; they don't need to do this.

All .c should include qemu/osdep.h first.  The script performs three
related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c  already includes
  it.  Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant.
  Drop these, too.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/scsi/lasi_ncr710.h          | 1 -
 hw/scsi/ncr53c710.h            | 1 -
 include/hw/core/loader.h       | 1 -
 include/hw/i386/tdvf.h         | 1 -
 include/hw/ppc/spapr_fadump.h  | 1 -
 include/hw/riscv/iommu.h       | 1 -
 include/system/accel-irq.h     | 1 -
 linux-user/alpha/target_proc.h | 1 -
 qga/commands-windows-ssh.h     | 1 -
 qga/vss-win32/vss-debug.h      | 1 -
 target/i386/kvm/vmsr_energy.h  | 2 --
 11 files changed, 12 deletions(-)

diff --git a/hw/scsi/lasi_ncr710.h b/hw/scsi/lasi_ncr710.h
index 99be001fc3..450fb7e1c3 100644
--- a/hw/scsi/lasi_ncr710.h
+++ b/hw/scsi/lasi_ncr710.h
@@ -15,7 +15,6 @@
 #define HW_LASI_NCR710_H
 
 #include "hw/core/sysbus.h"
-#include "qemu/osdep.h"
 #include "exec/memattrs.h"
 #include "hw/scsi/scsi.h"
 #include "hw/scsi/ncr53c710.h"
diff --git a/hw/scsi/ncr53c710.h b/hw/scsi/ncr53c710.h
index a8dc92f4ef..00b6a01577 100644
--- a/hw/scsi/ncr53c710.h
+++ b/hw/scsi/ncr53c710.h
@@ -15,7 +15,6 @@
 #ifndef HW_NCR53C710_H
 #define HW_NCR53C710_H
 
-#include "qemu/osdep.h"
 #include "hw/core/sysbus.h"
 #include "hw/scsi/scsi.h"
 #include "qemu/fifo8.h"
diff --git a/include/hw/core/loader.h b/include/hw/core/loader.h
index 6f91703503..4abd55a64b 100644
--- a/include/hw/core/loader.h
+++ b/include/hw/core/loader.h
@@ -1,7 +1,6 @@
 #ifndef LOADER_H
 #define LOADER_H
 #include "hw/nvram/fw_cfg.h"
-#include "qemu/typedefs.h"
 
 /* loader.c */
 /**
diff --git a/include/hw/i386/tdvf.h b/include/hw/i386/tdvf.h
index e75c8d1acc..4d7362ad65 100644
--- a/include/hw/i386/tdvf.h
+++ b/include/hw/i386/tdvf.h
@@ -9,7 +9,6 @@
 #ifndef HW_I386_TDVF_H
 #define HW_I386_TDVF_H
 
-#include "qemu/osdep.h"
 
 #define TDVF_SECTION_TYPE_BFV               0
 #define TDVF_SECTION_TYPE_CFV               1
diff --git a/include/hw/ppc/spapr_fadump.h b/include/hw/ppc/spapr_fadump.h
index fde2830e94..82681fb9a6 100644
--- a/include/hw/ppc/spapr_fadump.h
+++ b/include/hw/ppc/spapr_fadump.h
@@ -6,7 +6,6 @@
 #ifndef PPC_SPAPR_FADUMP_H
 #define PPC_SPAPR_FADUMP_H
 
-#include "qemu/osdep.h"
 #include "cpu.h"
 
 /* Fadump commands */
diff --git a/include/hw/riscv/iommu.h b/include/hw/riscv/iommu.h
index 25f1a8b159..999384fc89 100644
--- a/include/hw/riscv/iommu.h
+++ b/include/hw/riscv/iommu.h
@@ -19,7 +19,6 @@
 #ifndef HW_RISCV_IOMMU_H
 #define HW_RISCV_IOMMU_H
 
-#include "qemu/osdep.h"
 #include "qom/object.h"
 
 #define TYPE_RISCV_IOMMU "riscv-iommu"
diff --git a/include/system/accel-irq.h b/include/system/accel-irq.h
index 671fb7dfdb..a2caa06f54 100644
--- a/include/system/accel-irq.h
+++ b/include/system/accel-irq.h
@@ -12,7 +12,6 @@
 #ifndef SYSTEM_ACCEL_IRQ_H
 #define SYSTEM_ACCEL_IRQ_H
 #include "hw/pci/msi.h"
-#include "qemu/osdep.h"
 #include "system/kvm.h"
 #include "system/mshv.h"
 
diff --git a/linux-user/alpha/target_proc.h b/linux-user/alpha/target_proc.h
index 6b491ffa3a..71949d380d 100644
--- a/linux-user/alpha/target_proc.h
+++ b/linux-user/alpha/target_proc.h
@@ -6,7 +6,6 @@
 #ifndef ALPHA_TARGET_PROC_H
 #define ALPHA_TARGET_PROC_H
 
-#include "qemu/osdep.h"
 #include "target/alpha/cpu.h"
 
 static uint8_t alpha_phys_addr_space_bits(CPUAlphaState *env)
diff --git a/qga/commands-windows-ssh.h b/qga/commands-windows-ssh.h
index 40ac67c4d9..c35d945a89 100644
--- a/qga/commands-windows-ssh.h
+++ b/qga/commands-windows-ssh.h
@@ -11,7 +11,6 @@
  */
 
 #include <glib/gstrfuncs.h>
-#include <stdbool.h>
 typedef struct WindowsUserInfo {
     char *sshDirectory;
     char *authorizedKeyFile;
diff --git a/qga/vss-win32/vss-debug.h b/qga/vss-win32/vss-debug.h
index 7800457392..506cee6698 100644
--- a/qga/vss-win32/vss-debug.h
+++ b/qga/vss-win32/vss-debug.h
@@ -10,7 +10,6 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include "qemu/osdep.h"
 #include <vss-handles.h>
 
 #ifndef VSS_DEBUG_H
diff --git a/target/i386/kvm/vmsr_energy.h b/target/i386/kvm/vmsr_energy.h
index 151bcbd642..415d64f51c 100644
--- a/target/i386/kvm/vmsr_energy.h
+++ b/target/i386/kvm/vmsr_energy.h
@@ -14,8 +14,6 @@
 #ifndef VMSR_ENERGY_H
 #define VMSR_ENERGY_H
 
-#include <stdint.h>
-#include "qemu/osdep.h"
 #include "io/channel-socket.h"
 #include "hw/i386/topology.h"
 
-- 
2.47.3



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4] all: Clean up includes
  2026-01-16 12:58 ` [PATCH 4/4] all: " Peter Maydell
@ 2026-01-16 13:06   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 11+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-01-16 13:06 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Magnus Kulke, Wei Liu, Warner Losh, Kyle Evans, Richard Henderson,
	Helge Deller, Michael Roth, Kostiantyn Kostiuk, Marcelo Tosatti

On 16/1/26 13:58, Peter Maydell wrote:
> This commit was created with scripts/clean-includes:
>   ./scripts/clean-includes '--git' 'all' '--all'
> 
> and manually edited to remove one change to hw/virtio/cbor-helpers.c.
> All these changes are header files that include osdep.h or some
> system header that osdep.h pulls in; they don't need to do this.
> 
> All .c should include qemu/osdep.h first.  The script performs three
> related cleanups:
> 
> * Ensure .c files include qemu/osdep.h first.
> * Including it in a .h is redundant, since the .c  already includes
>    it.  Drop such inclusions.
> * Likewise, including headers qemu/osdep.h includes is redundant.
>    Drop these, too.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   hw/scsi/lasi_ncr710.h          | 1 -
>   hw/scsi/ncr53c710.h            | 1 -
>   include/hw/core/loader.h       | 1 -
>   include/hw/i386/tdvf.h         | 1 -
>   include/hw/ppc/spapr_fadump.h  | 1 -
>   include/hw/riscv/iommu.h       | 1 -
>   include/system/accel-irq.h     | 1 -
>   linux-user/alpha/target_proc.h | 1 -
>   qga/commands-windows-ssh.h     | 1 -
>   qga/vss-win32/vss-debug.h      | 1 -
>   target/i386/kvm/vmsr_energy.h  | 2 --
>   11 files changed, 12 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] bsd-user: Clean up includes
  2026-01-16 12:58 ` [PATCH 2/4] bsd-user: " Peter Maydell
@ 2026-01-16 13:06   ` Philippe Mathieu-Daudé
  2026-01-16 14:28   ` Warner Losh
  1 sibling, 0 replies; 11+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-01-16 13:06 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Magnus Kulke, Wei Liu, Warner Losh, Kyle Evans, Richard Henderson,
	Helge Deller, Michael Roth, Kostiantyn Kostiuk, Marcelo Tosatti

On 16/1/26 13:58, Peter Maydell wrote:
> This commit was created with scripts/clean-includes:
>   ./scripts/clean-includes '--git' 'bsd-user' 'bsd-user'
> 
> All .c should include qemu/osdep.h first.  The script performs three
> related cleanups:
> 
> * Ensure .c files include qemu/osdep.h first.
> * Including it in a .h is redundant, since the .c  already includes
>    it.  Drop such inclusions.
> * Likewise, including headers qemu/osdep.h includes is redundant.
>    Drop these, too.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   bsd-user/bsd-mem.h         | 3 ---
>   bsd-user/bsd-proc.c        | 1 -
>   bsd-user/freebsd/os-proc.h | 2 --
>   bsd-user/qemu-bsd.h        | 1 -
>   4 files changed, 7 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/4] mshv: Clean up includes
  2026-01-16 12:58 ` [PATCH 1/4] mshv: Clean " Peter Maydell
@ 2026-01-16 13:07   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 11+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-01-16 13:07 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Magnus Kulke, Wei Liu, Warner Losh, Kyle Evans, Richard Henderson,
	Helge Deller, Michael Roth, Kostiantyn Kostiuk, Marcelo Tosatti

On 16/1/26 13:58, Peter Maydell wrote:
> This commit was created with scripts/clean-includes:
>   ./scripts/clean-includes '--git' 'mshv' 'accel/mshv' 'target/i386/mshv' 'include/system/mshv.h'
> 
> All .c should include qemu/osdep.h first.  The script performs three
> related cleanups:
> 
> * Ensure .c files include qemu/osdep.h first.
> * Including it in a .h is redundant, since the .c  already includes
>    it.  Drop such inclusions.
> * Likewise, including headers qemu/osdep.h includes is redundant.
>    Drop these, too.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   accel/mshv/irq.c            | 3 +--
>   accel/mshv/mshv-all.c       | 1 -
>   include/system/mshv.h       | 1 -
>   target/i386/mshv/mshv-cpu.c | 1 -
>   target/i386/mshv/x86.c      | 1 -
>   5 files changed, 1 insertion(+), 6 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/4] misc: Clean up includes
  2026-01-16 12:58 ` [PATCH 3/4] misc: " Peter Maydell
@ 2026-01-16 13:20   ` Markus Armbruster
  2026-01-16 13:37   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 11+ messages in thread
From: Markus Armbruster @ 2026-01-16 13:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-devel, Magnus Kulke, Wei Liu, Warner Losh, Kyle Evans,
	Richard Henderson, Helge Deller, Michael Roth, Kostiantyn Kostiuk,
	Marcelo Tosatti

Peter Maydell <peter.maydell@linaro.org> writes:

> This commit deals with various .c files that included system
> headers that are already pulled in by osdep.h, where the .c
> file includes osdep.h already itself.
>
> This commit was created with scripts/clean-includes:
>  ./scripts/clean-includes '--git' 'misc' 'hw/core' 'semihosting' 'target/arm' 'target/i386/kvm/kvm.c' 'target/loongarch' 'target/riscv' 'tools' 'util'
>
> All .c should include qemu/osdep.h first.  The script performs three
> related cleanups:
>
> * Ensure .c files include qemu/osdep.h first.
> * Including it in a .h is redundant, since the .c  already includes
>   it.  Drop such inclusions.
> * Likewise, including headers qemu/osdep.h includes is redundant.
>   Drop these, too.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/4] misc: Clean up includes
  2026-01-16 12:58 ` [PATCH 3/4] misc: " Peter Maydell
  2026-01-16 13:20   ` Markus Armbruster
@ 2026-01-16 13:37   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 11+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-01-16 13:37 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Magnus Kulke, Wei Liu, Warner Losh, Kyle Evans, Richard Henderson,
	Helge Deller, Michael Roth, Kostiantyn Kostiuk, Marcelo Tosatti

On 16/1/26 13:58, Peter Maydell wrote:
> This commit deals with various .c files that included system
> headers that are already pulled in by osdep.h, where the .c
> file includes osdep.h already itself.
> 
> This commit was created with scripts/clean-includes:
>   ./scripts/clean-includes '--git' 'misc' 'hw/core' 'semihosting' 'target/arm' 'target/i386/kvm/kvm.c' 'target/loongarch' 'target/riscv' 'tools' 'util'
> 
> All .c should include qemu/osdep.h first.  The script performs three
> related cleanups:
> 
> * Ensure .c files include qemu/osdep.h first.
> * Including it in a .h is redundant, since the .c  already includes
>    it.  Drop such inclusions.
> * Likewise, including headers qemu/osdep.h includes is redundant.
>    Drop these, too.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   hw/core/machine-qmp-cmds.c         | 1 -
>   semihosting/arm-compat-semi-stub.c | 1 -
>   target/arm/cpu32-stubs.c           | 1 -
>   target/i386/kvm/kvm.c              | 1 -
>   target/loongarch/csr.c             | 1 -
>   target/riscv/csr.c                 | 1 -
>   tools/i386/qemu-vmsr-helper.c      | 1 -
>   util/cpuinfo-aarch64.c             | 1 -
>   8 files changed, 8 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] bsd-user: Clean up includes
  2026-01-16 12:58 ` [PATCH 2/4] bsd-user: " Peter Maydell
  2026-01-16 13:06   ` Philippe Mathieu-Daudé
@ 2026-01-16 14:28   ` Warner Losh
  1 sibling, 0 replies; 11+ messages in thread
From: Warner Losh @ 2026-01-16 14:28 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-devel, Magnus Kulke, Wei Liu, Kyle Evans, Richard Henderson,
	Helge Deller, Michael Roth, Kostiantyn Kostiuk, Marcelo Tosatti

[-- Attachment #1: Type: text/plain, Size: 2541 bytes --]

On Fri, Jan 16, 2026 at 5:58 AM Peter Maydell <peter.maydell@linaro.org>
wrote:

> This commit was created with scripts/clean-includes:
>  ./scripts/clean-includes '--git' 'bsd-user' 'bsd-user'
>
> All .c should include qemu/osdep.h first.  The script performs three
> related cleanups:
>
> * Ensure .c files include qemu/osdep.h first.
> * Including it in a .h is redundant, since the .c  already includes
>   it.  Drop such inclusions.
> * Likewise, including headers qemu/osdep.h includes is redundant.
>   Drop these, too.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  bsd-user/bsd-mem.h         | 3 ---
>  bsd-user/bsd-proc.c        | 1 -
>  bsd-user/freebsd/os-proc.h | 2 --
>  bsd-user/qemu-bsd.h        | 1 -
>  4 files changed, 7 deletions(-)
>

Reviewed-by: Warner Losh <imp@bsdimp.com>

These were the documented includes needed for these APIs. But this cleanup
is fine.
We weren't 100% consistent anyway before.


> diff --git a/bsd-user/bsd-mem.h b/bsd-user/bsd-mem.h
> index 416d0f8c23..a118e57260 100644
> --- a/bsd-user/bsd-mem.h
> +++ b/bsd-user/bsd-mem.h
> @@ -49,11 +49,8 @@
>  #ifndef BSD_USER_BSD_MEM_H
>  #define BSD_USER_BSD_MEM_H
>
> -#include <sys/types.h>
>  #include <sys/ipc.h>
> -#include <sys/mman.h>
>  #include <sys/shm.h>
> -#include <fcntl.h>
>
>  #include "qemu-bsd.h"
>  #include "exec/mmap-lock.h"
> diff --git a/bsd-user/bsd-proc.c b/bsd-user/bsd-proc.c
> index ca3c1bf94f..8dcac9608d 100644
> --- a/bsd-user/bsd-proc.c
> +++ b/bsd-user/bsd-proc.c
> @@ -19,7 +19,6 @@
>  #include "qemu/osdep.h"
>
>  #include <sys/param.h>
> -#include <sys/types.h>
>  #include <sys/cpuset.h>
>  #include <sys/resource.h>
>  #include <sys/wait.h>
> diff --git a/bsd-user/freebsd/os-proc.h b/bsd-user/freebsd/os-proc.h
> index 3003c8cb63..cc53215138 100644
> --- a/bsd-user/freebsd/os-proc.h
> +++ b/bsd-user/freebsd/os-proc.h
> @@ -23,10 +23,8 @@
>  #include <sys/param.h>
>  #include <sys/procctl.h>
>  #include <sys/signal.h>
> -#include <sys/types.h>
>  #include <sys/procdesc.h>
>  #include <sys/wait.h>
> -#include <unistd.h>
>
>  #include "target_arch_cpu.h"
>
> diff --git a/bsd-user/qemu-bsd.h b/bsd-user/qemu-bsd.h
> index ffc64bb244..56affcd31d 100644
> --- a/bsd-user/qemu-bsd.h
> +++ b/bsd-user/qemu-bsd.h
> @@ -20,7 +20,6 @@
>  #ifndef QEMU_BSD_H
>  #define QEMU_BSD_H
>
> -#include <sys/types.h>
>  #include <sys/resource.h>
>  #include <sys/ipc.h>
>  #include <sys/msg.h>
> --
> 2.47.3
>
>

[-- Attachment #2: Type: text/html, Size: 3576 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-01-16 14:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-16 12:58 [PATCH 0/4] misc: clean up includes Peter Maydell
2026-01-16 12:58 ` [PATCH 1/4] mshv: Clean " Peter Maydell
2026-01-16 13:07   ` Philippe Mathieu-Daudé
2026-01-16 12:58 ` [PATCH 2/4] bsd-user: " Peter Maydell
2026-01-16 13:06   ` Philippe Mathieu-Daudé
2026-01-16 14:28   ` Warner Losh
2026-01-16 12:58 ` [PATCH 3/4] misc: " Peter Maydell
2026-01-16 13:20   ` Markus Armbruster
2026-01-16 13:37   ` Philippe Mathieu-Daudé
2026-01-16 12:58 ` [PATCH 4/4] all: " Peter Maydell
2026-01-16 13:06   ` Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.