Skip to content

Commit

Permalink
Clean up includes
Browse files Browse the repository at this point in the history
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 bbfff19.

Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <[email protected]>
Acked-by: Paolo Bonzini <[email protected]>
Acked-by: Dr. David Alan Gilbert <[email protected]>
Tested-by: Thomas Huth <[email protected]>
Acked-by: Cornelia Huck <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Acked-by: Alexander Bulekov <[email protected]>
  • Loading branch information
Markus Armbruster committed Dec 10, 2020
1 parent 00ef48f commit 4bd802b
Show file tree
Hide file tree
Showing 27 changed files with 5 additions and 78 deletions.
1 change: 1 addition & 0 deletions contrib/vhost-user-gpu/virgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* See the COPYING file in the top-level directory.
*/

#include "qemu/osdep.h"
#include <virglrenderer.h>
#include "virgl.h"

Expand Down
1 change: 1 addition & 0 deletions contrib/vhost-user-gpu/vugbm.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* See the COPYING file in the top-level directory.
*/

#include "qemu/osdep.h"
#include "vugbm.h"

static bool
Expand Down
2 changes: 0 additions & 2 deletions contrib/vhost-user-gpu/vugbm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion contrib/vhost-user-gpu/vugpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion contrib/vhost-user-input/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "qemu/osdep.h"

#include <glib.h>
#include <linux/input.h>

#include "qemu/iov.h"
Expand Down
1 change: 0 additions & 1 deletion hw/display/artist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion hw/s390x/s390-pci-vfio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion include/hw/block/swim.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#ifndef SWIM_H
#define SWIM_H

#include "qemu/osdep.h"
#include "hw/sysbus.h"
#include "qom/object.h"

Expand Down
1 change: 0 additions & 1 deletion include/hw/display/macfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion include/qemu/nvdimm-utils.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef NVDIMM_UTILS_H
#define NVDIMM_UTILS_H

#include "qemu/osdep.h"

GSList *nvdimm_get_device_list(void);
#endif
1 change: 0 additions & 1 deletion tests/qtest/fuzz/fuzz.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#ifndef FUZZER_H_
#define FUZZER_H_

#include "qemu/osdep.h"
#include "qemu/units.h"
#include "qapi/error.h"

Expand Down
1 change: 0 additions & 1 deletion tests/qtest/fuzz/generic_fuzz_configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions tools/virtiofsd/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 0 additions & 2 deletions tools/virtiofsd/fuse_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tools/virtiofsd/fuse_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion tools/virtiofsd/fuse_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* This file defines the logging interface of FUSE
*/

#include <stdarg.h>

/**
* Log severity level
Expand Down
10 changes: 0 additions & 10 deletions tools/virtiofsd/fuse_lowlevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions tools/virtiofsd/fuse_lowlevel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
1 change: 0 additions & 1 deletion tools/virtiofsd/fuse_misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/

#include <pthread.h>
#include "config-host.h"

/*
* Versioned symbols cannot be used in some cases because it
Expand Down
4 changes: 0 additions & 4 deletions tools/virtiofsd/fuse_opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions tools/virtiofsd/fuse_signals.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
10 changes: 0 additions & 10 deletions tools/virtiofsd/fuse_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 "libvhost-user.h"

Expand Down
8 changes: 0 additions & 8 deletions tools/virtiofsd/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
{ \
Expand Down
12 changes: 0 additions & 12 deletions tools/virtiofsd/passthrough_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 0 additions & 3 deletions tools/virtiofsd/passthrough_seccomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion tools/virtiofsd/passthrough_seccomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#ifndef VIRTIOFSD_SECCOMP_H
#define VIRTIOFSD_SECCOMP_H

#include <stdbool.h>

void setup_seccomp(bool enable_syslog);

Expand Down
1 change: 1 addition & 0 deletions util/nvdimm-utils.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "qemu/osdep.h"
#include "qemu/nvdimm-utils.h"
#include "hw/mem/nvdimm.h"

Expand Down

0 comments on commit 4bd802b

Please sign in to comment.