All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Clean up includes
@ 2020-11-13  6:12 Markus Armbruster
  2020-11-13  9:07 ` Paolo Bonzini
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Markus Armbruster @ 2020-11-13  6:12 UTC (permalink / raw)
  To: qemu-devel
  Cc: alxndr, thuth, cohuck, mjrosato, david, qemu-s390x, mst, laurent,
	dgilbert, pasic, borntraeger, bsd, kraxel, stefanha, pbonzini,
	marcandre.lureau, rth

Clean up includes so that osdep.h is included first and headers
which it implies are not included manually.

This commit was created with scripts/clean-includes, with the changes
to the following files manually reverted:

    contrib/libvhost-user/libvhost-user-glib.h
    contrib/libvhost-user/libvhost-user.c
    contrib/libvhost-user/libvhost-user.h
    contrib/plugins/hotblocks.c
    contrib/plugins/hotpages.c
    contrib/plugins/howvec.c
    contrib/plugins/lockstep.c
    linux-user/mips64/cpu_loop.c
    linux-user/mips64/signal.c
    linux-user/sparc64/cpu_loop.c
    linux-user/sparc64/signal.c
    linux-user/x86_64/cpu_loop.c
    linux-user/x86_64/signal.c
    target/s390x/gen-features.c
    tests/fp/platform.h
    tests/migration/s390x/a-b-bios.c
    tests/plugin/bb.c
    tests/plugin/empty.c
    tests/plugin/insn.c
    tests/plugin/mem.c
    tests/test-rcu-simpleq.c
    tests/test-rcu-slist.c
    tests/test-rcu-tailq.c
    tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c

contrib/plugins/, tests/plugin/, and tests/test-rcu-slist.c appear not
to include osdep.h intentionally.  The remaining reverts are the same
as in commit bbfff19688d.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
No real need to get this into 5.2 at this stage.  No real risk either.

 contrib/vhost-user-gpu/vugbm.h          |  2 --
 contrib/vhost-user-gpu/vugpu.h          |  1 -
 include/hw/block/swim.h                 |  1 -
 include/hw/display/macfb.h              |  1 -
 include/qemu/nvdimm-utils.h             |  1 -
 tests/qtest/fuzz/fuzz.h                 |  1 -
 tests/qtest/fuzz/generic_fuzz_configs.h |  1 -
 tools/virtiofsd/fuse_common.h           |  2 --
 tools/virtiofsd/fuse_log.h              |  1 -
 tools/virtiofsd/fuse_lowlevel.h         |  3 ---
 tools/virtiofsd/fuse_misc.h             |  1 -
 tools/virtiofsd/passthrough_seccomp.h   |  1 -
 contrib/vhost-user-gpu/virgl.c          |  1 +
 contrib/vhost-user-gpu/vugbm.c          |  1 +
 contrib/vhost-user-input/main.c         |  1 -
 hw/display/artist.c                     |  1 -
 hw/s390x/s390-pci-vfio.c                |  3 ++-
 tools/virtiofsd/buffer.c                |  5 -----
 tools/virtiofsd/fuse_log.c              |  2 --
 tools/virtiofsd/fuse_lowlevel.c         | 10 ----------
 tools/virtiofsd/fuse_opt.c              |  4 ----
 tools/virtiofsd/fuse_signals.c          |  5 -----
 tools/virtiofsd/fuse_virtio.c           | 10 ----------
 tools/virtiofsd/helper.c                |  8 --------
 tools/virtiofsd/passthrough_ll.c        | 12 ------------
 tools/virtiofsd/passthrough_seccomp.c   |  3 ---
 util/nvdimm-utils.c                     |  1 +
 27 files changed, 5 insertions(+), 78 deletions(-)

diff --git a/contrib/vhost-user-gpu/vugbm.h b/contrib/vhost-user-gpu/vugbm.h
index 07e698fcd7..66f1520764 100644
--- a/contrib/vhost-user-gpu/vugbm.h
+++ b/contrib/vhost-user-gpu/vugbm.h
@@ -10,10 +10,8 @@
 #ifndef VHOST_USER_GPU_VUGBM_H
 #define VHOST_USER_GPU_VUGBM_H
 
-#include "qemu/osdep.h"
 
 #ifdef CONFIG_MEMFD
-#include <sys/mman.h>
 #include <sys/ioctl.h>
 #endif
 
diff --git a/contrib/vhost-user-gpu/vugpu.h b/contrib/vhost-user-gpu/vugpu.h
index 3153c9a6de..5eca2a96ab 100644
--- a/contrib/vhost-user-gpu/vugpu.h
+++ b/contrib/vhost-user-gpu/vugpu.h
@@ -15,7 +15,6 @@
 #ifndef VUGPU_H
 #define VUGPU_H
 
-#include "qemu/osdep.h"
 
 #include "contrib/libvhost-user/libvhost-user-glib.h"
 #include "standard-headers/linux/virtio_gpu.h"
diff --git a/include/hw/block/swim.h b/include/hw/block/swim.h
index 5a49029543..c1bd5f6555 100644
--- a/include/hw/block/swim.h
+++ b/include/hw/block/swim.h
@@ -11,7 +11,6 @@
 #ifndef SWIM_H
 #define SWIM_H
 
-#include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "qom/object.h"
 
diff --git a/include/hw/display/macfb.h b/include/hw/display/macfb.h
index c133fa271e..80806b0306 100644
--- a/include/hw/display/macfb.h
+++ b/include/hw/display/macfb.h
@@ -13,7 +13,6 @@
 #ifndef MACFB_H
 #define MACFB_H
 
-#include "qemu/osdep.h"
 #include "exec/memory.h"
 #include "ui/console.h"
 #include "qom/object.h"
diff --git a/include/qemu/nvdimm-utils.h b/include/qemu/nvdimm-utils.h
index 4b8b198ba7..5f45774c2c 100644
--- a/include/qemu/nvdimm-utils.h
+++ b/include/qemu/nvdimm-utils.h
@@ -1,7 +1,6 @@
 #ifndef NVDIMM_UTILS_H
 #define NVDIMM_UTILS_H
 
-#include "qemu/osdep.h"
 
 GSList *nvdimm_get_device_list(void);
 #endif
diff --git a/tests/qtest/fuzz/fuzz.h b/tests/qtest/fuzz/fuzz.h
index 08e9560a79..3a8570e84c 100644
--- a/tests/qtest/fuzz/fuzz.h
+++ b/tests/qtest/fuzz/fuzz.h
@@ -14,7 +14,6 @@
 #ifndef FUZZER_H_
 #define FUZZER_H_
 
-#include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "qapi/error.h"
 
diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h b/tests/qtest/fuzz/generic_fuzz_configs.h
index c4d925f9e6..b4c5fefeca 100644
--- a/tests/qtest/fuzz/generic_fuzz_configs.h
+++ b/tests/qtest/fuzz/generic_fuzz_configs.h
@@ -13,7 +13,6 @@
 #ifndef GENERIC_FUZZ_CONFIGS_H
 #define GENERIC_FUZZ_CONFIGS_H
 
-#include "qemu/osdep.h"
 
 typedef struct generic_fuzz_config {
     const char *name, *args, *objects;
diff --git a/tools/virtiofsd/fuse_common.h b/tools/virtiofsd/fuse_common.h
index 5aee5193eb..30b18b4966 100644
--- a/tools/virtiofsd/fuse_common.h
+++ b/tools/virtiofsd/fuse_common.h
@@ -18,8 +18,6 @@
 
 #include "fuse_log.h"
 #include "fuse_opt.h"
-#include <stdint.h>
-#include <sys/types.h>
 
 /** Major version of FUSE library interface */
 #define FUSE_MAJOR_VERSION 3
diff --git a/tools/virtiofsd/fuse_log.h b/tools/virtiofsd/fuse_log.h
index bf6c11ff11..8d7091bd4d 100644
--- a/tools/virtiofsd/fuse_log.h
+++ b/tools/virtiofsd/fuse_log.h
@@ -14,7 +14,6 @@
  * This file defines the logging interface of FUSE
  */
 
-#include <stdarg.h>
 
 /**
  * Log severity level
diff --git a/tools/virtiofsd/fuse_lowlevel.h b/tools/virtiofsd/fuse_lowlevel.h
index 9c06240f9e..0e10a14bc9 100644
--- a/tools/virtiofsd/fuse_lowlevel.h
+++ b/tools/virtiofsd/fuse_lowlevel.h
@@ -25,10 +25,7 @@
 
 #include "fuse_common.h"
 
-#include <fcntl.h>
-#include <sys/stat.h>
 #include <sys/statvfs.h>
-#include <sys/types.h>
 #include <sys/uio.h>
 #include <utime.h>
 
diff --git a/tools/virtiofsd/fuse_misc.h b/tools/virtiofsd/fuse_misc.h
index 5c618ce21f..f252baa752 100644
--- a/tools/virtiofsd/fuse_misc.h
+++ b/tools/virtiofsd/fuse_misc.h
@@ -7,7 +7,6 @@
  */
 
 #include <pthread.h>
-#include "config-host.h"
 
 /*
  * Versioned symbols cannot be used in some cases because it
diff --git a/tools/virtiofsd/passthrough_seccomp.h b/tools/virtiofsd/passthrough_seccomp.h
index d47c8eade6..a3ab073f08 100644
--- a/tools/virtiofsd/passthrough_seccomp.h
+++ b/tools/virtiofsd/passthrough_seccomp.h
@@ -9,7 +9,6 @@
 #ifndef VIRTIOFSD_SECCOMP_H
 #define VIRTIOFSD_SECCOMP_H
 
-#include <stdbool.h>
 
 void setup_seccomp(bool enable_syslog);
 
diff --git a/contrib/vhost-user-gpu/virgl.c b/contrib/vhost-user-gpu/virgl.c
index b0bc22c3c1..e647278052 100644
--- a/contrib/vhost-user-gpu/virgl.c
+++ b/contrib/vhost-user-gpu/virgl.c
@@ -12,6 +12,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include <virglrenderer.h>
 #include "virgl.h"
 
diff --git a/contrib/vhost-user-gpu/vugbm.c b/contrib/vhost-user-gpu/vugbm.c
index 9c357b6399..f5304ada2f 100644
--- a/contrib/vhost-user-gpu/vugbm.c
+++ b/contrib/vhost-user-gpu/vugbm.c
@@ -7,6 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "vugbm.h"
 
 static bool
diff --git a/contrib/vhost-user-input/main.c b/contrib/vhost-user-input/main.c
index 6020c6f33a..25e2faa16b 100644
--- a/contrib/vhost-user-input/main.c
+++ b/contrib/vhost-user-input/main.c
@@ -6,7 +6,6 @@
 
 #include "qemu/osdep.h"
 
-#include <glib.h>
 #include <linux/input.h>
 
 #include "qemu/iov.h"
diff --git a/hw/display/artist.c b/hw/display/artist.c
index ed0e637f25..aa7bd594aa 100644
--- a/hw/display/artist.c
+++ b/hw/display/artist.c
@@ -9,7 +9,6 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
-#include "qemu/typedefs.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "qemu/units.h"
diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c
index d5c78063b5..28343f90e3 100644
--- a/hw/s390x/s390-pci-vfio.c
+++ b/hw/s390x/s390-pci-vfio.c
@@ -9,11 +9,12 @@
  * directory.
  */
 
+#include "qemu/osdep.h"
+
 #include <sys/ioctl.h>
 #include <linux/vfio.h>
 #include <linux/vfio_zdev.h>
 
-#include "qemu/osdep.h"
 #include "trace.h"
 #include "hw/s390x/s390-pci-bus.h"
 #include "hw/s390x/s390-pci-clp.h"
diff --git a/tools/virtiofsd/buffer.c b/tools/virtiofsd/buffer.c
index 27c1377f22..2085db2743 100644
--- a/tools/virtiofsd/buffer.c
+++ b/tools/virtiofsd/buffer.c
@@ -12,11 +12,6 @@
 #include "qemu/osdep.h"
 #include "fuse_i.h"
 #include "fuse_lowlevel.h"
-#include <assert.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
 
 size_t fuse_buf_size(const struct fuse_bufvec *bufv)
 {
diff --git a/tools/virtiofsd/fuse_log.c b/tools/virtiofsd/fuse_log.c
index c301ff6da1..745d88cd2a 100644
--- a/tools/virtiofsd/fuse_log.c
+++ b/tools/virtiofsd/fuse_log.c
@@ -11,8 +11,6 @@
 #include "qemu/osdep.h"
 #include "fuse_log.h"
 
-#include <stdarg.h>
-#include <stdio.h>
 
 static void default_log_func(__attribute__((unused)) enum fuse_log_level level,
                              const char *fmt, va_list ap)
diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
index c70fb16a9a..d4119e92ab 100644
--- a/tools/virtiofsd/fuse_lowlevel.c
+++ b/tools/virtiofsd/fuse_lowlevel.c
@@ -16,17 +16,7 @@
 #include "fuse_opt.h"
 #include "fuse_virtio.h"
 
-#include <assert.h>
-#include <errno.h>
-#include <glib.h>
-#include <limits.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 #include <sys/file.h>
-#include <unistd.h>
 
 #define THREAD_POOL_SIZE 64
 
diff --git a/tools/virtiofsd/fuse_opt.c b/tools/virtiofsd/fuse_opt.c
index 28922361a2..f0ab8d22f4 100644
--- a/tools/virtiofsd/fuse_opt.c
+++ b/tools/virtiofsd/fuse_opt.c
@@ -14,10 +14,6 @@
 #include "fuse_i.h"
 #include "fuse_misc.h"
 
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 
 struct fuse_opt_context {
     void *data;
diff --git a/tools/virtiofsd/fuse_signals.c b/tools/virtiofsd/fuse_signals.c
index f18625b6e2..1de46de1ce 100644
--- a/tools/virtiofsd/fuse_signals.c
+++ b/tools/virtiofsd/fuse_signals.c
@@ -12,11 +12,6 @@
 #include "fuse_i.h"
 #include "fuse_lowlevel.h"
 
-#include <errno.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 
 static struct fuse_session *fuse_instance;
 
diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c
index 83ba07c6cd..2c800418f1 100644
--- a/tools/virtiofsd/fuse_virtio.c
+++ b/tools/virtiofsd/fuse_virtio.c
@@ -20,20 +20,10 @@
 #include "fuse_opt.h"
 #include "fuse_virtio.h"
 
-#include <assert.h>
-#include <errno.h>
-#include <glib.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 #include <sys/eventfd.h>
 #include <sys/socket.h>
-#include <sys/types.h>
 #include <sys/un.h>
-#include <sys/types.h>
 #include <grp.h>
-#include <unistd.h>
 
 #include "contrib/libvhost-user/libvhost-user.h"
 
diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
index 75ac48dec2..28243b51b2 100644
--- a/tools/virtiofsd/helper.c
+++ b/tools/virtiofsd/helper.c
@@ -16,16 +16,8 @@
 #include "fuse_misc.h"
 #include "fuse_opt.h"
 
-#include <errno.h>
-#include <limits.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 #include <sys/param.h>
-#include <sys/time.h>
 #include <sys/resource.h>
-#include <unistd.h>
 
 #define FUSE_HELPER_OPT(t, p)                       \
     {                                               \
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index ec1008bceb..56cff773e4 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -41,29 +41,17 @@
 #include "fuse_log.h"
 #include "fuse_lowlevel.h"
 #include "standard-headers/linux/fuse.h"
-#include <assert.h>
 #include <cap-ng.h>
 #include <dirent.h>
-#include <errno.h>
-#include <glib.h>
-#include <inttypes.h>
-#include <limits.h>
 #include <pthread.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 #include <sys/file.h>
 #include <sys/mount.h>
 #include <sys/prctl.h>
 #include <sys/resource.h>
 #include <sys/syscall.h>
-#include <sys/types.h>
 #include <sys/wait.h>
 #include <sys/xattr.h>
 #include <syslog.h>
-#include <unistd.h>
 
 #include "qemu/cutils.h"
 #include "passthrough_helpers.h"
diff --git a/tools/virtiofsd/passthrough_seccomp.c b/tools/virtiofsd/passthrough_seccomp.c
index 11623f56f2..a60d7da4b4 100644
--- a/tools/virtiofsd/passthrough_seccomp.c
+++ b/tools/virtiofsd/passthrough_seccomp.c
@@ -10,10 +10,7 @@
 #include "passthrough_seccomp.h"
 #include "fuse_i.h"
 #include "fuse_log.h"
-#include <errno.h>
-#include <glib.h>
 #include <seccomp.h>
-#include <stdlib.h>
 
 /* Bodge for libseccomp 2.4.2 which broke ppoll */
 #if !defined(__SNR_ppoll) && defined(__SNR_brk)
diff --git a/util/nvdimm-utils.c b/util/nvdimm-utils.c
index 5cc768ca47..aa3d199f2d 100644
--- a/util/nvdimm-utils.c
+++ b/util/nvdimm-utils.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu/nvdimm-utils.h"
 #include "hw/mem/nvdimm.h"
 
-- 
2.26.2



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

* Re: [PATCH] Clean up includes
  2020-11-13  6:12 [PATCH] Clean up includes Markus Armbruster
@ 2020-11-13  9:07 ` Paolo Bonzini
  2020-11-13  9:16 ` Dr. David Alan Gilbert
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2020-11-13  9:07 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel
  Cc: alxndr, thuth, cohuck, mjrosato, david, qemu-s390x, mst, laurent,
	dgilbert, pasic, borntraeger, bsd, kraxel, stefanha,
	marcandre.lureau, rth

On 13/11/20 07:12, Markus Armbruster wrote:
> Clean up includes so that osdep.h is included first and headers
> which it implies are not included manually.
> 
> This commit was created with scripts/clean-includes, with the changes
> to the following files manually reverted:
> 
> contrib/plugins/, tests/plugin/, and tests/test-rcu-slist.c appear not
> to include osdep.h intentionally.  The remaining reverts are the same
> as in commit bbfff19688d.

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> No real need to get this into 5.2 at this stage.  No real risk either.
> 
>   contrib/vhost-user-gpu/vugbm.h          |  2 --
>   contrib/vhost-user-gpu/vugpu.h          |  1 -
>   include/hw/block/swim.h                 |  1 -
>   include/hw/display/macfb.h              |  1 -
>   include/qemu/nvdimm-utils.h             |  1 -
>   tests/qtest/fuzz/fuzz.h                 |  1 -
>   tests/qtest/fuzz/generic_fuzz_configs.h |  1 -
>   tools/virtiofsd/fuse_common.h           |  2 --
>   tools/virtiofsd/fuse_log.h              |  1 -
>   tools/virtiofsd/fuse_lowlevel.h         |  3 ---
>   tools/virtiofsd/fuse_misc.h             |  1 -
>   tools/virtiofsd/passthrough_seccomp.h   |  1 -
>   contrib/vhost-user-gpu/virgl.c          |  1 +
>   contrib/vhost-user-gpu/vugbm.c          |  1 +
>   contrib/vhost-user-input/main.c         |  1 -
>   hw/display/artist.c                     |  1 -
>   hw/s390x/s390-pci-vfio.c                |  3 ++-
>   tools/virtiofsd/buffer.c                |  5 -----
>   tools/virtiofsd/fuse_log.c              |  2 --
>   tools/virtiofsd/fuse_lowlevel.c         | 10 ----------
>   tools/virtiofsd/fuse_opt.c              |  4 ----
>   tools/virtiofsd/fuse_signals.c          |  5 -----
>   tools/virtiofsd/fuse_virtio.c           | 10 ----------
>   tools/virtiofsd/helper.c                |  8 --------
>   tools/virtiofsd/passthrough_ll.c        | 12 ------------
>   tools/virtiofsd/passthrough_seccomp.c   |  3 ---
>   util/nvdimm-utils.c                     |  1 +
>   27 files changed, 5 insertions(+), 78 deletions(-)
> 
> diff --git a/contrib/vhost-user-gpu/vugbm.h b/contrib/vhost-user-gpu/vugbm.h
> index 07e698fcd7..66f1520764 100644
> --- a/contrib/vhost-user-gpu/vugbm.h
> +++ b/contrib/vhost-user-gpu/vugbm.h
> @@ -10,10 +10,8 @@
>   #ifndef VHOST_USER_GPU_VUGBM_H
>   #define VHOST_USER_GPU_VUGBM_H
>   
> -#include "qemu/osdep.h"
>   
>   #ifdef CONFIG_MEMFD
> -#include <sys/mman.h>
>   #include <sys/ioctl.h>
>   #endif
>   
> diff --git a/contrib/vhost-user-gpu/vugpu.h b/contrib/vhost-user-gpu/vugpu.h
> index 3153c9a6de..5eca2a96ab 100644
> --- a/contrib/vhost-user-gpu/vugpu.h
> +++ b/contrib/vhost-user-gpu/vugpu.h
> @@ -15,7 +15,6 @@
>   #ifndef VUGPU_H
>   #define VUGPU_H
>   
> -#include "qemu/osdep.h"
>   
>   #include "contrib/libvhost-user/libvhost-user-glib.h"
>   #include "standard-headers/linux/virtio_gpu.h"
> diff --git a/include/hw/block/swim.h b/include/hw/block/swim.h
> index 5a49029543..c1bd5f6555 100644
> --- a/include/hw/block/swim.h
> +++ b/include/hw/block/swim.h
> @@ -11,7 +11,6 @@
>   #ifndef SWIM_H
>   #define SWIM_H
>   
> -#include "qemu/osdep.h"
>   #include "hw/sysbus.h"
>   #include "qom/object.h"
>   
> diff --git a/include/hw/display/macfb.h b/include/hw/display/macfb.h
> index c133fa271e..80806b0306 100644
> --- a/include/hw/display/macfb.h
> +++ b/include/hw/display/macfb.h
> @@ -13,7 +13,6 @@
>   #ifndef MACFB_H
>   #define MACFB_H
>   
> -#include "qemu/osdep.h"
>   #include "exec/memory.h"
>   #include "ui/console.h"
>   #include "qom/object.h"
> diff --git a/include/qemu/nvdimm-utils.h b/include/qemu/nvdimm-utils.h
> index 4b8b198ba7..5f45774c2c 100644
> --- a/include/qemu/nvdimm-utils.h
> +++ b/include/qemu/nvdimm-utils.h
> @@ -1,7 +1,6 @@
>   #ifndef NVDIMM_UTILS_H
>   #define NVDIMM_UTILS_H
>   
> -#include "qemu/osdep.h"
>   
>   GSList *nvdimm_get_device_list(void);
>   #endif
> diff --git a/tests/qtest/fuzz/fuzz.h b/tests/qtest/fuzz/fuzz.h
> index 08e9560a79..3a8570e84c 100644
> --- a/tests/qtest/fuzz/fuzz.h
> +++ b/tests/qtest/fuzz/fuzz.h
> @@ -14,7 +14,6 @@
>   #ifndef FUZZER_H_
>   #define FUZZER_H_
>   
> -#include "qemu/osdep.h"
>   #include "qemu/units.h"
>   #include "qapi/error.h"
>   
> diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h b/tests/qtest/fuzz/generic_fuzz_configs.h
> index c4d925f9e6..b4c5fefeca 100644
> --- a/tests/qtest/fuzz/generic_fuzz_configs.h
> +++ b/tests/qtest/fuzz/generic_fuzz_configs.h
> @@ -13,7 +13,6 @@
>   #ifndef GENERIC_FUZZ_CONFIGS_H
>   #define GENERIC_FUZZ_CONFIGS_H
>   
> -#include "qemu/osdep.h"
>   
>   typedef struct generic_fuzz_config {
>       const char *name, *args, *objects;
> diff --git a/tools/virtiofsd/fuse_common.h b/tools/virtiofsd/fuse_common.h
> index 5aee5193eb..30b18b4966 100644
> --- a/tools/virtiofsd/fuse_common.h
> +++ b/tools/virtiofsd/fuse_common.h
> @@ -18,8 +18,6 @@
>   
>   #include "fuse_log.h"
>   #include "fuse_opt.h"
> -#include <stdint.h>
> -#include <sys/types.h>
>   
>   /** Major version of FUSE library interface */
>   #define FUSE_MAJOR_VERSION 3
> diff --git a/tools/virtiofsd/fuse_log.h b/tools/virtiofsd/fuse_log.h
> index bf6c11ff11..8d7091bd4d 100644
> --- a/tools/virtiofsd/fuse_log.h
> +++ b/tools/virtiofsd/fuse_log.h
> @@ -14,7 +14,6 @@
>    * This file defines the logging interface of FUSE
>    */
>   
> -#include <stdarg.h>
>   
>   /**
>    * Log severity level
> diff --git a/tools/virtiofsd/fuse_lowlevel.h b/tools/virtiofsd/fuse_lowlevel.h
> index 9c06240f9e..0e10a14bc9 100644
> --- a/tools/virtiofsd/fuse_lowlevel.h
> +++ b/tools/virtiofsd/fuse_lowlevel.h
> @@ -25,10 +25,7 @@
>   
>   #include "fuse_common.h"
>   
> -#include <fcntl.h>
> -#include <sys/stat.h>
>   #include <sys/statvfs.h>
> -#include <sys/types.h>
>   #include <sys/uio.h>
>   #include <utime.h>
>   
> diff --git a/tools/virtiofsd/fuse_misc.h b/tools/virtiofsd/fuse_misc.h
> index 5c618ce21f..f252baa752 100644
> --- a/tools/virtiofsd/fuse_misc.h
> +++ b/tools/virtiofsd/fuse_misc.h
> @@ -7,7 +7,6 @@
>    */
>   
>   #include <pthread.h>
> -#include "config-host.h"
>   
>   /*
>    * Versioned symbols cannot be used in some cases because it
> diff --git a/tools/virtiofsd/passthrough_seccomp.h b/tools/virtiofsd/passthrough_seccomp.h
> index d47c8eade6..a3ab073f08 100644
> --- a/tools/virtiofsd/passthrough_seccomp.h
> +++ b/tools/virtiofsd/passthrough_seccomp.h
> @@ -9,7 +9,6 @@
>   #ifndef VIRTIOFSD_SECCOMP_H
>   #define VIRTIOFSD_SECCOMP_H
>   
> -#include <stdbool.h>
>   
>   void setup_seccomp(bool enable_syslog);
>   
> diff --git a/contrib/vhost-user-gpu/virgl.c b/contrib/vhost-user-gpu/virgl.c
> index b0bc22c3c1..e647278052 100644
> --- a/contrib/vhost-user-gpu/virgl.c
> +++ b/contrib/vhost-user-gpu/virgl.c
> @@ -12,6 +12,7 @@
>    * See the COPYING file in the top-level directory.
>    */
>   
> +#include "qemu/osdep.h"
>   #include <virglrenderer.h>
>   #include "virgl.h"
>   
> diff --git a/contrib/vhost-user-gpu/vugbm.c b/contrib/vhost-user-gpu/vugbm.c
> index 9c357b6399..f5304ada2f 100644
> --- a/contrib/vhost-user-gpu/vugbm.c
> +++ b/contrib/vhost-user-gpu/vugbm.c
> @@ -7,6 +7,7 @@
>    * See the COPYING file in the top-level directory.
>    */
>   
> +#include "qemu/osdep.h"
>   #include "vugbm.h"
>   
>   static bool
> diff --git a/contrib/vhost-user-input/main.c b/contrib/vhost-user-input/main.c
> index 6020c6f33a..25e2faa16b 100644
> --- a/contrib/vhost-user-input/main.c
> +++ b/contrib/vhost-user-input/main.c
> @@ -6,7 +6,6 @@
>   
>   #include "qemu/osdep.h"
>   
> -#include <glib.h>
>   #include <linux/input.h>
>   
>   #include "qemu/iov.h"
> diff --git a/hw/display/artist.c b/hw/display/artist.c
> index ed0e637f25..aa7bd594aa 100644
> --- a/hw/display/artist.c
> +++ b/hw/display/artist.c
> @@ -9,7 +9,6 @@
>   #include "qemu/osdep.h"
>   #include "qemu-common.h"
>   #include "qemu/error-report.h"
> -#include "qemu/typedefs.h"
>   #include "qemu/log.h"
>   #include "qemu/module.h"
>   #include "qemu/units.h"
> diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c
> index d5c78063b5..28343f90e3 100644
> --- a/hw/s390x/s390-pci-vfio.c
> +++ b/hw/s390x/s390-pci-vfio.c
> @@ -9,11 +9,12 @@
>    * directory.
>    */
>   
> +#include "qemu/osdep.h"
> +
>   #include <sys/ioctl.h>
>   #include <linux/vfio.h>
>   #include <linux/vfio_zdev.h>
>   
> -#include "qemu/osdep.h"
>   #include "trace.h"
>   #include "hw/s390x/s390-pci-bus.h"
>   #include "hw/s390x/s390-pci-clp.h"
> diff --git a/tools/virtiofsd/buffer.c b/tools/virtiofsd/buffer.c
> index 27c1377f22..2085db2743 100644
> --- a/tools/virtiofsd/buffer.c
> +++ b/tools/virtiofsd/buffer.c
> @@ -12,11 +12,6 @@
>   #include "qemu/osdep.h"
>   #include "fuse_i.h"
>   #include "fuse_lowlevel.h"
> -#include <assert.h>
> -#include <errno.h>
> -#include <stdlib.h>
> -#include <string.h>
> -#include <unistd.h>
>   
>   size_t fuse_buf_size(const struct fuse_bufvec *bufv)
>   {
> diff --git a/tools/virtiofsd/fuse_log.c b/tools/virtiofsd/fuse_log.c
> index c301ff6da1..745d88cd2a 100644
> --- a/tools/virtiofsd/fuse_log.c
> +++ b/tools/virtiofsd/fuse_log.c
> @@ -11,8 +11,6 @@
>   #include "qemu/osdep.h"
>   #include "fuse_log.h"
>   
> -#include <stdarg.h>
> -#include <stdio.h>
>   
>   static void default_log_func(__attribute__((unused)) enum fuse_log_level level,
>                                const char *fmt, va_list ap)
> diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
> index c70fb16a9a..d4119e92ab 100644
> --- a/tools/virtiofsd/fuse_lowlevel.c
> +++ b/tools/virtiofsd/fuse_lowlevel.c
> @@ -16,17 +16,7 @@
>   #include "fuse_opt.h"
>   #include "fuse_virtio.h"
>   
> -#include <assert.h>
> -#include <errno.h>
> -#include <glib.h>
> -#include <limits.h>
> -#include <stdbool.h>
> -#include <stddef.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>   #include <sys/file.h>
> -#include <unistd.h>
>   
>   #define THREAD_POOL_SIZE 64
>   
> diff --git a/tools/virtiofsd/fuse_opt.c b/tools/virtiofsd/fuse_opt.c
> index 28922361a2..f0ab8d22f4 100644
> --- a/tools/virtiofsd/fuse_opt.c
> +++ b/tools/virtiofsd/fuse_opt.c
> @@ -14,10 +14,6 @@
>   #include "fuse_i.h"
>   #include "fuse_misc.h"
>   
> -#include <assert.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>   
>   struct fuse_opt_context {
>       void *data;
> diff --git a/tools/virtiofsd/fuse_signals.c b/tools/virtiofsd/fuse_signals.c
> index f18625b6e2..1de46de1ce 100644
> --- a/tools/virtiofsd/fuse_signals.c
> +++ b/tools/virtiofsd/fuse_signals.c
> @@ -12,11 +12,6 @@
>   #include "fuse_i.h"
>   #include "fuse_lowlevel.h"
>   
> -#include <errno.h>
> -#include <signal.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>   
>   static struct fuse_session *fuse_instance;
>   
> diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c
> index 83ba07c6cd..2c800418f1 100644
> --- a/tools/virtiofsd/fuse_virtio.c
> +++ b/tools/virtiofsd/fuse_virtio.c
> @@ -20,20 +20,10 @@
>   #include "fuse_opt.h"
>   #include "fuse_virtio.h"
>   
> -#include <assert.h>
> -#include <errno.h>
> -#include <glib.h>
> -#include <stdint.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>   #include <sys/eventfd.h>
>   #include <sys/socket.h>
> -#include <sys/types.h>
>   #include <sys/un.h>
> -#include <sys/types.h>
>   #include <grp.h>
> -#include <unistd.h>
>   
>   #include "contrib/libvhost-user/libvhost-user.h"
>   
> diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
> index 75ac48dec2..28243b51b2 100644
> --- a/tools/virtiofsd/helper.c
> +++ b/tools/virtiofsd/helper.c
> @@ -16,16 +16,8 @@
>   #include "fuse_misc.h"
>   #include "fuse_opt.h"
>   
> -#include <errno.h>
> -#include <limits.h>
> -#include <stddef.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>   #include <sys/param.h>
> -#include <sys/time.h>
>   #include <sys/resource.h>
> -#include <unistd.h>
>   
>   #define FUSE_HELPER_OPT(t, p)                       \
>       {                                               \
> diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
> index ec1008bceb..56cff773e4 100644
> --- a/tools/virtiofsd/passthrough_ll.c
> +++ b/tools/virtiofsd/passthrough_ll.c
> @@ -41,29 +41,17 @@
>   #include "fuse_log.h"
>   #include "fuse_lowlevel.h"
>   #include "standard-headers/linux/fuse.h"
> -#include <assert.h>
>   #include <cap-ng.h>
>   #include <dirent.h>
> -#include <errno.h>
> -#include <glib.h>
> -#include <inttypes.h>
> -#include <limits.h>
>   #include <pthread.h>
> -#include <stdbool.h>
> -#include <stddef.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>   #include <sys/file.h>
>   #include <sys/mount.h>
>   #include <sys/prctl.h>
>   #include <sys/resource.h>
>   #include <sys/syscall.h>
> -#include <sys/types.h>
>   #include <sys/wait.h>
>   #include <sys/xattr.h>
>   #include <syslog.h>
> -#include <unistd.h>
>   
>   #include "qemu/cutils.h"
>   #include "passthrough_helpers.h"
> diff --git a/tools/virtiofsd/passthrough_seccomp.c b/tools/virtiofsd/passthrough_seccomp.c
> index 11623f56f2..a60d7da4b4 100644
> --- a/tools/virtiofsd/passthrough_seccomp.c
> +++ b/tools/virtiofsd/passthrough_seccomp.c
> @@ -10,10 +10,7 @@
>   #include "passthrough_seccomp.h"
>   #include "fuse_i.h"
>   #include "fuse_log.h"
> -#include <errno.h>
> -#include <glib.h>
>   #include <seccomp.h>
> -#include <stdlib.h>
>   
>   /* Bodge for libseccomp 2.4.2 which broke ppoll */
>   #if !defined(__SNR_ppoll) && defined(__SNR_brk)
> diff --git a/util/nvdimm-utils.c b/util/nvdimm-utils.c
> index 5cc768ca47..aa3d199f2d 100644
> --- a/util/nvdimm-utils.c
> +++ b/util/nvdimm-utils.c
> @@ -1,3 +1,4 @@
> +#include "qemu/osdep.h"
>   #include "qemu/nvdimm-utils.h"
>   #include "hw/mem/nvdimm.h"
>   
> 



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

* Re: [PATCH] Clean up includes
  2020-11-13  6:12 [PATCH] Clean up includes Markus Armbruster
  2020-11-13  9:07 ` Paolo Bonzini
