Clean up includes
authorMarkus Armbruster <armbru@redhat.com>
Fri, 13 Nov 2020 06:12:16 +0000 (07:12 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 10 Dec 2020 16:16:44 +0000 (17:16 +0100)
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>
Message-Id: <20201113061216.2483385-1-armbru@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Alexander Bulekov <alxndr@bu.edu>
27 files changed:
contrib/vhost-user-gpu/virgl.c
contrib/vhost-user-gpu/vugbm.c
contrib/vhost-user-gpu/vugbm.h
contrib/vhost-user-gpu/vugpu.h
contrib/vhost-user-input/main.c
hw/display/artist.c
hw/s390x/s390-pci-vfio.c
include/hw/block/swim.h
include/hw/display/macfb.h
include/qemu/nvdimm-utils.h
tests/qtest/fuzz/fuzz.h
tests/qtest/fuzz/generic_fuzz_configs.h
tools/virtiofsd/buffer.c
tools/virtiofsd/fuse_common.h
tools/virtiofsd/fuse_log.c
tools/virtiofsd/fuse_log.h
tools/virtiofsd/fuse_lowlevel.c
tools/virtiofsd/fuse_lowlevel.h
tools/virtiofsd/fuse_misc.h
tools/virtiofsd/fuse_opt.c
tools/virtiofsd/fuse_signals.c
tools/virtiofsd/fuse_virtio.c
tools/virtiofsd/helper.c
tools/virtiofsd/passthrough_ll.c
tools/virtiofsd/passthrough_seccomp.c
tools/virtiofsd/passthrough_seccomp.h
util/nvdimm-utils.c

index b0bc22c3c13db0e8b0b450dac19df5390afbca26..e6472780529b58a5f765fcdf544d00901786f6ae 100644 (file)
@@ -12,6 +12,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include <virglrenderer.h>
 #include "virgl.h"
 
index 9c357b63993bc8ee0c4e28cb262f4b921f597342..f5304ada2f1be5fe8f9e3e02821e92585b172183 100644 (file)
@@ -7,6 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "vugbm.h"
 
 static bool
index 07e698fcd74ba48cbdb800d966840d7b436ade07..66f1520764a6041e4cbbc01d971c0ad1c96d0e51 100644 (file)
 #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
 
index bdf9a74b46d2c98423f496a2a6edccf6b47953f2..ad664c4df853eeea5de143818acd300839a94c8e 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef VUGPU_H
 #define VUGPU_H
 
-#include "qemu/osdep.h"
 
 #include "libvhost-user-glib.h"
 #include "standard-headers/linux/virtio_gpu.h"
index d2de47cee7fece25c3282e2795294c01a3b2a50c..c15d18c33f0c3eba5afb824d2df131678501911a 100644 (file)
@@ -6,7 +6,6 @@
 
 #include "qemu/osdep.h"
 
-#include <glib.h>
 #include <linux/input.h>
 
 #include "qemu/iov.h"
index ed0e637f250c972c920956bafeb7603324e1830a..aa7bd594aac0d09e144d48904a1b31dd5f65954b 100644 (file)
@@ -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"
index 9296e1bb6efae945f436f75ddc76659564e758c4..ead4f222d55a527347647a0106ea9ee54c7b3f67 100644 (file)
@@ -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"
index 5a49029543bfd8195c2fea9f93fbb7ccb83a3625..c1bd5f65557d9e4598035b3e0182ad9e4c08c60c 100644 (file)
@@ -11,7 +11,6 @@
 #ifndef SWIM_H
 #define SWIM_H
 
-#include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "qom/object.h"
 
index c133fa271efc49c78f6474f4de5c12beca31fb93..80806b0306a98c1d594a181452cb8a9cfc731983 100644 (file)
@@ -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"
index 4b8b198ba761b64cc370722cb55149dc54859273..5f45774c2ca535cb085ca2fe31ec82646565c8fd 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef NVDIMM_UTILS_H
 #define NVDIMM_UTILS_H
 
-#include "qemu/osdep.h"
 
 GSList *nvdimm_get_device_list(void);
 #endif
index 08e9560a795c1c94633cd13e8cb71b19ade697c0..3a8570e84c796f62e72f9c303fea9ed9892a53a2 100644 (file)
@@ -14,7 +14,6 @@
 #ifndef FUZZER_H_
 #define FUZZER_H_
 
-#include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "qapi/error.h"
 
index c4d925f9e6b297cf7bb000f1d69089f5d0095b72..b4c5fefeca31d3944cfa6470a0315f330021d0eb 100644 (file)
@@ -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;
index bdc608c22132500167341edbdb412449c8c18b12..874f01c4882b4bcc56433128d26d9e3914b97fc3 100644 (file)
 #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)
 {
index 5aee5193eb29ea10de8e6ce46b63a91d878c3405..30b18b49663a240b436f0ece2b9cb454df9da2df 100644 (file)
@@ -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
index c301ff6da14526fb8f229aba76295512825fea33..745d88cd2a496fd7554fa21b3833b32ea6f7012d 100644 (file)
@@ -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)
index bf6c11ff1123d1c81a89c73ccf3687610eff7624..8d7091bd4d0b37cfcb2d392cbc45a6eb05369651 100644 (file)
@@ -14,7 +14,6 @@
  * This file defines the logging interface of FUSE
  */
 
-#include <stdarg.h>
 
 /**
  * Log severity level
index c70fb16a9a5313160a4cc53faf86e1265cc28082..d4119e92ab4111e499deebb2ef31d9591d612033 100644 (file)
 #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
 
index 9c06240f9e61ea259241a3ec77e9cf2ff8d5856f..0e10a14bc9d8a5d049ba6efad9420d02122e46ce 100644 (file)
 
 #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>
 
index 5c618ce21fb33745748372dea31a3b07eb551bea..f252baa7526ad8bc055a5051b4574479f7c1d0e3 100644 (file)
@@ -7,7 +7,6 @@
  */
 
 #include <pthread.h>
-#include "config-host.h"
 
 /*
  * Versioned symbols cannot be used in some cases because it
index 28922361a26f6fa0da304fd1869b26791d879322..f0ab8d22f4db973e49b48c9b54b8d58c8dadf80f 100644 (file)
 #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;
index f18625b6e23da9bfb3c95d02448e9755f99b18d4..1de46de1ce6421b8188b8eea99ad5347626c2cb9 100644 (file)
 #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;
 
index 623812c432aae2ac9dad7df0b9d412cbe182467c..b264dcbd187958d1d23efe6ae651efff0df06c2d 100644 (file)
 #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 "libvhost-user.h"
 
index 75ac48dec2534bfa972742a1ea01ceef7b0328c3..28243b51b2de733179d2ff0d283eb5f4580e4c67 100644 (file)
 #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)                       \
     {                                               \
index 97485b22b4114228e622a0b256d9a9bfedd0ca9e..12de321745304d61495a306001bc7c1e3222a989 100644 (file)
 #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"
index 11623f56f20ca6ceb850ecf2cb8da36cebcf897a..a60d7da4b4e27cc32877da9e9df423c83ef2025e 100644 (file)
 #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)
index d47c8eade6fdb5a02a8301775df9c5b0aea5ca99..a3ab073f08fab7ba8ac04353532dda20e8bf5483 100644 (file)
@@ -9,7 +9,6 @@
 #ifndef VIRTIOFSD_SECCOMP_H
 #define VIRTIOFSD_SECCOMP_H
 
-#include <stdbool.h>
 
 void setup_seccomp(bool enable_syslog);
 
index 5cc768ca47965e9636123317910c5314eb8b30eb..aa3d199f2d117616e8bacf8103e3760e8ba45a52 100644 (file)
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu/nvdimm-utils.h"
 #include "hw/mem/nvdimm.h"