@ 2020-11-13  9:16 ` Dr. David Alan Gilbert
  2020-11-13  9:17 ` Thomas Huth
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Dr. David Alan Gilbert @ 2020-11-13  9:16 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: alxndr, thuth, cohuck, mjrosato, mst, qemu-s390x, david,
	qemu-devel, laurent, pasic, borntraeger, bsd, kraxel, stefanha,
	pbonzini, marcandre.lureau, rth

* Markus Armbruster (armbru@redhat.com) wrote:
> Clean up includes so that osdep.h is included first and headers
> which it implies are not included manually.
> 
> This commit was created with scripts/clean-includes, with the changes
> to the following files manually reverted:
> 
>     contrib/libvhost-user/libvhost-user-glib.h
>     contrib/libvhost-user/libvhost-user.c
>     contrib/libvhost-user/libvhost-user.h
>     contrib/plugins/hotblocks.c
>     contrib/plugins/hotpages.c
>     contrib/plugins/howvec.c
>     contrib/plugins/lockstep.c
>     linux-user/mips64/cpu_loop.c
>     linux-user/mips64/signal.c
>     linux-user/sparc64/cpu_loop.c
>     linux-user/sparc64/signal.c
>     linux-user/x86_64/cpu_loop.c
>     linux-user/x86_64/signal.c
>     target/s390x/gen-features.c
>     tests/fp/platform.h
>     tests/migration/s390x/a-b-bios.c
>     tests/plugin/bb.c
>     tests/plugin/empty.c
>     tests/plugin/insn.c
>     tests/plugin/mem.c
>     tests/test-rcu-simpleq.c
>     tests/test-rcu-slist.c
>     tests/test-rcu-tailq.c
>     tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
> 
> contrib/plugins/, tests/plugin/, and tests/test-rcu-slist.c appear not
> to include osdep.h intentionally.  The remaining reverts are the same
> as in commit bbfff19688d.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Yeh that looks ok for virtiofsd I think.


Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
> No real need to get this into 5.2 at this stage.  No real risk either.
> 
>  contrib/vhost-user-gpu/vugbm.h          |  2 --
>  contrib/vhost-user-gpu/vugpu.h          |  1 -
>  include/hw/block/swim.h                 |  1 -
>  include/hw/display/macfb.h              |  1 -
>  include/qemu/nvdimm-utils.h             |  1 -
>  tests/qtest/fuzz/fuzz.h                 |  1 -
>  tests/qtest/fuzz/generic_fuzz_configs.h |  1 -
>  tools/virtiofsd/fuse_common.h           |  2 --
>  tools/virtiofsd/fuse_log.h              |  1 -
>  tools/virtiofsd/fuse_lowlevel.h         |  3 ---
>  tools/virtiofsd/fuse_misc.h             |  1 -
>  tools/virtiofsd/passthrough_seccomp.h   |  1 -
>  contrib/vhost-user-gpu/virgl.c          |  1 +
>  contrib/vhost-user-gpu/vugbm.c          |  1 +
>  contrib/vhost-user-input/main.c         |  1 -
>  hw/display/artist.c                     |  1 -
>  hw/s390x/s390-pci-vfio.c                |  3 ++-
>  tools/virtiofsd/buffer.c                |  5 -----
>  tools/virtiofsd/fuse_log.c              |  2 --
>  tools/virtiofsd/fuse_lowlevel.c         | 10 ----------
>  tools/virtiofsd/fuse_opt.c              |  4 ----
>  tools/virtiofsd/fuse_signals.c          |  5 -----
>  tools/virtiofsd/fuse_virtio.c           | 10 ----------
>  tools/virtiofsd/helper.c                |  8 --------
>  tools/virtiofsd/passthrough_ll.c        | 12 ------------
>  tools/virtiofsd/passthrough_seccomp.c   |  3 ---
>  util/nvdimm-utils.c                     |  1 +
>  27 files changed, 5 insertions(+), 78 deletions(-)
> 
> diff --git a/contrib/vhost-user-gpu/vugbm.h b/contrib/vhost-user-gpu/vugbm.h
> index 07e698fcd7..66f1520764 100644
> --- a/contrib/vhost-user-gpu/vugbm.h
> +++ b/contrib/vhost-user-gpu/vugbm.h
> @@ -10,10 +10,8 @@
>  #ifndef VHOST_USER_GPU_VUGBM_H
>  #define VHOST_USER_GPU_VUGBM_H
>  
> -#include "qemu/osdep.h"
>  
>  #ifdef CONFIG_MEMFD
> -#include <sys/mman.h>
>  #include <sys/ioctl.h>
>  #endif
>  
> diff --git a/contrib/vhost-user-gpu/vugpu.h b/contrib/vhost-user-gpu/vugpu.h
> index 3153c9a6de..5eca2a96ab 100644
> --- a/contrib/vhost-user-gpu/vugpu.h
> +++ b/contrib/vhost-user-gpu/vugpu.h
> @@ -15,7 +15,6 @@
>  #ifndef VUGPU_H
>  #define VUGPU_H
>  
> -#include "qemu/osdep.h"
>  
>  #include "contrib/libvhost-user/libvhost-user-glib.h"
>  #include "standard-headers/linux/virtio_gpu.h"
> diff --git a/include/hw/block/swim.h b/include/hw/block/swim.h
> index 5a49029543..c1bd5f6555 100644
> --- a/include/hw/block/swim.h
> +++ b/include/hw/block/swim.h
> @@ -11,7 +11,6 @@
>  #ifndef SWIM_H
>  #define SWIM_H
>  
> -#include "qemu/osdep.h"
>  #include "hw/sysbus.h"
>  #include "qom/object.h"
>  
> diff --git a/include/hw/display/macfb.h b/include/hw/display/macfb.h
> index c133fa271e..80806b0306 100644
> --- a/include/hw/display/macfb.h
> +++ b/include/hw/display/macfb.h
> @@ -13,7 +13,6 @@
>  #ifndef MACFB_H
>  #define MACFB_H
>  
> -#include "qemu/osdep.h"
>  #include "exec/memory.h"
>  #include "ui/console.h"
>  #include "qom/object.h"
> diff --git a/include/qemu/nvdimm-utils.h b/include/qemu/nvdimm-utils.h
> index 4b8b198ba7..5f45774c2c 100644
> --- a/include/qemu/nvdimm-utils.h
> +++ b/include/qemu/nvdimm-utils.h
> @@ -1,7 +1,6 @@
>  #ifndef NVDIMM_UTILS_H
>  #define NVDIMM_UTILS_H
>  
> -#include "qemu/osdep.h"
>  
>  GSList *nvdimm_get_device_list(void);
>  #endif
> diff --git a/tests/qtest/fuzz/fuzz.h b/tests/qtest/fuzz/fuzz.h
> index 08e9560a79..3a8570e84c 100644
> --- a/tests/qtest/fuzz/fuzz.h
> +++ b/tests/qtest/fuzz/fuzz.h
> @@ -14,7 +14,6 @@
>  #ifndef FUZZER_H_
>  #define FUZZER_H_
>  
> -#include "qemu/osdep.h"
>  #include "qemu/units.h"
>  #include "qapi/error.h"
>  
> diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h b/tests/qtest/fuzz/generic_fuzz_configs.h
> index c4d925f9e6..b4c5fefeca 100644
> --- a/tests/qtest/fuzz/generic_fuzz_configs.h
> +++ b/tests/qtest/fuzz/generic_fuzz_configs.h
> @@ -13,7 +13,6 @@
>  #ifndef GENERIC_FUZZ_CONFIGS_H
>  #define GENERIC_FUZZ_CONFIGS_H
>  
> -#include "qemu/osdep.h"
>  
>  typedef struct generic_fuzz_config {
>      const char *name, *args, *objects;
> diff --git a/tools/virtiofsd/fuse_common.h b/tools/virtiofsd/fuse_common.h
> index 5aee5193eb..30b18b4966 100644
> --- a/tools/virtiofsd/fuse_common.h
> +++ b/tools/virtiofsd/fuse_common.h
> @@ -18,8 +18,6 @@
>  
>  #include "fuse_log.h"
>  #include "fuse_opt.h"
> -#include <stdint.h>
> -#include <sys/types.h>
>  
>  /** Major version of FUSE library interface */
>  #define FUSE_MAJOR_VERSION 3
> diff --git a/tools/virtiofsd/fuse_log.h b/tools/virtiofsd/fuse_log.h
> index bf6c11ff11..8d7091bd4d 100644
> --- a/tools/virtiofsd/fuse_log.h
> +++ b/tools/virtiofsd/fuse_log.h
> @@ -14,7 +14,6 @@
>   * This file defines the logging interface of FUSE
>   */
>  
> -#include <stdarg.h>
>  
>  /**
>   * Log severity level
> diff --git a/tools/virtiofsd/fuse_lowlevel.h b/tools/virtiofsd/fuse_lowlevel.h
> index 9c06240f9e..0e10a14bc9 100644
> --- a/tools/virtiofsd/fuse_lowlevel.h
> +++ b/tools/virtiofsd/fuse_lowlevel.h
> @@ -25,10 +25,7 @@
>  
>  #include "fuse_common.h"
>  
> -#include <fcntl.h>
> -#include <sys/stat.h>
>  #include <sys/statvfs.h>
> -#include <sys/types.h>
>  #include <sys/uio.h>
>  #include <utime.h>
>  
> diff --git a/tools/virtiofsd/fuse_misc.h b/tools/virtiofsd/fuse_misc.h
> index 5c618ce21f..f252baa752 100644
> --- a/tools/virtiofsd/fuse_misc.h
> +++ b/tools/virtiofsd/fuse_misc.h
> @@ -7,7 +7,6 @@
>   */
>  
>  #include <pthread.h>
> -#include "config-host.h"
>  
>  /*
>   * Versioned symbols cannot be used in some cases because it
> diff --git a/tools/virtiofsd/passthrough_seccomp.h b/tools/virtiofsd/passthrough_seccomp.h
> index d47c8eade6..a3ab073f08 100644
> --- a/tools/virtiofsd/passthrough_seccomp.h
> +++ b/tools/virtiofsd/passthrough_seccomp.h
> @@ -9,7 +9,6 @@
>  #ifndef VIRTIOFSD_SECCOMP_H
>  #define VIRTIOFSD_SECCOMP_H
>  
> -#include <stdbool.h>
>  
>  void setup_seccomp(bool enable_syslog);
>  
> diff --git a/contrib/vhost-user-gpu/virgl.c b/contrib/vhost-user-gpu/virgl.c
> index b0bc22c3c1..e647278052 100644
> --- a/contrib/vhost-user-gpu/virgl.c
> +++ b/contrib/vhost-user-gpu/virgl.c
> @@ -12,6 +12,7 @@
>   * See the COPYING file in the top-level directory.
>   */
>  
> +#include "qemu/osdep.h"
>  #include <virglrenderer.h>
>  #include "virgl.h"
>  
> diff --git a/contrib/vhost-user-gpu/vugbm.c b/contrib/vhost-user-gpu/vugbm.c
> index 9c357b6399..f5304ada2f 100644
> --- a/contrib/vhost-user-gpu/vugbm.c
> +++ b/contrib/vhost-user-gpu/vugbm.c
> @@ -7,6 +7,7 @@
>   * See the COPYING file in the top-level directory.
>   */
>  
> +#include "qemu/osdep.h"
>  #include "vugbm.h"
>  
>  static bool
> diff --git a/contrib/vhost-user-input/main.c b/contrib/vhost-user-input/main.c
> index 6020c6f33a..25e2faa16b 100644
> --- a/contrib/vhost-user-input/main.c
> +++ b/contrib/vhost-user-input/main.c
> @@ -6,7 +6,6 @@
>  
>  #include "qemu/osdep.h"
>  
> -#include <glib.h>
>  #include <linux/input.h>
>  
>  #include "qemu/iov.h"
> diff --git a/hw/display/artist.c b/hw/display/artist.c
> index ed0e637f25..aa7bd594aa 100644
> --- a/hw/display/artist.c
> +++ b/hw/display/artist.c
> @@ -9,7 +9,6 @@
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
>  #include "qemu/error-report.h"
> -#include "qemu/typedefs.h"
>  #include "qemu/log.h"
>  #include "qemu/module.h"
>  #include "qemu/units.h"
> diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c
> index d5c78063b5..28343f90e3 100644
> --- a/hw/s390x/s390-pci-vfio.c
> +++ b/hw/s390x/s390-pci-vfio.c
> @@ -9,11 +9,12 @@
>   * directory.
>   */
>  
> +#include "qemu/osdep.h"
> +
>  #include <sys/ioctl.h>
>  #include <linux/vfio.h>
>  #include <linux/vfio_zdev.h>
>  
> -#include "qemu/osdep.h"
>  #include "trace.h"
>  #include "hw/s390x/s390-pci-bus.h"
>  #include "hw/s390x/s390-pci-clp.h"
> diff --git a/tools/virtiofsd/buffer.c b/tools/virtiofsd/buffer.c
> index 27c1377f22..2085db2743 100644
> --- a/tools/virtiofsd/buffer.c
> +++ b/tools/virtiofsd/buffer.c
> @@ -12,11 +12,6 @@
>  #include "qemu/osdep.h"
>  #include "fuse_i.h"
>  #include "fuse_lowlevel.h"
> -#include <assert.h>
> -#include <errno.h>
> -#include <stdlib.h>
> -#include <string.h>
> -#include <unistd.h>
>  
>  size_t fuse_buf_size(const struct fuse_bufvec *bufv)
>  {
> diff --git a/tools/virtiofsd/fuse_log.c b/tools/virtiofsd/fuse_log.c
> index c301ff6da1..745d88cd2a 100644
> --- a/tools/virtiofsd/fuse_log.c
> +++ b/tools/virtiofsd/fuse_log.c
> @@ -11,8 +11,6 @@
>  #include "qemu/osdep.h"
>  #include "fuse_log.h"
>  
> -#include <stdarg.h>
> -#include <stdio.h>
>  
>  static void default_log_func(__attribute__((unused)) enum fuse_log_level level,
>                               const char *fmt, va_list ap)
> diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
> index c70fb16a9a..d4119e92ab 100644
> --- a/tools/virtiofsd/fuse_lowlevel.c
> +++ b/tools/virtiofsd/fuse_lowlevel.c
> @@ -16,17 +16,7 @@
>  #include "fuse_opt.h"
>  #include "fuse_virtio.h"
>  
> -#include <assert.h>
> -#include <errno.h>
> -#include <glib.h>
> -#include <limits.h>
> -#include <stdbool.h>
> -#include <stddef.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  #include <sys/file.h>
> -#include <unistd.h>
>  
>  #define THREAD_POOL_SIZE 64
>  
> diff --git a/tools/virtiofsd/fuse_opt.c b/tools/virtiofsd/fuse_opt.c
> index 28922361a2..f0ab8d22f4 100644
> --- a/tools/virtiofsd/fuse_opt.c
> +++ b/tools/virtiofsd/fuse_opt.c
> @@ -14,10 +14,6 @@
>  #include "fuse_i.h"
>  #include "fuse_misc.h"
>  
> -#include <assert.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  
>  struct fuse_opt_context {
>      void *data;
> diff --git a/tools/virtiofsd/fuse_signals.c b/tools/virtiofsd/fuse_signals.c
> index f18625b6e2..1de46de1ce 100644
> --- a/tools/virtiofsd/fuse_signals.c
> +++ b/tools/virtiofsd/fuse_signals.c
> @@ -12,11 +12,6 @@
>  #include "fuse_i.h"
>  #include "fuse_lowlevel.h"
>  
> -#include <errno.h>
> -#include <signal.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  
>  static struct fuse_session *fuse_instance;
>  
> diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c
> index 83ba07c6cd..2c800418f1 100644
> --- a/tools/virtiofsd/fuse_virtio.c
> +++ b/tools/virtiofsd/fuse_virtio.c
> @@ -20,20 +20,10 @@
>  #include "fuse_opt.h"
>  #include "fuse_virtio.h"
>  
> -#include <assert.h>
> -#include <errno.h>
> -#include <glib.h>
> -#include <stdint.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  #include <sys/eventfd.h>
>  #include <sys/socket.h>
> -#include <sys/types.h>
>  #include <sys/un.h>
> -#include <sys/types.h>
>  #include <grp.h>
> -#include <unistd.h>
>  
>  #include "contrib/libvhost-user/libvhost-user.h"
>  
> diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
> index 75ac48dec2..28243b51b2 100644
> --- a/tools/virtiofsd/helper.c
> +++ b/tools/virtiofsd/helper.c
> @@ -16,16 +16,8 @@
>  #include "fuse_misc.h"
>  #include "fuse_opt.h"
>  
> -#include <errno.h>
> -#include <limits.h>
> -#include <stddef.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  #include <sys/param.h>
> -#include <sys/time.h>
>  #include <sys/resource.h>
> -#include <unistd.h>
>  
>  #define FUSE_HELPER_OPT(t, p)                       \
>      {                                               \
> diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
> index ec1008bceb..56cff773e4 100644
> --- a/tools/virtiofsd/passthrough_ll.c
> +++ b/tools/virtiofsd/passthrough_ll.c
> @@ -41,29 +41,17 @@
>  #include "fuse_log.h"
>  #include "fuse_lowlevel.h"
>  #include "standard-headers/linux/fuse.h"
> -#include <assert.h>
>  #include <cap-ng.h>
>  #include <dirent.h>
> -#include <errno.h>
> -#include <glib.h>
> -#include <inttypes.h>
> -#include <limits.h>
>  #include <pthread.h>
> -#include <stdbool.h>
> -#include <stddef.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  #include <sys/file.h>
>  #include <sys/mount.h>
>  #include <sys/prctl.h>
>  #include <sys/resource.h>
>  #include <sys/syscall.h>
> -#include <sys/types.h>
>  #include <sys/wait.h>
>  #include <sys/xattr.h>
>  #include <syslog.h>
> -#include <unistd.h>
>  
>  #include "qemu/cutils.h"
>  #include "passthrough_helpers.h"
> diff --git a/tools/virtiofsd/passthrough_seccomp.c b/tools/virtiofsd/passthrough_seccomp.c
> index 11623f56f2..a60d7da4b4 100644
> --- a/tools/virtiofsd/passthrough_seccomp.c
> +++ b/tools/virtiofsd/passthrough_seccomp.c
> @@ -10,10 +10,7 @@
>  #include "passthrough_seccomp.h"
>  #include "fuse_i.h"
>  #include "fuse_log.h"
> -#include <errno.h>
> -#include <glib.h>
>  #include <seccomp.h>
> -#include <stdlib.h>
>  
>  /* Bodge for libseccomp 2.4.2 which broke ppoll */
>  #if !defined(__SNR_ppoll) && defined(__SNR_brk)
> diff --git a/util/nvdimm-utils.c b/util/nvdimm-utils.c
> index 5cc768ca47..aa3d199f2d 100644
> --- a/util/nvdimm-utils.c
> +++ b/util/nvdimm-utils.c
> @@ -1,3 +1,4 @@
> +#include "qemu/osdep.h"
>  #include "qemu/nvdimm-utils.h"
>  #include "hw/mem/nvdimm.h"
>  
> -- 
> 2.26.2
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



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

* Re: [PATCH] Clean up includes
  2020-11-13  6:12 [PATCH] Clean up includes Markus Armbruster
  2020-11-13  9:07 ` Paolo Bonzini
  2020-11-13  9:16 ` Dr. David Alan Gilbert
@ 2020-11-13  9:17 ` Thomas Huth
  2020-11-13  9:47 ` Cornelia Huck
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Thomas Huth @ 2020-11-13  9:17 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel
  Cc: mjrosato, mst, bsd, cohuck, david, laurent, dgilbert, pasic,
	alxndr, qemu-s390x, kraxel, stefanha, marcandre.lureau, pbonzini,
	borntraeger, rth

On 13/11/2020 07.12, Markus Armbruster wrote:
> Clean up includes so that osdep.h is included first and headers
> which it implies are not included manually.
> 
> This commit was created with scripts/clean-includes, with the changes
> to the following files manually reverted:
> 
>     contrib/libvhost-user/libvhost-user-glib.h
>     contrib/libvhost-user/libvhost-user.c
>     contrib/libvhost-user/libvhost-user.h
>     contrib/plugins/hotblocks.c
>     contrib/plugins/hotpages.c
>     contrib/plugins/howvec.c
>     contrib/plugins/lockstep.c
>     linux-user/mips64/cpu_loop.c
>     linux-user/mips64/signal.c
>     linux-user/sparc64/cpu_loop.c
>     linux-user/sparc64/signal.c
>     linux-user/x86_64/cpu_loop.c
>     linux-user/x86_64/signal.c
>     target/s390x/gen-features.c
>     tests/fp/platform.h
>     tests/migration/s390x/a-b-bios.c
>     tests/plugin/bb.c
>     tests/plugin/empty.c
>     tests/plugin/insn.c
>     tests/plugin/mem.c
>     tests/test-rcu-simpleq.c
>     tests/test-rcu-slist.c
>     tests/test-rcu-tailq.c
>     tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
> 
> contrib/plugins/, tests/plugin/, and tests/test-rcu-slist.c appear not
> to include osdep.h intentionally.  The remaining reverts are the same
> as in commit bbfff19688d.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> No real need to get this into 5.2 at this stage.  No real risk either.

Seems to compile fine:

 https://gitlab.com/huth/qemu/-/pipelines/215598144
 https://cirrus-ci.com/build/6127772462481408
 https://travis-ci.com/github/huth/qemu/builds/201194948

Tested-by: Thomas Huth <thuth@redhat.com>



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

* Re: [PATCH] Clean up includes
  2020-11-13  6:12 [PATCH] Clean up includes Markus Armbruster
                   ` (2 preceding siblings ...)
  2020-11-13  9:17 ` Thomas Huth
@ 2020-11-13  9:47 ` Cornelia Huck
  2020-11-13 15:16 ` Michael S. Tsirkin
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Cornelia Huck @ 2020-11-13  9:47 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: alxndr, thuth, mjrosato, mst, qemu-s390x, david, qemu-devel,
	laurent, pasic, borntraeger, bsd, kraxel, stefanha, pbonzini,
	marcandre.lureau, dgilbert, rth

On Fri, 13 Nov 2020 07:12:16 +0100
Markus Armbruster <armbru@redhat.com> wrote:

> Clean up includes so that osdep.h is included first and headers
> which it implies are not included manually.
> 
> This commit was created with scripts/clean-includes, with the changes
> to the following files manually reverted:
> 
>     contrib/libvhost-user/libvhost-user-glib.h
>     contrib/libvhost-user/libvhost-user.c
>     contrib/libvhost-user/libvhost-user.h
>     contrib/plugins/hotblocks.c
>     contrib/plugins/hotpages.c
>     contrib/plugins/howvec.c
>     contrib/plugins/lockstep.c
>     linux-user/mips64/cpu_loop.c
>     linux-user/mips64/signal.c
>     linux-user/sparc64/cpu_loop.c
>     linux-user/sparc64/signal.c
>     linux-user/x86_64/cpu_loop.c
>     linux-user/x86_64/signal.c
>     target/s390x/gen-features.c
>     tests/fp/platform.h
>     tests/migration/s390x/a-b-bios.c
>     tests/plugin/bb.c
>     tests/plugin/empty.c
>     tests/plugin/insn.c
>     tests/plugin/mem.c
>     tests/test-rcu-simpleq.c
>     tests/test-rcu-slist.c
>     tests/test-rcu-tailq.c
>     tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
> 
> contrib/plugins/, tests/plugin/, and tests/test-rcu-slist.c appear not
> to include osdep.h intentionally.  The remaining reverts are the same
> as in commit bbfff19688d.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> No real need to get this into 5.2 at this stage.  No real risk either.
> 
>  contrib/vhost-user-gpu/vugbm.h          |  2 --
>  contrib/vhost-user-gpu/vugpu.h          |  1 -
>  include/hw/block/swim.h                 |  1 -
>  include/hw/display/macfb.h              |  1 -
>  include/qemu/nvdimm-utils.h             |  1 -
>  tests/qtest/fuzz/fuzz.h                 |  1 -
>  tests/qtest/fuzz/generic_fuzz_configs.h |  1 -
>  tools/virtiofsd/fuse_common.h           |  2 --
>  tools/virtiofsd/fuse_log.h              |  1 -
>  tools/virtiofsd/fuse_lowlevel.h         |  3 ---
>  tools/virtiofsd/fuse_misc.h             |  1 -
>  tools/virtiofsd/passthrough_seccomp.h   |  1 -
>  contrib/vhost-user-gpu/virgl.c          |  1 +
>  contrib/vhost-user-gpu/vugbm.c          |  1 +
>  contrib/vhost-user-input/main.c         |  1 -
>  hw/display/artist.c                     |  1 -
>  hw/s390x/s390-pci-vfio.c                |  3 ++-
>  tools/virtiofsd/buffer.c                |  5 -----
>  tools/virtiofsd/fuse_log.c              |  2 --
>  tools/virtiofsd/fuse_lowlevel.c         | 10 ----------
>  tools/virtiofsd/fuse_opt.c              |  4 ----
>  tools/virtiofsd/fuse_signals.c          |  5 -----
>  tools/virtiofsd/fuse_virtio.c           | 10 ----------
>  tools/virtiofsd/helper.c                |  8 --------
>  tools/virtiofsd/passthrough_ll.c        | 12 ------------
>  tools/virtiofsd/passthrough_seccomp.c   |  3 ---
>  util/nvdimm-utils.c                     |  1 +
>  27 files changed, 5 insertions(+), 78 deletions(-)

Acked-by: Cornelia Huck <cohuck@redhat.com>



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

* Re: [PATCH] Clean up includes
  2020-11-13  6:12 [PATCH] Clean up includes Markus Armbruster
                   ` (3 preceding siblings ...)
  2020-11-13  9:47 ` Cornelia Huck
@ 2020-11-13 15:16 ` Michael S. Tsirkin
  2020-11-17 11:43 ` Stefan Hajnoczi
  2020-11-17 15:33 ` Alexander Bulekov
  6 siblings, 0 replies; 8+ messages in thread
From: Michael S. Tsirkin @ 2020-11-13 15:16 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: alxndr, thuth, mjrosato, david, qemu-s390x, cohuck, qemu-devel,
	laurent, pasic, borntraeger, bsd, kraxel, stefanha, pbonzini,
	marcandre.lureau, dgilbert, rth

On Fri, Nov 13, 2020 at 07:12:16AM +0100, Markus Armbruster wrote:
> Clean up includes so that osdep.h is included first and headers
> which it implies are not included manually.
> 
> This commit was created with scripts/clean-includes, with the changes
> to the following files manually reverted:
> 
>     contrib/libvhost-user/libvhost-user-glib.h
>     contrib/libvhost-user/libvhost-user.c
>     contrib/libvhost-user/libvhost-user.h
>     contrib/plugins/hotblocks.c
>     contrib/plugins/hotpages.c
>     contrib/plugins/howvec.c
>     contrib/plugins/lockstep.c
>     linux-user/mips64/cpu_loop.c
>     linux-user/mips64/signal.c
>     linux-user/sparc64/cpu_loop.c
>     linux-user/sparc64/signal.c
>     linux-user/x86_64/cpu_loop.c
>     linux-user/x86_64/signal.c
>     target/s390x/gen-features.c
>     tests/fp/platform.h
>     tests/migration/s390x/a-b-bios.c
>     tests/plugin/bb.c
>     tests/plugin/empty.c
>     tests/plugin/insn.c
>     tests/plugin/mem.c
>     tests/test-rcu-simpleq.c
>     tests/test-rcu-slist.c
>     tests/test-rcu-tailq.c
>     tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
> 
> contrib/plugins/, tests/plugin/, and tests/test-rcu-slist.c appear not
> to include osdep.h intentionally.  The remaining reverts are the same
> as in commit bbfff19688d.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

> ---
> No real need to get this into 5.2 at this stage.  No real risk either.
> 
>  contrib/vhost-user-gpu/vugbm.h          |  2 --
>  contrib/vhost-user-gpu/vugpu.h          |  1 -
>  include/hw/block/swim.h                 |  1 -
>  include/hw/display/macfb.h              |  1 -
>  include/qemu/nvdimm-utils.h             |  1 -
>  tests/qtest/fuzz/fuzz.h                 |  1 -
>  tests/qtest/fuzz/generic_fuzz_configs.h |  1 -
>  tools/virtiofsd/fuse_common.h           |  2 --
>  tools/virtiofsd/fuse_log.h              |  1 -
>  tools/virtiofsd/fuse_lowlevel.h         |  3 ---
>  tools/virtiofsd/fuse_misc.h             |  1 -
>  tools/virtiofsd/passthrough_seccomp.h   |  1 -
>  contrib/vhost-user-gpu/virgl.c          |  1 +
>  contrib/vhost-user-gpu/vugbm.c          |  1 +
>  contrib/vhost-user-input/main.c         |  1 -
>  hw/display/artist.c                     |  1 -
>  hw/s390x/s390-pci-vfio.c                |  3 ++-
>  tools/virtiofsd/buffer.c                |  5 -----
>  tools/virtiofsd/fuse_log.c              |  2 --
>  tools/virtiofsd/fuse_lowlevel.c         | 10 ----------
>  tools/virtiofsd/fuse_opt.c              |  4 ----
>  tools/virtiofsd/fuse_signals.c          |  5 -----
>  tools/virtiofsd/fuse_virtio.c           | 10 ----------
>  tools/virtiofsd/helper.c                |  8 --------
>  tools/virtiofsd/passthrough_ll.c        | 12 ------------
>  tools/virtiofsd/passthrough_seccomp.c   |  3 ---
>  util/nvdimm-utils.c                     |  1 +
>  27 files changed, 5 insertions(+), 78 deletions(-)
> 
> diff --git a/contrib/vhost-user-gpu/vugbm.h b/contrib/vhost-user-gpu/vugbm.h
> index 07e698fcd7..66f1520764 100644
> --- a/contrib/vhost-user-gpu/vugbm.h
> +++ b/contrib/vhost-user-gpu/vugbm.h
> @@ -10,10 +10,8 @@
>  #ifndef VHOST_USER_GPU_VUGBM_H
>  #define VHOST_USER_GPU_VUGBM_H
>  
> -#include "qemu/osdep.h"
>  
>  #ifdef CONFIG_MEMFD
> -#include <sys/mman.h>
>  #include <sys/ioctl.h>
>  #endif
>  
> diff --git a/contrib/vhost-user-gpu/vugpu.h b/contrib/vhost-user-gpu/vugpu.h
> index 3153c9a6de..5eca2a96ab 100644
> --- a/contrib/vhost-user-gpu/vugpu.h
> +++ b/contrib/vhost-user-gpu/vugpu.h
> @@ -15,7 +15,6 @@
>  #ifndef VUGPU_H
>  #define VUGPU_H
>  
> -#include "qemu/osdep.h"
>  
>  #include "contrib/libvhost-user/libvhost-user-glib.h"
>  #include "standard-headers/linux/virtio_gpu.h"
> diff --git a/include/hw/block/swim.h b/include/hw/block/swim.h
> index 5a49029543..c1bd5f6555 100644
> --- a/include/hw/block/swim.h
> +++ b/include/hw/block/swim.h
> @@ -11,7 +11,6 @@
>  #ifndef SWIM_H
>  #define SWIM_H
>  
> -#include "qemu/osdep.h"
>  #include "hw/sysbus.h"
>  #include "qom/object.h"
>  
> diff --git a/include/hw/display/macfb.h b/include/hw/display/macfb.h
> index c133fa271e..80806b0306 100644
> --- a/include/hw/display/macfb.h
> +++ b/include/hw/display/macfb.h
> @@ -13,7 +13,6 @@
>  #ifndef MACFB_H
>  #define MACFB_H
>  
> -#include "qemu/osdep.h"
>  #include "exec/memory.h"
>  #include "ui/console.h"
>  #include "qom/object.h"
> diff --git a/include/qemu/nvdimm-utils.h b/include/qemu/nvdimm-utils.h
> index 4b8b198ba7..5f45774c2c 100644
> --- a/include/qemu/nvdimm-utils.h
> +++ b/include/qemu/nvdimm-utils.h
> @@ -1,7 +1,6 @@
>  #ifndef NVDIMM_UTILS_H
>  #define NVDIMM_UTILS_H
>  
> -#include "qemu/osdep.h"
>  
>  GSList *nvdimm_get_device_list(void);
>  #endif
> diff --git a/tests/qtest/fuzz/fuzz.h b/tests/qtest/fuzz/fuzz.h
> index 08e9560a79..3a8570e84c 100644
> --- a/tests/qtest/fuzz/fuzz.h
> +++ b/tests/qtest/fuzz/fuzz.h
> @@ -14,7 +14,6 @@
>  #ifndef FUZZER_H_
>  #define FUZZER_H_
>  
> -#include "qemu/osdep.h"
>  #include "qemu/units.h"
>  #include "qapi/error.h"
>  
> diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h b/tests/qtest/fuzz/generic_fuzz_configs.h
> index c4d925f9e6..b4c5fefeca 100644
> --- a/tests/qtest/fuzz/generic_fuzz_configs.h
> +++ b/tests/qtest/fuzz/generic_fuzz_configs.h
> @@ -13,7 +13,6 @@
>  #ifndef GENERIC_FUZZ_CONFIGS_H
>  #define GENERIC_FUZZ_CONFIGS_H
>  
> -#include "qemu/osdep.h"
>  
>  typedef struct generic_fuzz_config {
>      const char *name, *args, *objects;
> diff --git a/tools/virtiofsd/fuse_common.h b/tools/virtiofsd/fuse_common.h
> index 5aee5193eb..30b18b4966 100644
> --- a/tools/virtiofsd/fuse_common.h
> +++ b/tools/virtiofsd/fuse_common.h
> @@ -18,8 +18,6 @@
>  
>  #include "fuse_log.h"
>  #include "fuse_opt.h"
> -#include <stdint.h>
> -#include <sys/types.h>
>  
>  /** Major version of FUSE library interface */
>  #define FUSE_MAJOR_VERSION 3
> diff --git a/tools/virtiofsd/fuse_log.h b/tools/virtiofsd/fuse_log.h
> index bf6c11ff11..8d7091bd4d 100644
> --- a/tools/virtiofsd/fuse_log.h
> +++ b/tools/virtiofsd/fuse_log.h
> @@ -14,7 +14,6 @@
>   * This file defines the logging interface of FUSE
>   */
>  
> -#include <stdarg.h>
>  
>  /**
>   * Log severity level
> diff --git a/tools/virtiofsd/fuse_lowlevel.h b/tools/virtiofsd/fuse_lowlevel.h
> index 9c06240f9e..0e10a14bc9 100644
> --- a/tools/virtiofsd/fuse_lowlevel.h
> +++ b/tools/virtiofsd/fuse_lowlevel.h
> @@ -25,10 +25,7 @@
>  
>  #include "fuse_common.h"
>  
> -#include <fcntl.h>
> -#include <sys/stat.h>
>  #include <sys/statvfs.h>
> -#include <sys/types.h>
>  #include <sys/uio.h>
>  #include <utime.h>
>  
> diff --git a/tools/virtiofsd/fuse_misc.h b/tools/virtiofsd/fuse_misc.h
> index 5c618ce21f..f252baa752 100644
> --- a/tools/virtiofsd/fuse_misc.h
> +++ b/tools/virtiofsd/fuse_misc.h
> @@ -7,7 +7,6 @@
>   */
>  
>  #include <pthread.h>
> -#include "config-host.h"
>  
>  /*
>   * Versioned symbols cannot be used in some cases because it
> diff --git a/tools/virtiofsd/passthrough_seccomp.h b/tools/virtiofsd/passthrough_seccomp.h
> index d47c8eade6..a3ab073f08 100644
> --- a/tools/virtiofsd/passthrough_seccomp.h
> +++ b/tools/virtiofsd/passthrough_seccomp.h
> @@ -9,7 +9,6 @@
>  #ifndef VIRTIOFSD_SECCOMP_H
>  #define VIRTIOFSD_SECCOMP_H
>  
> -#include <stdbool.h>
>  
>  void setup_seccomp(bool enable_syslog);
>  
> diff --git a/contrib/vhost-user-gpu/virgl.c b/contrib/vhost-user-gpu/virgl.c
> index b0bc22c3c1..e647278052 100644
> --- a/contrib/vhost-user-gpu/virgl.c
> +++ b/contrib/vhost-user-gpu/virgl.c
> @@ -12,6 +12,7 @@
>   * See the COPYING file in the top-level directory.
>   */
>  
> +#include "qemu/osdep.h"
>  #include <virglrenderer.h>
>  #include "virgl.h"
>  
> diff --git a/contrib/vhost-user-gpu/vugbm.c b/contrib/vhost-user-gpu/vugbm.c
> index 9c357b6399..f5304ada2f 100644
> --- a/contrib/vhost-user-gpu/vugbm.c
> +++ b/contrib/vhost-user-gpu/vugbm.c
> @@ -7,6 +7,7 @@
>   * See the COPYING file in the top-level directory.
>   */
>  
> +#include "qemu/osdep.h"
>  #include "vugbm.h"
>  
>  static bool
> diff --git a/contrib/vhost-user-input/main.c b/contrib/vhost-user-input/main.c
> index 6020c6f33a..25e2faa16b 100644
> --- a/contrib/vhost-user-input/main.c
> +++ b/contrib/vhost-user-input/main.c
> @@ -6,7 +6,6 @@
>  
>  #include "qemu/osdep.h"
>  
> -#include <glib.h>
>  #include <linux/input.h>
>  
>  #include "qemu/iov.h"
> diff --git a/hw/display/artist.c b/hw/display/artist.c
> index ed0e637f25..aa7bd594aa 100644
> --- a/hw/display/artist.c
> +++ b/hw/display/artist.c
> @@ -9,7 +9,6 @@
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
>  #include "qemu/error-report.h"
> -#include "qemu/typedefs.h"
>  #include "qemu/log.h"
>  #include "qemu/module.h"
>  #include "qemu/units.h"
> diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c
> index d5c78063b5..28343f90e3 100644
> --- a/hw/s390x/s390-pci-vfio.c
> +++ b/hw/s390x/s390-pci-vfio.c
> @@ -9,11 +9,12 @@
>   * directory.
>   */
>  
> +#include "qemu/osdep.h"
> +
>  #include <sys/ioctl.h>
>  #include <linux/vfio.h>
>  #include <linux/vfio_zdev.h>
>  
> -#include "qemu/osdep.h"
>  #include "trace.h"
>  #include "hw/s390x/s390-pci-bus.h"
>  #include "hw/s390x/s390-pci-clp.h"
> diff --git a/tools/virtiofsd/buffer.c b/tools/virtiofsd/buffer.c
> index 27c1377f22..2085db2743 100644
> --- a/tools/virtiofsd/buffer.c
> +++ b/tools/virtiofsd/buffer.c
> @@ -12,11 +12,6 @@
>  #include "qemu/osdep.h"
>  #include "fuse_i.h"
>  #include "fuse_lowlevel.h"
> -#include <assert.h>
> -#include <errno.h>
> -#include <stdlib.h>
> -#include <string.h>
> -#include <unistd.h>
>  
>  size_t fuse_buf_size(const struct fuse_bufvec *bufv)
>  {
> diff --git a/tools/virtiofsd/fuse_log.c b/tools/virtiofsd/fuse_log.c
> index c301ff6da1..745d88cd2a 100644
> --- a/tools/virtiofsd/fuse_log.c
> +++ b/tools/virtiofsd/fuse_log.c
> @@ -11,8 +11,6 @@
>  #include "qemu/osdep.h"
>  #include "fuse_log.h"
>  
> -#include <stdarg.h>
> -#include <stdio.h>
>  
>  static void default_log_func(__attribute__((unused)) enum fuse_log_level level,
>                               const char *fmt, va_list ap)
> diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
> index c70fb16a9a..d4119e92ab 100644
> --- a/tools/virtiofsd/fuse_lowlevel.c
> +++ b/tools/virtiofsd/fuse_lowlevel.c
> @@ -16,17 +16,7 @@
>  #include "fuse_opt.h"
>  #include "fuse_virtio.h"
>  
> -#include <assert.h>
> -#include <errno.h>
> -#include <glib.h>
> -#include <limits.h>
> -#include <stdbool.h>
> -#include <stddef.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  #include <sys/file.h>
> -#include <unistd.h>
>  
>  #define THREAD_POOL_SIZE 64
>  
> diff --git a/tools/virtiofsd/fuse_opt.c b/tools/virtiofsd/fuse_opt.c
> index 28922361a2..f0ab8d22f4 100644
> --- a/tools/virtiofsd/fuse_opt.c
> +++ b/tools/virtiofsd/fuse_opt.c
> @@ -14,10 +14,6 @@
>  #include "fuse_i.h"
>  #include "fuse_misc.h"
>  
> -#include <assert.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  
>  struct fuse_opt_context {
>      void *data;
> diff --git a/tools/virtiofsd/fuse_signals.c b/tools/virtiofsd/fuse_signals.c
> index f18625b6e2..1de46de1ce 100644
> --- a/tools/virtiofsd/fuse_signals.c
> +++ b/tools/virtiofsd/fuse_signals.c
> @@ -12,11 +12,6 @@
>  #include "fuse_i.h"
>  #include "fuse_lowlevel.h"
>  
> -#include <errno.h>
> -#include <signal.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  
>  static struct fuse_session *fuse_instance;
>  
> diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c
> index 83ba07c6cd..2c800418f1 100644
> --- a/tools/virtiofsd/fuse_virtio.c
> +++ b/tools/virtiofsd/fuse_virtio.c
> @@ -20,20 +20,10 @@
>  #include "fuse_opt.h"
>  #include "fuse_virtio.h"
>  
> -#include <assert.h>
> -#include <errno.h>
> -#include <glib.h>
> -#include <stdint.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  #include <sys/eventfd.h>
>  #include <sys/socket.h>
> -#include <sys/types.h>
>  #include <sys/un.h>
> -#include <sys/types.h>
>  #include <grp.h>
> -#include <unistd.h>
>  
>  #include "contrib/libvhost-user/libvhost-user.h"
>  
> diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
> index 75ac48dec2..28243b51b2 100644
> --- a/tools/virtiofsd/helper.c
> +++ b/tools/virtiofsd/helper.c
> @@ -16,16 +16,8 @@
>  #include "fuse_misc.h"
>  #include "fuse_opt.h"
>  
> -#include <errno.h>
> -#include <limits.h>
> -#include <stddef.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  #include <sys/param.h>
> -#include <sys/time.h>
>  #include <sys/resource.h>
> -#include <unistd.h>
>  
>  #define FUSE_HELPER_OPT(t, p)                       \
>      {                                               \
> diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
> index ec1008bceb..56cff773e4 100644
> --- a/tools/virtiofsd/passthrough_ll.c
> +++ b/tools/virtiofsd/passthrough_ll.c
> @@ -41,29 +41,17 @@
>  #include "fuse_log.h"
>  #include "fuse_lowlevel.h"
>  #include "standard-headers/linux/fuse.h"
> -#include <assert.h>
>  #include <cap-ng.h>
>  #include <dirent.h>
> -#include <errno.h>
> -#include <glib.h>
> -#include <inttypes.h>
> -#include <limits.h>
>  #include <pthread.h>
> -#include <stdbool.h>
> -#include <stddef.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  #include <sys/file.h>
>  #include <sys/mount.h>
>  #include <sys/prctl.h>
>  #include <sys/resource.h>
>  #include <sys/syscall.h>
> -#include <sys/types.h>
>  #include <sys/wait.h>
>  #include <sys/xattr.h>
>  #include <syslog.h>
> -#include <unistd.h>
>  
>  #include "qemu/cutils.h"
>  #include "passthrough_helpers.h"
> diff --git a/tools/virtiofsd/passthrough_seccomp.c b/tools/virtiofsd/passthrough_seccomp.c
> index 11623f56f2..a60d7da4b4 100644
> --- a/tools/virtiofsd/passthrough_seccomp.c
> +++ b/tools/virtiofsd/passthrough_seccomp.c
> @@ -10,10 +10,7 @@
>  #include "passthrough_seccomp.h"
>  #include "fuse_i.h"
>  #include "fuse_log.h"
> -#include <errno.h>
> -#include <glib.h>
>  #include <seccomp.h>
> -#include <stdlib.h>
>  
>  /* Bodge for libseccomp 2.4.2 which broke ppoll */
>  #if !defined(__SNR_ppoll) && defined(__SNR_brk)
> diff --git a/util/nvdimm-utils.c b/util/nvdimm-utils.c
> index 5cc768ca47..aa3d199f2d 100644
> --- a/util/nvdimm-utils.c
> +++ b/util/nvdimm-utils.c
> @@ -1,3 +1,4 @@
> +#include "qemu/osdep.h"
>  #include "qemu/nvdimm-utils.h"
>  #include "hw/mem/nvdimm.h"
>  
> -- 
> 2.26.2



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

* Re: [PATCH] Clean up includes
  2020-11-13  6:12 [PATCH] Clean up includes Markus Armbruster
                   ` (4 preceding siblings ...)
  2020-11-13 15:16 ` Michael S. Tsirkin
@ 2020-11-17 11:43 ` Stefan Hajnoczi
  2020-11-17 15:33 ` Alexander Bulekov
  6 siblings, 0 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2020-11-17 11:43 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: alxndr, thuth, cohuck, mjrosato, mst, qemu-s390x, david,
	qemu-devel, laurent, pasic, borntraeger, bsd, kraxel, pbonzini,
	marcandre.lureau, dgilbert, rth

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

On Fri, Nov 13, 2020 at 07:12:16AM +0100, Markus Armbruster wrote:
> Clean up includes so that osdep.h is included first and headers
> which it implies are not included manually.
> 
> This commit was created with scripts/clean-includes, with the changes
> to the following files manually reverted:
> 
>     contrib/libvhost-user/libvhost-user-glib.h
>     contrib/libvhost-user/libvhost-user.c
>     contrib/libvhost-user/libvhost-user.h
>     contrib/plugins/hotblocks.c
>     contrib/plugins/hotpages.c
>     contrib/plugins/howvec.c
>     contrib/plugins/lockstep.c
>     linux-user/mips64/cpu_loop.c
>     linux-user/mips64/signal.c
>     linux-user/sparc64/cpu_loop.c
>     linux-user/sparc64/signal.c
>     linux-user/x86_64/cpu_loop.c
>     linux-user/x86_64/signal.c
>     target/s390x/gen-features.c
>     tests/fp/platform.h
>     tests/migration/s390x/a-b-bios.c
>     tests/plugin/bb.c
>     tests/plugin/empty.c
>     tests/plugin/insn.c
>     tests/plugin/mem.c
>     tests/test-rcu-simpleq.c
>     tests/test-rcu-slist.c
>     tests/test-rcu-tailq.c
>     tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
> 
> contrib/plugins/, tests/plugin/, and tests/test-rcu-slist.c appear not
> to include osdep.h intentionally.  The remaining reverts are the same
> as in commit bbfff19688d.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> No real need to get this into 5.2 at this stage.  No real risk either.
> 
>  contrib/vhost-user-gpu/vugbm.h          |  2 --
>  contrib/vhost-user-gpu/vugpu.h          |  1 -
>  include/hw/block/swim.h                 |  1 -
>  include/hw/display/macfb.h              |  1 -
>  include/qemu/nvdimm-utils.h             |  1 -
>  tests/qtest/fuzz/fuzz.h                 |  1 -
>  tests/qtest/fuzz/generic_fuzz_configs.h |  1 -
>  tools/virtiofsd/fuse_common.h           |  2 --
>  tools/virtiofsd/fuse_log.h              |  1 -
>  tools/virtiofsd/fuse_lowlevel.h         |  3 ---
>  tools/virtiofsd/fuse_misc.h             |  1 -
>  tools/virtiofsd/passthrough_seccomp.h   |  1 -
>  contrib/vhost-user-gpu/virgl.c          |  1 +
>  contrib/vhost-user-gpu/vugbm.c          |  1 +
>  contrib/vhost-user-input/main.c         |  1 -
>  hw/display/artist.c                     |  1 -
>  hw/s390x/s390-pci-vfio.c                |  3 ++-
>  tools/virtiofsd/buffer.c                |  5 -----
>  tools/virtiofsd/fuse_log.c              |  2 --
>  tools/virtiofsd/fuse_lowlevel.c         | 10 ----------
>  tools/virtiofsd/fuse_opt.c              |  4 ----
>  tools/virtiofsd/fuse_signals.c          |  5 -----
>  tools/virtiofsd/fuse_virtio.c           | 10 ----------
>  tools/virtiofsd/helper.c                |  8 --------
>  tools/virtiofsd/passthrough_ll.c        | 12 ------------
>  tools/virtiofsd/passthrough_seccomp.c   |  3 ---
>  util/nvdimm-utils.c                     |  1 +
>  27 files changed, 5 insertions(+), 78 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] Clean up includes
  2020-11-13  6:12 [PATCH] Clean up includes Markus Armbruster
                   ` (5 preceding siblings ...)
  2020-11-17 11:43 ` Stefan Hajnoczi
@ 2020-11-17 15:33 ` Alexander Bulekov
  6 siblings, 0 replies; 8+ messages in thread
From: Alexander Bulekov @ 2020-11-17 15:33 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: thuth, cohuck, mjrosato, mst, qemu-s390x, david, qemu-devel,
	laurent, pasic, borntraeger, bsd, kraxel, stefanha, pbonzini,
	marcandre.lureau, dgilbert, rth

On 201113 0712, Markus Armbruster wrote:
> Clean up includes so that osdep.h is included first and headers
> which it implies are not included manually.
> 
> This commit was created with scripts/clean-includes, with the changes
> to the following files manually reverted:
> 
>     contrib/libvhost-user/libvhost-user-glib.h
>     contrib/libvhost-user/libvhost-user.c
>     contrib/libvhost-user/libvhost-user.h
>     contrib/plugins/hotblocks.c
>     contrib/plugins/hotpages.c
>     contrib/plugins/howvec.c
>     contrib/plugins/lockstep.c
>     linux-user/mips64/cpu_loop.c
>     linux-user/mips64/signal.c
>     linux-user/sparc64/cpu_loop.c
>     linux-user/sparc64/signal.c
>     linux-user/x86_64/cpu_loop.c
>     linux-user/x86_64/signal.c
>     target/s390x/gen-features.c
>     tests/fp/platform.h
>     tests/migration/s390x/a-b-bios.c
>     tests/plugin/bb.c
>     tests/plugin/empty.c
>     tests/plugin/insn.c
>     tests/plugin/mem.c
>     tests/test-rcu-simpleq.c
>     tests/test-rcu-slist.c
>     tests/test-rcu-tailq.c
>     tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
> 
> contrib/plugins/, tests/plugin/, and tests/test-rcu-slist.c appear not
> to include osdep.h intentionally.  The remaining reverts are the same
> as in commit bbfff19688d.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Acked-by: Alexander Bulekov <alxndr@bu.edu>

Thank you

> ---
> No real need to get this into 5.2 at this stage.  No real risk either.
> 
>  contrib/vhost-user-gpu/vugbm.h          |  2 --
>  contrib/vhost-user-gpu/vugpu.h          |  1 -
>  include/hw/block/swim.h                 |  1 -
>  include/hw/display/macfb.h              |  1 -
>  include/qemu/nvdimm-utils.h             |  1 -
>  tests/qtest/fuzz/fuzz.h                 |  1 -
>  tests/qtest/fuzz/generic_fuzz_configs.h |  1 -
>  tools/virtiofsd/fuse_common.h           |  2 --
>  tools/virtiofsd/fuse_log.h              |  1 -
>  tools/virtiofsd/fuse_lowlevel.h         |  3 ---
>  tools/virtiofsd/fuse_misc.h             |  1 -
>  tools/virtiofsd/passthrough_seccomp.h   |  1 -
>  contrib/vhost-user-gpu/virgl.c          |  1 +
>  contrib/vhost-user-gpu/vugbm.c          |  1 +
>  contrib/vhost-user-input/main.c         |  1 -
>  hw/display/artist.c                     |  1 -
>  hw/s390x/s390-pci-vfio.c                |  3 ++-
>  tools/virtiofsd/buffer.c                |  5 -----
>  tools/virtiofsd/fuse_log.c              |  2 --
>  tools/virtiofsd/fuse_lowlevel.c         | 10 ----------
>  tools/virtiofsd/fuse_opt.c              |  4 ----
>  tools/virtiofsd/fuse_signals.c          |  5 -----
>  tools/virtiofsd/fuse_virtio.c           | 10 ----------
>  tools/virtiofsd/helper.c                |  8 --------
>  tools/virtiofsd/passthrough_ll.c        | 12 ------------
>  tools/virtiofsd/passthrough_seccomp.c   |  3 ---
>  util/nvdimm-utils.c                     |  1 +
>  27 files changed, 5 insertions(+), 78 deletions(-)
> 
> diff --git a/contrib/vhost-user-gpu/vugbm.h b/contrib/vhost-user-gpu/vugbm.h
> index 07e698fcd7..66f1520764 100644
> --- a/contrib/vhost-user-gpu/vugbm.h
> +++ b/contrib/vhost-user-gpu/vugbm.h
> @@ -10,10 +10,8 @@
>  #ifndef VHOST_USER_GPU_VUGBM_H
>  #define VHOST_USER_GPU_VUGBM_H
>  
> -#include "qemu/osdep.h"
>  
>  #ifdef CONFIG_MEMFD
> -#include <sys/mman.h>
>  #include <sys/ioctl.h>
>  #endif
>  
> diff --git a/contrib/vhost-user-gpu/vugpu.h b/contrib/vhost-user-gpu/vugpu.h
> index 3153c9a6de..5eca2a96ab 100644
> --- a/contrib/vhost-user-gpu/vugpu.h
> +++ b/contrib/vhost-user-gpu/vugpu.h
> @@ -15,7 +15,6 @@
>  #ifndef VUGPU_H
>  #define VUGPU_H
>  
> -#include "qemu/osdep.h"
>  
>  #include "contrib/libvhost-user/libvhost-user-glib.h"
>  #include "standard-headers/linux/virtio_gpu.h"
> diff --git a/include/hw/block/swim.h b/include/hw/block/swim.h
> index 5a49029543..c1bd5f6555 100644
> --- a/include/hw/block/swim.h
> +++ b/include/hw/block/swim.h
> @@ -11,7 +11,6 @@
>  #ifndef SWIM_H
>  #define SWIM_H
>  
> -#include "qemu/osdep.h"
>  #include "hw/sysbus.h"
>  #include "qom/object.h"
>  
> diff --git a/include/hw/display/macfb.h b/include/hw/display/macfb.h
> index c133fa271e..80806b0306 100644
> --- a/include/hw/display/macfb.h
> +++ b/include/hw/display/macfb.h
> @@ -13,7 +13,6 @@
>  #ifndef MACFB_H
>  #define MACFB_H
>  
> -#include "qemu/osdep.h"
>  #include "exec/memory.h"
>  #include "ui/console.h"
>  #include "qom/object.h"
> diff --git a/include/qemu/nvdimm-utils.h b/include/qemu/nvdimm-utils.h
> index 4b8b198ba7..5f45774c2c 100644
> --- a/include/qemu/nvdimm-utils.h
> +++ b/include/qemu/nvdimm-utils.h
> @@ -1,7 +1,6 @@
>  #ifndef NVDIMM_UTILS_H
>  #define NVDIMM_UTILS_H
>  
> -#include "qemu/osdep.h"
>  
>  GSList *nvdimm_get_device_list(void);
>  #endif
> diff --git a/tests/qtest/fuzz/fuzz.h b/tests/qtest/fuzz/fuzz.h
> index 08e9560a79..3a8570e84c 100644
> --- a/tests/qtest/fuzz/fuzz.h
> +++ b/tests/qtest/fuzz/fuzz.h
> @@ -14,7 +14,6 @@
>  #ifndef FUZZER_H_
>  #define FUZZER_H_
>  
> -#include "qemu/osdep.h"
>  #include "qemu/units.h"
>  #include "qapi/error.h"
>  
> diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h b/tests/qtest/fuzz/generic_fuzz_configs.h
> index c4d925f9e6..b4c5fefeca 100644
> --- a/tests/qtest/fuzz/generic_fuzz_configs.h
> +++ b/tests/qtest/fuzz/generic_fuzz_configs.h
> @@ -13,7 +13,6 @@
>  #ifndef GENERIC_FUZZ_CONFIGS_H
>  #define GENERIC_FUZZ_CONFIGS_H
>  
> -#include "qemu/osdep.h"
>  
>  typedef struct generic_fuzz_config {
>      const char *name, *args, *objects;
> diff --git a/tools/virtiofsd/fuse_common.h b/tools/virtiofsd/fuse_common.h
> index 5aee5193eb..30b18b4966 100644
> --- a/tools/virtiofsd/fuse_common.h
> +++ b/tools/virtiofsd/fuse_common.h
> @@ -18,8 +18,6 @@
>  
>  #include "fuse_log.h"
>  #include "fuse_opt.h"
> -#include <stdint.h>
> -#include <sys/types.h>
>  
>  /** Major version of FUSE library interface */
>  #define FUSE_MAJOR_VERSION 3
> diff --git a/tools/virtiofsd/fuse_log.h b/tools/virtiofsd/fuse_log.h
> index bf6c11ff11..8d7091bd4d 100644
> --- a/tools/virtiofsd/fuse_log.h
> +++ b/tools/virtiofsd/fuse_log.h
> @@ -14,7 +14,6 @@
>   * This file defines the logging interface of FUSE
>   */
>  
> -#include <stdarg.h>
>  
>  /**
>   * Log severity level
> diff --git a/tools/virtiofsd/fuse_lowlevel.h b/tools/virtiofsd/fuse_lowlevel.h
> index 9c06240f9e..0e10a14bc9 100644
> --- a/tools/virtiofsd/fuse_lowlevel.h
> +++ b/tools/virtiofsd/fuse_lowlevel.h
> @@ -25,10 +25,7 @@
>  
>  #include "fuse_common.h"
>  
> -#include <fcntl.h>
> -#include <sys/stat.h>
>  #include <sys/statvfs.h>
> -#include <sys/types.h>
>  #include <sys/uio.h>
>  #include <utime.h>
>  
> diff --git a/tools/virtiofsd/fuse_misc.h b/tools/virtiofsd/fuse_misc.h
> index 5c618ce21f..f252baa752 100644
> --- a/tools/virtiofsd/fuse_misc.h
> +++ b/tools/virtiofsd/fuse_misc.h
> @@ -7,7 +7,6 @@
>   */
>  
>  #include <pthread.h>
> -#include "config-host.h"
>  
>  /*
>   * Versioned symbols cannot be used in some cases because it
> diff --git a/tools/virtiofsd/passthrough_seccomp.h b/tools/virtiofsd/passthrough_seccomp.h
> index d47c8eade6..a3ab073f08 100644
> --- a/tools/virtiofsd/passthrough_seccomp.h
> +++ b/tools/virtiofsd/passthrough_seccomp.h
> @@ -9,7 +9,6 @@
>  #ifndef VIRTIOFSD_SECCOMP_H
>  #define VIRTIOFSD_SECCOMP_H
>  
> -#include <stdbool.h>
>  
>  void setup_seccomp(bool enable_syslog);
>  
> diff --git a/contrib/vhost-user-gpu/virgl.c b/contrib/vhost-user-gpu/virgl.c
> index b0bc22c3c1..e647278052 100644
> --- a/contrib/vhost-user-gpu/virgl.c
> +++ b/contrib/vhost-user-gpu/virgl.c
> @@ -12,6 +12,7 @@
>   * See the COPYING file in the top-level directory.
>   */
>  
> +#include "qemu/osdep.h"
>  #include <virglrenderer.h>
>  #include "virgl.h"
>  
> diff --git a/contrib/vhost-user-gpu/vugbm.c b/contrib/vhost-user-gpu/vugbm.c
> index 9c357b6399..f5304ada2f 100644
> --- a/contrib/vhost-user-gpu/vugbm.c
> +++ b/contrib/vhost-user-gpu/vugbm.c
> @@ -7,6 +7,7 @@
>   * See the COPYING file in the top-level directory.
>   */
>  
> +#include "qemu/osdep.h"
>  #include "vugbm.h"
>  
>  static bool
> diff --git a/contrib/vhost-user-input/main.c b/contrib/vhost-user-input/main.c
> index 6020c6f33a..25e2faa16b 100644
> --- a/contrib/vhost-user-input/main.c
> +++ b/contrib/vhost-user-input/main.c
> @@ -6,7 +6,6 @@
>  
>  #include "qemu/osdep.h"
>  
> -#include <glib.h>
>  #include <linux/input.h>
>  
>  #include "qemu/iov.h"
> diff --git a/hw/display/artist.c b/hw/display/artist.c
> index ed0e637f25..aa7bd594aa 100644
> --- a/hw/display/artist.c
> +++ b/hw/display/artist.c
> @@ -9,7 +9,6 @@
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
>  #include "qemu/error-report.h"
> -#include "qemu/typedefs.h"
>  #include "qemu/log.h"
>  #include "qemu/module.h"
>  #include "qemu/units.h"
> diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c
> index d5c78063b5..28343f90e3 100644
> --- a/hw/s390x/s390-pci-vfio.c
> +++ b/hw/s390x/s390-pci-vfio.c
> @@ -9,11 +9,12 @@
>   * directory.
>   */
>  
> +#include "qemu/osdep.h"
> +
>  #include <sys/ioctl.h>
>  #include <linux/vfio.h>
>  #include <linux/vfio_zdev.h>
>  
> -#include "qemu/osdep.h"
>  #include "trace.h"
>  #include "hw/s390x/s390-pci-bus.h"
>  #include "hw/s390x/s390-pci-clp.h"
> diff --git a/tools/virtiofsd/buffer.c b/tools/virtiofsd/buffer.c
> index 27c1377f22..2085db2743 100644
> --- a/tools/virtiofsd/buffer.c
> +++ b/tools/virtiofsd/buffer.c
> @@ -12,11 +12,6 @@
>  #include "qemu/osdep.h"
>  #include "fuse_i.h"
>  #include "fuse_lowlevel.h"
> -#include <assert.h>
> -#include <errno.h>
> -#include <stdlib.h>
> -#include <string.h>
> -#include <unistd.h>
>  
>  size_t fuse_buf_size(const struct fuse_bufvec *bufv)
>  {
> diff --git a/tools/virtiofsd/fuse_log.c b/tools/virtiofsd/fuse_log.c
> index c301ff6da1..745d88cd2a 100644
> --- a/tools/virtiofsd/fuse_log.c
> +++ b/tools/virtiofsd/fuse_log.c
> @@ -11,8 +11,6 @@
>  #include "qemu/osdep.h"
>  #include "fuse_log.h"
>  
> -#include <stdarg.h>
> -#include <stdio.h>
>  
>  static void default_log_func(__attribute__((unused)) enum fuse_log_level level,
>                               const char *fmt, va_list ap)
> diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
> index c70fb16a9a..d4119e92ab 100644
> --- a/tools/virtiofsd/fuse_lowlevel.c
> +++ b/tools/virtiofsd/fuse_lowlevel.c
> @@ -16,17 +16,7 @@
>  #include "fuse_opt.h"
>  #include "fuse_virtio.h"
>  
> -#include <assert.h>
> -#include <errno.h>
> -#include <glib.h>
> -#include <limits.h>
> -#include <stdbool.h>
> -#include <stddef.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  #include <sys/file.h>
> -#include <unistd.h>
>  
>  #define THREAD_POOL_SIZE 64
>  
> diff --git a/tools/virtiofsd/fuse_opt.c b/tools/virtiofsd/fuse_opt.c
> index 28922361a2..f0ab8d22f4 100644
> --- a/tools/virtiofsd/fuse_opt.c
> +++ b/tools/virtiofsd/fuse_opt.c
> @@ -14,10 +14,6 @@
>  #include "fuse_i.h"
>  #include "fuse_misc.h"
>  
> -#include <assert.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  
>  struct fuse_opt_context {
>      void *data;
> diff --git a/tools/virtiofsd/fuse_signals.c b/tools/virtiofsd/fuse_signals.c
> index f18625b6e2..1de46de1ce 100644
> --- a/tools/virtiofsd/fuse_signals.c
> +++ b/tools/virtiofsd/fuse_signals.c
> @@ -12,11 +12,6 @@
>  #include "fuse_i.h"
>  #include "fuse_lowlevel.h"
>  
> -#include <errno.h>
> -#include <signal.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  
>  static struct fuse_session *fuse_instance;
>  
> diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c
> index 83ba07c6cd..2c800418f1 100644
> --- a/tools/virtiofsd/fuse_virtio.c
> +++ b/tools/virtiofsd/fuse_virtio.c
> @@ -20,20 +20,10 @@
>  #include "fuse_opt.h"
>  #include "fuse_virtio.h"
>  
> -#include <assert.h>
> -#include <errno.h>
> -#include <glib.h>
> -#include <stdint.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  #include <sys/eventfd.h>
>  #include <sys/socket.h>
> -#include <sys/types.h>
>  #include <sys/un.h>
> -#include <sys/types.h>
>  #include <grp.h>
> -#include <unistd.h>
>  
>  #include "contrib/libvhost-user/libvhost-user.h"
>  
> diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
> index 75ac48dec2..28243b51b2 100644
> --- a/tools/virtiofsd/helper.c
> +++ b/tools/virtiofsd/helper.c
> @@ -16,16 +16,8 @@
>  #include "fuse_misc.h"
>  #include "fuse_opt.h"
>  
> -#include <errno.h>
> -#include <limits.h>
> -#include <stddef.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  #include <sys/param.h>
> -#include <sys/time.h>
>  #include <sys/resource.h>
> -#include <unistd.h>
>  
>  #define FUSE_HELPER_OPT(t, p)                       \
>      {                                               \
> diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
> index ec1008bceb..56cff773e4 100644
> --- a/tools/virtiofsd/passthrough_ll.c
> +++ b/tools/virtiofsd/passthrough_ll.c
> @@ -41,29 +41,17 @@
>  #include "fuse_log.h"
>  #include "fuse_lowlevel.h"
>  #include "standard-headers/linux/fuse.h"
> -#include <assert.h>
>  #include <cap-ng.h>
>  #include <dirent.h>
> -#include <errno.h>
> -#include <glib.h>
> -#include <inttypes.h>
> -#include <limits.h>
>  #include <pthread.h>
> -#include <stdbool.h>
> -#include <stddef.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
>  #include <sys/file.h>
>  #include <sys/mount.h>
>  #include <sys/prctl.h>
>  #include <sys/resource.h>
>  #include <sys/syscall.h>
> -#include <sys/types.h>
>  #include <sys/wait.h>
>  #include <sys/xattr.h>
>  #include <syslog.h>
> -#include <unistd.h>
>  
>  #include "qemu/cutils.h"
>  #include "passthrough_helpers.h"
> diff --git a/tools/virtiofsd/passthrough_seccomp.c b/tools/virtiofsd/passthrough_seccomp.c
> index 11623f56f2..a60d7da4b4 100644
> --- a/tools/virtiofsd/passthrough_seccomp.c
> +++ b/tools/virtiofsd/passthrough_seccomp.c
> @@ -10,10 +10,7 @@
>  #include "passthrough_seccomp.h"
>  #include "fuse_i.h"
>  #include "fuse_log.h"
> -#include <errno.h>
> -#include <glib.h>
>  #include <seccomp.h>
> -#include <stdlib.h>
>  
>  /* Bodge for libseccomp 2.4.2 which broke ppoll */
>  #if !defined(__SNR_ppoll) && defined(__SNR_brk)
> diff --git a/util/nvdimm-utils.c b/util/nvdimm-utils.c
> index 5cc768ca47..aa3d199f2d 100644
> --- a/util/nvdimm-utils.c
> +++ b/util/nvdimm-utils.c
> @@ -1,3 +1,4 @@
> +#include "qemu/osdep.h"
>  #include "qemu/nvdimm-utils.h"
>  #include "hw/mem/nvdimm.h"
>  
> -- 
> 2.26.2
> 


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

end of thread, other threads:[~2020-11-17 15:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13  6:12 [PATCH] Clean up includes Markus Armbruster
2020-11-13  9:07 ` Paolo Bonzini
2020-11-13  9:16 ` Dr. David Alan Gilbert
2020-11-13  9:17 ` Thomas Huth
2020-11-13  9:47 ` Cornelia Huck
2020-11-13 15:16 ` Michael S. Tsirkin
2020-11-17 11:43 ` Stefan Hajnoczi
2020-11-17 15:33 ` Alexander Bulekov

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.