tests: clean includes
PATCH 2/2 tests: Clean up includes
In reply to Peter MaydellClean 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.
---
This deals with every .c file in tests/ except those in tests/tcg which I think are all standalone programs targeting the guest.
--- tests/ac97-test.c | 3 +-- tests/bios-tables-test.c | 4 +--- tests/boot-order-test.c | 2 +- tests/check-qdict.c | 1 + tests/check-qfloat.c | 1 + tests/check-qint.c | 1 + tests/check-qjson.c | 1 + tests/check-qlist.c | 1 + tests/check-qom-interface.c | 1 + tests/check-qom-proplist.c | 1 + tests/check-qstring.c | 1 + tests/crypto-tls-x509-helpers.c | 4 +--- tests/device-introspect-test.c | 2 +- tests/display-vga-test.c | 3 +-- tests/drive_del-test.c | 2 +- tests/ds1338-test.c | 1 + tests/e1000-test.c | 3 +-- tests/eepro100-test.c | 3 +-- tests/endianness-test.c | 5 +---- tests/es1370-test.c | 3 +-- tests/fdc-test.c | 4 +--- tests/fw_cfg-test.c | 2 +- tests/hd-geo-test.c | 4 +--- tests/i440fx-test.c | 5 ----- tests/i82801b11-test.c | 3 +-- tests/intel-hda-test.c | 3 +-- tests/io-channel-helpers.c | 1 + tests/ioh3420-test.c | 3 +-- tests/ipmi-bt-test.c | 5 +---- tests/ipmi-kcs-test.c | 4 +--- tests/ipoctal232-test.c | 3 +-- tests/ivshmem-test.c | 6 +----- tests/libqos/fw_cfg.c | 1 + tests/libqos/i2c-imx.c | 3 +-- tests/libqos/i2c-omap.c | 3 +-- tests/libqos/i2c.c | 1 + tests/libqos/libqos-pc.c | 1 + tests/libqos/libqos.c | 6 +----- tests/libqos/malloc-generic.c | 1 + tests/libqos/malloc-pc.c | 1 + tests/libqos/malloc.c | 3 +-- tests/libqos/pci-pc.c | 1 + tests/libqos/pci.c | 1 + tests/libqos/usb.c | 3 +-- tests/libqos/virtio-mmio.c | 2 +- tests/libqos/virtio-pci.c | 2 +- tests/libqos/virtio.c | 1 + tests/libqtest.c | 12 ++---------- tests/m48t59-test.c | 5 +---- tests/multiboot/libc.c | 1 + tests/multiboot/mmap.c | 1 + tests/multiboot/modules.c | 1 + tests/ne2000-test.c | 3 +-- tests/nvme-test.c | 3 +-- tests/pc-cpu-test.c | 3 +-- tests/pcnet-test.c | 3 +-- tests/pkix_asn1_tab.c | 1 + tests/pvpanic-test.c | 3 +-- tests/q35-test.c | 3 +-- tests/qemu-iotests/socket_scm_helper.c | 8 +------- tests/qom-test.c | 3 +-- tests/rcutorture.c | 5 +---- tests/rtc-test.c | 5 +---- tests/rtl8139-test.c | 3 +-- tests/spapr-phb-test.c | 1 + tests/tco-test.c | 4 +--- tests/test-aio.c | 1 + tests/test-base64.c | 1 + tests/test-bitops.c | 3 +-- tests/test-blockjob-txn.c | 2 +- tests/test-coroutine.c | 1 + tests/test-crypto-cipher.c | 1 + tests/test-crypto-hash.c | 1 + tests/test-crypto-secret.c | 1 + tests/test-crypto-tlscredsx509.c | 4 +--- tests/test-crypto-tlssession.c | 4 +--- tests/test-cutils.c | 3 +-- tests/test-hbitmap.c | 4 +--- tests/test-int128.c | 3 +-- tests/test-io-channel-buffer.c | 1 + tests/test-io-channel-command.c | 1 + tests/test-io-channel-file.c | 1 + tests/test-io-channel-socket.c | 1 + tests/test-io-channel-tls.c | 4 +--- tests/test-io-task.c | 1 + tests/test-iov.c | 1 + tests/test-mul64.c | 3 +-- tests/test-netfilter.c | 1 + tests/test-opts-visitor.c | 1 + tests/test-qdev-global-props.c | 2 +- tests/test-qemu-opts.c | 3 +-- tests/test-qga.c | 9 +-------- tests/test-qmp-commands.c | 1 + tests/test-qmp-event.c | 2 +- tests/test-qmp-input-strict.c | 2 +- tests/test-qmp-input-visitor.c | 2 +- tests/test-qmp-output-visitor.c | 1 + tests/test-rcu-list.c | 6 +----- tests/test-rfifolock.c | 1 + tests/test-string-input-visitor.c | 2 +- tests/test-string-output-visitor.c | 1 + tests/test-thread-pool.c | 1 + tests/test-throttle.c | 1 + tests/test-timed-average.c | 2 +- tests/test-visitor-serialization.c | 3 +-- tests/test-vmstate.c | 1 + tests/test-write-threshold.c | 2 +- tests/test-x86-cpuid.c | 1 + tests/test-xbzrle.c | 6 +----- tests/tmp105-test.c | 1 + tests/tpci200-test.c | 3 +-- tests/vhost-user-bridge.c | 12 +----------- tests/vhost-user-test.c | 1 + tests/virtio-balloon-test.c | 3 +-- tests/virtio-blk-test.c | 5 +---- tests/virtio-console-test.c | 3 +-- tests/virtio-net-test.c | 3 +-- tests/virtio-rng-test.c | 3 +-- tests/virtio-scsi-test.c | 4 +--- tests/virtio-serial-test.c | 3 +-- tests/vmxnet3-test.c | 3 +-- tests/wdt_ib700-test.c | 3 +-- 122 files changed, 122 insertions(+), 202 deletions(-)
tests/ac97-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" /* Tests only initialization so far. TODO: Replace with functional tests */ static void nop (void )
tests/bios-tables-test.c +1 -3
@@ -10,13 +10,11 @@* See the COPYING file in the top-level directory. */ -#include <string.h> -#include <stdio.h> +#include "qemu/osdep.h" #include <glib.h> #include <glib/gstdio.h> #include "qemu-common.h" #include "libqtest.h" -#include "qemu/compiler.h" #include "hw/acpi/acpi-defs.h" #include "hw/smbios/smbios.h" #include "qemu/bitmap.h"
tests/boot-order-test.c +1 -1
@@ -10,7 +10,7 @@* See the COPYING file in the top-level directory. */ -#include <string.h> +#include "qemu/osdep.h" #include <glib.h> #include "libqos/fw_cfg.h" #include "libqtest.h"
tests/check-qdict.c +1 -0
@@ -9,6 +9,7 @@* This work is licensed under the terms of the GNU LGPL, version 2.1 or later. * See the COPYING.LIB file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include "qapi/qmp/qint.h"
tests/check-qfloat.c +1 -0
@@ -10,6 +10,7 @@* See the COPYING.LIB file in the top-level directory. * */ +#include "qemu/osdep.h" #include <glib.h> #include "qapi/qmp/qfloat.h"
tests/check-qint.c +1 -0
@@ -9,6 +9,7 @@* This work is licensed under the terms of the GNU LGPL, version 2.1 or later. * See the COPYING.LIB file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include "qapi/qmp/qint.h"
tests/check-qjson.c +1 -0
@@ -10,6 +10,7 @@* See the COPYING.LIB file in the top-level directory. * */ +#include "qemu/osdep.h" #include <glib.h> #include "qapi/qmp/qstring.h"
tests/check-qlist.c +1 -0
@@ -9,6 +9,7 @@* This work is licensed under the terms of the GNU LGPL, version 2.1 or later. * See the COPYING.LIB file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include "qapi/qmp/qint.h"
tests/check-qom-interface.c +1 -0
@@ -9,6 +9,7 @@* This work is licensed under the terms of the GNU LGPL, version 2.1 or later. * See the COPYING.LIB file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include "qom/object.h"
tests/check-qom-proplist.c +1 -0
@@ -18,6 +18,7 @@* Author: Daniel P. Berrange <[email protected]> */ +#include "qemu/osdep.h" #include <glib.h> #include "qom/object.h"
tests/check-qstring.c +1 -0
@@ -9,6 +9,7 @@* This work is licensed under the terms of the GNU LGPL, version 2.1 or later. * See the COPYING.LIB file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include "qapi/qmp/qstring.h"
tests/crypto-tls-x509-helpers.c +1 -3
@@ -18,10 +18,8 @@* Author: Daniel P. Berrange <[email protected]> */ -#include <stdlib.h> -#include <fcntl.h> +#include "qemu/osdep.h" -#include "config-host.h" #include "crypto-tls-x509-helpers.h" #include "qemu/sockets.h"
tests/device-introspect-test.c +1 -1
@@ -17,8 +17,8 @@* bugs around here. */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdarg.h> #include "qemu-common.h" #include "qapi/qmp/qstring.h" #include "libqtest.h"
tests/display-vga-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" static void pci_cirrus (void ) {
tests/drive_del-test.c +1 -1
@@ -10,8 +10,8 @@* See the COPYING.LIB file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" static void drive_add (void )
tests/ds1338-test.c +1 -0
@@ -17,6 +17,7 @@* with this program; if not, see <http://www.gnu.org/licenses/>. */ +#include "qemu/osdep.h" #include "libqtest.h" #include "libqos/i2c.h"
tests/e1000-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" /* Tests only initialization so far. TODO: Replace with functional tests */ static void test_device (gconstpointer data)
tests/eepro100-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" static void test_device (gconstpointer data) {
tests/endianness-test.c +1 -4
@@ -11,11 +11,8 @@* */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <unistd.h> #include "libqtest.h" #include "qemu/bswap.h"
tests/es1370-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" /* Tests only initialization so far. TODO: Replace with functional tests */ static void nop (void )
tests/fdc-test.c +1 -3
@@ -22,9 +22,7 @@* THE SOFTWARE. */ -#include <stdint.h> -#include <string.h> -#include <stdio.h> +#include "qemu/osdep.h" #include <glib.h>
tests/fw_cfg-test.c +1 -1
@@ -10,7 +10,7 @@* See the COPYING file in the top-level directory. */ -#include <string.h> +#include "qemu/osdep.h" #include <glib.h> #include "libqtest.h"
tests/hd-geo-test.c +1 -3
@@ -15,10 +15,8 @@* Improvements welcome. */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> #include "qemu-common.h" #include "libqtest.h"
tests/i440fx-test.c +0 -5
@@ -14,12 +14,7 @@#include "qemu/osdep.h" #include <glib.h> -#include <string.h> -#include <stdio.h> -#include <unistd.h> -#include <errno.h> #include <sys/mman.h> -#include <stdlib.h> #include "libqtest.h" #include "libqos/pci.h"
tests/i82801b11-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" /* Tests only initialization so far. TODO: Replace with functional tests */ static void nop (void )
tests/intel-hda-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" #define HDA_ID "hda0"#define CODEC_DEVICES " -device hda-output,bus=" HDA_ID ".0" \
tests/io-channel-helpers.c +1 -0
@@ -18,6 +18,7 @@* */ +#include "qemu/osdep.h" #include "io-channel-helpers.h" struct QIOChannelTest {
tests/ioh3420-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" /* Tests only initialization so far. TODO: Replace with functional tests */ static void nop (void )
tests/ipmi-bt-test.c +1 -4
@@ -22,10 +22,7 @@* THE SOFTWARE. */ -#include <sys/types.h> -#include <stdint.h> -#include <string.h> -#include <stdio.h> +#include "qemu/osdep.h" #include <sys/socket.h> #include <netinet/in.h>
tests/ipmi-kcs-test.c +1 -3
@@ -22,9 +22,7 @@* THE SOFTWARE. */ -#include <stdint.h> -#include <string.h> -#include <stdio.h> +#include "qemu/osdep.h" #include <glib.h>
tests/ipoctal232-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" /* Tests only initialization so far. TODO: Replace with functional tests */ static void nop (void )
tests/ivshmem-test.c +1 -5
@@ -8,17 +8,13 @@* See the COPYING file in the top-level directory. */ -#include <errno.h> -#include <fcntl.h> +#include "qemu/osdep.h" #include <glib.h> #include <glib/gstdio.h> -#include <string.h> #include <sys/mman.h> -#include <unistd.h> #include "contrib/ivshmem-server/ivshmem-server.h" #include "libqos/pci-pc.h" #include "libqtest.h" -#include "qemu/osdep.h" #include "qemu-common.h" #define TMPSHMSIZE (1 << 20)
tests/libqos/fw_cfg.c +1 -0
@@ -12,6 +12,7 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include "libqos/fw_cfg.h" #include "libqtest.h"
tests/libqos/i2c-imx.c +1 -2
@@ -17,12 +17,11 @@* with this program; if not, see <http://www.gnu.org/licenses/>. */ +#include "qemu/osdep.h" #include "libqos/i2c.h" #include <glib.h> -#include <string.h> -#include "qemu/osdep.h" #include "libqtest.h" #include "hw/i2c/imx_i2c.h"
tests/libqos/i2c-omap.c +1 -2
@@ -6,12 +6,11 @@* This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include "libqos/i2c.h" #include <glib.h> -#include <string.h> -#include "qemu/osdep.h" #include "qemu/bswap.h" #include "libqtest.h"
tests/libqos/i2c.c +1 -0
@@ -6,6 +6,7 @@* This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include "libqos/i2c.h" #include "libqtest.h"
tests/libqos/libqos-pc.c +1 -0
@@ -1,3 +1,4 @@ +#include "qemu/osdep.h" #include "libqos/libqos-pc.h" #include "libqos/malloc-pc.h"
tests/libqos/libqos.c +1 -5
@@ -1,9 +1,5 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> +#include "qemu/osdep.h" #include <glib.h> -#include <unistd.h> -#include <fcntl.h> #include <sys/wait.h> #include "libqtest.h"
tests/libqos/malloc-generic.c +1 -0
@@ -7,6 +7,7 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include "libqos/malloc-generic.h" #include "libqos/malloc.h"
tests/libqos/malloc-pc.c +1 -0
@@ -10,6 +10,7 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include "libqos/malloc-pc.h" #include "libqos/fw_cfg.h"
tests/libqos/malloc.c +1 -2
@@ -10,10 +10,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include "libqos/malloc.h" #include "qemu-common.h" -#include <stdio.h> -#include <inttypes.h> #include <glib.h> typedef QTAILQ_HEAD(MemList, MemBlock) MemList;
tests/libqos/pci-pc.c +1 -0
@@ -10,6 +10,7 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include "libqtest.h" #include "libqos/pci-pc.h"
tests/libqos/pci.c +1 -0
@@ -10,6 +10,7 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include "libqos/pci.h" #include "hw/pci/pci_regs.h"
tests/libqos/usb.c +1 -2
@@ -11,10 +11,9 @@* This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" #include "hw/usb/uhci-regs.h" #include "libqos/usb.h"
tests/libqos/virtio-mmio.c +1 -1
@@ -7,8 +7,8 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdio.h> #include "libqtest.h" #include "libqos/virtio.h" #include "libqos/virtio-mmio.h"
tests/libqos/virtio-pci.c +1 -1
@@ -7,8 +7,8 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdio.h> #include "libqtest.h" #include "libqos/virtio.h" #include "libqos/virtio-pci.h"
tests/libqos/virtio.c +1 -0
@@ -7,6 +7,7 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include "libqtest.h" #include "libqos/virtio.h"
tests/libqtest.c +2 -10
@@ -14,22 +14,14 @@* See the COPYING file in the top-level directory. * */ +#include "qemu/osdep.h" #include "libqtest.h" #include <glib.h> -#include <sys/types.h> #include <sys/socket.h> #include <sys/wait.h> #include <sys/un.h> -#include <inttypes.h> -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> - -#include "qemu/compiler.h" -#include "qemu/osdep.h" +#include "qapi/qmp/json-parser.h" #include "qapi/qmp/json-streamer.h" #include "qapi/qmp/qjson.h"
tests/m48t59-test.c +1 -4
@@ -12,11 +12,8 @@* */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <unistd.h> #include "libqtest.h"
tests/multiboot/libc.c +1 -0
@@ -20,6 +20,7 @@* THE SOFTWARE. */ +#include "qemu/osdep.h" #include "libc.h" void *memcpy (void *dest,const void *src,int n)
tests/multiboot/mmap.c +1 -0
@@ -20,6 +20,7 @@* THE SOFTWARE. */ +#include "qemu/osdep.h" #include "libc.h" #include "multiboot.h"
tests/multiboot/modules.c +1 -0
@@ -20,6 +20,7 @@* THE SOFTWARE. */ +#include "qemu/osdep.h" #include "libc.h" #include "multiboot.h"
tests/ne2000-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" /* Tests only initialization so far. TODO: Replace with functional tests */ static void pci_nop (void )
tests/nvme-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" /* Tests only initialization so far. TODO: Replace with functional tests */ static void nop (void )
tests/pc-cpu-test.c +1 -2
@@ -7,12 +7,11 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "qemu-common.h" #include "libqtest.h" -#include "qemu/osdep.h" #include "qapi/qmp/types.h" struct PCTestData {
tests/pcnet-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" /* Tests only initialization so far. TODO: Replace with functional tests */ static void pci_nop (void )
tests/pkix_asn1_tab.c +1 -0
@@ -3,6 +3,7 @@* and is under copyright of various GNUTLS contributors. */ +#include "qemu/osdep.h" #include <libtasn1.h> const ASN1_ARRAY_TYPE pkix_asn1_tab[] = {
tests/pvpanic-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" static void test_panic (void ) {
tests/q35-test.c +1 -2
@@ -9,12 +9,11 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" #include "libqos/pci.h" #include "libqos/pci-pc.h" -#include "qemu/osdep.h" #include "hw/pci-host/q35.h" static void smram_set_bit (QPCIDevice *pcidev,uint8_t mask,bool enabled)
tests/qemu-iotests/socket_scm_helper.c +1 -7
@@ -10,15 +10,9 @@* See the COPYING.LIB file in the top-level directory. */ -#include <stdio.h> -#include <errno.h> +#include "qemu/osdep.h" #include <sys/socket.h> #include <sys/un.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <unistd.h> /* #define SOCKET_SCM_DEBUG */
tests/qom-test.c +1 -2
@@ -7,12 +7,11 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "qemu-common.h" #include "libqtest.h" -#include "qemu/osdep.h" #include "qapi/qmp/types.h" static const char *blacklist_x86[] = {
tests/rcutorture.c +1 -4
@@ -60,13 +60,10 @@* Test variables. */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> #include "qemu/atomic.h" #include "qemu/rcu.h" -#include "qemu/compiler.h" #include "qemu/thread.h" long long n_reads =0LL ;
tests/rtc-test.c +1 -4
@@ -11,11 +11,8 @@* */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <unistd.h> #include "libqtest.h" #include "hw/timer/mc146818rtc_regs.h"
tests/rtl8139-test.c +1 -2
@@ -7,11 +7,10 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" #include "libqos/pci-pc.h" -#include "qemu/osdep.h" #include "qemu/timer.h" #include "qemu-common.h"
tests/spapr-phb-test.c +1 -0
@@ -7,6 +7,7 @@* This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include "libqtest.h"
tests/tco-test.c +1 -3
@@ -6,10 +6,8 @@* This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> #include "libqtest.h" #include "libqos/pci.h"
tests/test-aio.c +1 -0
@@ -10,6 +10,7 @@* See the COPYING.LIB file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include "block/aio.h" #include "qemu/timer.h"
tests/test-base64.c +1 -0
@@ -18,6 +18,7 @@* */ +#include "qemu/osdep.h" #include <glib.h> #include "qemu/base64.h"
tests/test-bitops.c +1 -2
@@ -6,9 +6,8 @@* */ -#include <glib.h> -#include <stdint.h> #include "qemu/osdep.h" +#include <glib.h> #include "qemu/bitops.h" typedef struct {
tests/test-blockjob-txn.c +1 -1
@@ -10,8 +10,8 @@* See the COPYING.LIB file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include "qapi/error.h" #include "qemu/main-loop.h" #include "block/blockjob.h"
tests/test-coroutine.c +1 -0
@@ -11,6 +11,7 @@* */ +#include "qemu/osdep.h" #include <glib.h> #include "qemu/coroutine.h" #include "qemu/coroutine_int.h"
tests/test-crypto-cipher.c +1 -0
@@ -18,6 +18,7 @@* */ +#include "qemu/osdep.h" #include <glib.h> #include "crypto/init.h"
tests/test-crypto-hash.c +1 -0
@@ -18,6 +18,7 @@* */ +#include "qemu/osdep.h" #include <glib.h> #include "crypto/init.h"
tests/test-crypto-secret.c +1 -0
@@ -18,6 +18,7 @@* */ +#include "qemu/osdep.h" #include <glib.h> #include "crypto/init.h"
tests/test-crypto-tlscredsx509.c +1 -3
@@ -18,10 +18,8 @@* Author: Daniel P. Berrange <[email protected]> */ -#include <stdlib.h> -#include <fcntl.h> +#include "qemu/osdep.h" -#include "config-host.h" #include "crypto-tls-x509-helpers.h" #include "crypto/tlscredsx509.h"
tests/test-crypto-tlssession.c +1 -3
@@ -18,10 +18,8 @@* Author: Daniel P. Berrange <[email protected]> */ -#include <stdlib.h> -#include <fcntl.h> +#include "qemu/osdep.h" -#include "config-host.h" #include "crypto-tls-x509-helpers.h" #include "crypto/tlscredsx509.h" #include "crypto/tlssession.h"
tests/test-cutils.c +1 -2
@@ -25,9 +25,8 @@* THE SOFTWARE. */ +#include "qemu/osdep.h" #include <glib.h> -#include <errno.h> -#include <string.h> #include "qemu-common.h"
tests/test-hbitmap.c +1 -3
@@ -9,10 +9,8 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdarg.h> -#include <string.h> -#include <sys/types.h> #include "qemu/hbitmap.h" #define LOG_BITS_PER_LONG (BITS_PER_LONG == 32 ? 5 : 6)
tests/test-int128.c +1 -2
@@ -6,10 +6,9 @@* */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdio.h> #include "qemu/int128.h" -#include "qemu/osdep.h" /* clang doesn't support __noclone__ but it does have a mechanism for * telling us this. We assume that if we don't have __has_attribute()
tests/test-io-channel-buffer.c +1 -0
@@ -18,6 +18,7 @@* */ +#include "qemu/osdep.h" #include "io/channel-buffer.h" #include "io-channel-helpers.h"
tests/test-io-channel-command.c +1 -0
@@ -18,6 +18,7 @@* */ +#include "qemu/osdep.h" #include "io/channel-command.h" #include "io-channel-helpers.h"
tests/test-io-channel-file.c +1 -0
@@ -18,6 +18,7 @@* */ +#include "qemu/osdep.h" #include "io/channel-file.h" #include "io-channel-helpers.h"
tests/test-io-channel-socket.c +1 -0
@@ -18,6 +18,7 @@* */ +#include "qemu/osdep.h" #include "io/channel-socket.h" #include "io-channel-helpers.h" #ifdef HAVE_IFADDRS_H
tests/test-io-channel-tls.c +1 -3
@@ -21,10 +21,8 @@*/ -#include <stdlib.h> -#include <fcntl.h> +#include "qemu/osdep.h" -#include "config-host.h" #include "crypto-tls-x509-helpers.h" #include "io/channel-tls.h" #include "io/channel-socket.h"
tests/test-io-task.c +1 -0
@@ -18,6 +18,7 @@* */ +#include "qemu/osdep.h" #include <glib.h> #include "io/task.h"
tests/test-iov.c +1 -0
@@ -1,3 +1,4 @@ +#include "qemu/osdep.h" #include <glib.h> #include "qemu-common.h" #include "qemu/iov.h"
tests/test-mul64.c +1 -2
@@ -6,10 +6,9 @@* */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdint.h> #include "qemu/host-utils.h" -#include "qemu/osdep.h" typedef struct {
tests/test-netfilter.c +1 -0
@@ -8,6 +8,7 @@* later. See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include "libqtest.h"
tests/test-opts-visitor.c +1 -0
@@ -10,6 +10,7 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include "qemu/config-file.h" /* qemu_add_opts() */
tests/test-qdev-global-props.c +1 -1
@@ -22,8 +22,8 @@* THE SOFTWARE. */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdint.h> #include "hw/qdev.h" #include "qom/object.h"
tests/test-qemu-opts.c +1 -2
@@ -7,12 +7,11 @@* See the COPYING.LIB file in the top-level directory. */ -#include "qapi/error.h" +#include "qemu/osdep.h" #include "qapi/qmp/qstring.h" #include "qemu/config-file.h" #include <glib.h> -#include <string.h> static QemuOptsList opts_list_01 = { .name ="opts_list_01" ,
tests/test-qga.c +1 -8
@@ -1,18 +1,11 @@ +#include "qemu/osdep.h" #include <locale.h> #include <glib.h> #include <glib/gstdio.h> -#include <stdio.h> -#include <stdlib.h> -#include <errno.h> -#include <string.h> -#include <sys/types.h> #include <sys/socket.h> #include <sys/un.h> -#include <unistd.h> -#include <inttypes.h> #include "libqtest.h" -#include "config-host.h" #include "qga/guest-agent-core.h" typedef struct {
tests/test-qmp-commands.c +1 -0
@@ -1,3 +1,4 @@ +#include "qemu/osdep.h" #include <glib.h> #include "qemu-common.h" #include "qapi/qmp/types.h"
tests/test-qmp-event.c +1 -1
@@ -11,8 +11,8 @@* */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdarg.h> #include "qemu-common.h" #include "test-qapi-types.h"
tests/test-qmp-input-strict.c +1 -1
@@ -11,8 +11,8 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdarg.h> #include "qemu-common.h" #include "qapi/qmp-input-visitor.h"
tests/test-qmp-input-visitor.c +1 -1
@@ -10,8 +10,8 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdarg.h> #include "qemu-common.h" #include "qapi/qmp-input-visitor.h"
tests/test-qmp-output-visitor.c +1 -0
@@ -10,6 +10,7 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include "qemu-common.h"
tests/test-rcu-list.c +1 -5
@@ -20,14 +20,10 @@* Copyright (c) 2013 Mike D. Day, IBM Corporation. */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> #include "qemu/atomic.h" #include "qemu/rcu.h" -#include "qemu/compiler.h" -#include "qemu/osdep.h" #include "qemu/thread.h" #include "qemu/rcu_queue.h"
tests/test-rfifolock.c +1 -0
@@ -10,6 +10,7 @@* See the COPYING.LIB file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include "qemu-common.h" #include "qemu/rfifolock.h"
tests/test-string-input-visitor.c +1 -1
@@ -10,8 +10,8 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdarg.h> #include "qemu-common.h" #include "qapi/string-input-visitor.h"
tests/test-string-output-visitor.c +1 -0
@@ -10,6 +10,7 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include "qemu-common.h"
tests/test-thread-pool.c +1 -0
@@ -1,3 +1,4 @@ +#include "qemu/osdep.h" #include <glib.h> #include "qemu-common.h" #include "block/aio.h"
tests/test-throttle.c +1 -0
@@ -12,6 +12,7 @@* See the COPYING.LIB file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include <math.h> #include "block/aio.h"
tests/test-timed-average.c +1 -1
@@ -10,8 +10,8 @@* See the COPYING.LIB file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <unistd.h> #include "qemu/timed-average.h"
tests/test-visitor-serialization.c +1 -2
@@ -11,9 +11,8 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdlib.h> -#include <stdint.h> #include <float.h> #include "qemu-common.h"
tests/test-vmstate.c +1 -0
@@ -22,6 +22,7 @@* THE SOFTWARE. */ +#include "qemu/osdep.h" #include <glib.h> #include "qemu-common.h"
tests/test-write-threshold.c +1 -1
@@ -6,8 +6,8 @@* */ +#include "qemu/osdep.h" #include <glib.h> -#include <stdint.h> #include "block/block_int.h" #include "block/write-threshold.h"
tests/test-x86-cpuid.c +1 -0
@@ -22,6 +22,7 @@* THE SOFTWARE. */ +#include "qemu/osdep.h" #include <glib.h> #include "hw/i386/topology.h"
tests/test-xbzrle.c +1 -5
@@ -10,11 +10,7 @@* See the COPYING file in the top-level directory. * */ -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/time.h> +#include "qemu/osdep.h" #include "qemu-common.h" #include "include/migration/migration.h"
tests/tmp105-test.c +1 -0
@@ -7,6 +7,7 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include "libqtest.h"
tests/tpci200-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" /* Tests only initialization so far. TODO: Replace with functional tests */ static void nop (void )
tests/vhost-user-bridge.c +1 -11
@@ -29,23 +29,13 @@#define _FILE_OFFSET_BITS 64 -#include <stddef.h> -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <stdint.h> -#include <inttypes.h> -#include <string.h> -#include <unistd.h> -#include <errno.h> -#include <sys/types.h> +#include "qemu/osdep.h" #include <sys/socket.h> #include <sys/un.h> #include <sys/unistd.h> #include <sys/mman.h> #include <sys/eventfd.h> #include <arpa/inet.h> -#include <ctype.h> #include <netdb.h> #include <linux/vhost.h>
tests/vhost-user-test.c +1 -0
@@ -8,6 +8,7 @@* */ +#include "qemu/osdep.h" #include <glib.h> #include "libqtest.h"
tests/virtio-balloon-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" /* Tests only initialization so far. TODO: Replace with functional tests */ static void pci_nop (void )
tests/virtio-blk-test.c +1 -4
@@ -8,11 +8,8 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> -#include <stdlib.h> -#include <unistd.h> -#include <stdio.h> #include "libqtest.h" #include "libqos/virtio.h" #include "libqos/virtio-pci.h"
tests/virtio-console-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" /* Tests only initialization so far. TODO: Replace with functional tests */ static void console_pci_nop (void )
tests/virtio-net-test.c +1 -2
@@ -7,12 +7,11 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" #include "qemu-common.h" #include "qemu/sockets.h" -#include "qemu/osdep.h" #include "qemu/iov.h" #include "libqos/pci-pc.h" #include "libqos/virtio.h"
tests/virtio-rng-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" #include "libqos/pci.h" #define PCI_SLOT_HP 0x06
tests/virtio-scsi-test.c +1 -3
@@ -8,11 +8,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" -#include <stdio.h> #include "block/scsi.h" #include "libqos/virtio.h" #include "libqos/virtio-pci.h"
tests/virtio-serial-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" /* Tests only initialization so far. TODO: Replace with functional tests */ static void pci_nop (void )
tests/vmxnet3-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" /* Tests only initialization so far. TODO: Replace with functional tests */ static void nop (void )
tests/wdt_ib700-test.c +1 -2
@@ -7,10 +7,9 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> -#include <string.h> #include "libqtest.h" -#include "qemu/osdep.h" #include "qemu/timer.h" static void qmp_check_no_event (void )
Signature · 1 line
1.9.1
cover tests: clean includes
This patchset runs clean-includes on all the .c files in tests/, except those in tests/tcg, which I think are all intended as standalone test programs for the guest.
The first patch handles i440fx-test.c manually since otherwise compilation would fail due to the redefinition of ARRAY_SIZE. The second patch is automated; I can split it up if people prefer but it seems just about small enough to leave as one patch.
With these patches applied Eric's "qapi: Clean up includes in generated files" patch no longer breaks 'make check'.
thanks
-- PMM
Peter Maydell (2):
tests/i440fx-test: Don't define ARRAY_SIZE locally
tests: Clean up includes
tests/ac97-test.c | 3 +-- tests/bios-tables-test.c | 4 +--- tests/boot-order-test.c | 2 +- tests/check-qdict.c | 1 + tests/check-qfloat.c | 1 + tests/check-qint.c | 1 + tests/check-qjson.c | 1 + tests/check-qlist.c | 1 + tests/check-qom-interface.c | 1 + tests/check-qom-proplist.c | 1 + tests/check-qstring.c | 1 + tests/crypto-tls-x509-helpers.c | 4 +--- tests/device-introspect-test.c | 2 +- tests/display-vga-test.c | 3 +-- tests/drive_del-test.c | 2 +- tests/ds1338-test.c | 1 + tests/e1000-test.c | 3 +-- tests/eepro100-test.c | 3 +-- tests/endianness-test.c | 5 +---- tests/es1370-test.c | 3 +-- tests/fdc-test.c | 4 +--- tests/fw_cfg-test.c | 2 +- tests/hd-geo-test.c | 4 +--- tests/i440fx-test.c | 8 +------- tests/i82801b11-test.c | 3 +-- tests/intel-hda-test.c | 3 +-- tests/io-channel-helpers.c | 1 + tests/ioh3420-test.c | 3 +-- tests/ipmi-bt-test.c | 5 +---- tests/ipmi-kcs-test.c | 4 +--- tests/ipoctal232-test.c | 3 +-- tests/ivshmem-test.c | 6 +----- tests/libqos/fw_cfg.c | 1 + tests/libqos/i2c-imx.c | 3 +-- tests/libqos/i2c-omap.c | 3 +-- tests/libqos/i2c.c | 1 + tests/libqos/libqos-pc.c | 1 + tests/libqos/libqos.c | 6 +----- tests/libqos/malloc-generic.c | 1 + tests/libqos/malloc-pc.c | 1 + tests/libqos/malloc.c | 3 +-- tests/libqos/pci-pc.c | 1 + tests/libqos/pci.c | 1 + tests/libqos/usb.c | 3 +-- tests/libqos/virtio-mmio.c | 2 +- tests/libqos/virtio-pci.c | 2 +- tests/libqos/virtio.c | 1 + tests/libqtest.c | 12 ++---------- tests/m48t59-test.c | 5 +---- tests/multiboot/libc.c | 1 + tests/multiboot/mmap.c | 1 + tests/multiboot/modules.c | 1 + tests/ne2000-test.c | 3 +-- tests/nvme-test.c | 3 +-- tests/pc-cpu-test.c | 3 +-- tests/pcnet-test.c | 3 +-- tests/pkix_asn1_tab.c | 1 + tests/pvpanic-test.c | 3 +-- tests/q35-test.c | 3 +-- tests/qemu-iotests/socket_scm_helper.c | 8 +------- tests/qom-test.c | 3 +-- tests/rcutorture.c | 5 +---- tests/rtc-test.c | 5 +---- tests/rtl8139-test.c | 3 +-- tests/spapr-phb-test.c | 1 + tests/tco-test.c | 4 +--- tests/test-aio.c | 1 + tests/test-base64.c | 1 + tests/test-bitops.c | 3 +-- tests/test-blockjob-txn.c | 2 +- tests/test-coroutine.c | 1 + tests/test-crypto-cipher.c | 1 + tests/test-crypto-hash.c | 1 + tests/test-crypto-secret.c | 1 + tests/test-crypto-tlscredsx509.c | 4 +--- tests/test-crypto-tlssession.c | 4 +--- tests/test-cutils.c | 3 +-- tests/test-hbitmap.c | 4 +--- tests/test-int128.c | 3 +-- tests/test-io-channel-buffer.c | 1 + tests/test-io-channel-command.c | 1 + tests/test-io-channel-file.c | 1 + tests/test-io-channel-socket.c | 1 + tests/test-io-channel-tls.c | 4 +--- tests/test-io-task.c | 1 + tests/test-iov.c | 1 + tests/test-mul64.c | 3 +-- tests/test-netfilter.c | 1 + tests/test-opts-visitor.c | 1 + tests/test-qdev-global-props.c | 2 +- tests/test-qemu-opts.c | 3 +-- tests/test-qga.c | 9 +-------- tests/test-qmp-commands.c | 1 + tests/test-qmp-event.c | 2 +- tests/test-qmp-input-strict.c | 2 +- tests/test-qmp-input-visitor.c | 2 +- tests/test-qmp-output-visitor.c | 1 + tests/test-rcu-list.c | 6 +----- tests/test-rfifolock.c | 1 + tests/test-string-input-visitor.c | 2 +- tests/test-string-output-visitor.c | 1 + tests/test-thread-pool.c | 1 + tests/test-throttle.c | 1 + tests/test-timed-average.c | 2 +- tests/test-visitor-serialization.c | 3 +-- tests/test-vmstate.c | 1 + tests/test-write-threshold.c | 2 +- tests/test-x86-cpuid.c | 1 + tests/test-xbzrle.c | 6 +----- tests/tmp105-test.c | 1 + tests/tpci200-test.c | 3 +-- tests/vhost-user-bridge.c | 12 +----------- tests/vhost-user-test.c | 1 + tests/virtio-balloon-test.c | 3 +-- tests/virtio-blk-test.c | 5 +---- tests/virtio-console-test.c | 3 +-- tests/virtio-net-test.c | 3 +-- tests/virtio-rng-test.c | 3 +-- tests/virtio-scsi-test.c | 4 +--- tests/virtio-serial-test.c | 3 +-- tests/vmxnet3-test.c | 3 +-- tests/wdt_ib700-test.c | 3 +-- 122 files changed, 123 insertions(+), 204 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/2 tests/i440fx-test: Don't define ARRAY_SIZE locally
Don't define ARRAY_SIZE locally; instead include osdep.h for it.
--- tests/i440fx-test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tests/i440fx-test.c +1 -2
@@ -12,6 +12,7 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include <string.h> #include <stdio.h>
@@ -27,8 +28,6 @@#define BROKEN 1 -#define ARRAY_SIZE (array) (sizeof(array) / sizeof((array)[0])) - typedef struct TestData { int num_cpus;
Signature · 1 line
1.9.1
Re: [Qemu-devel] [PATCH 1/2] tests/i440fx-test: Don't define ARRAY_SIZE locally
Quoted 6 lines · Peter Maydell
Don't define
ARRAY_SIZElocally; instead includeosdep.hfor it.Signed-off-by Peter Maydell <[email protected]>--- tests/i440fx-test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 23 lines
tests/i440fx-test.c +1
-2@@ -12,6 +12,7 @@* See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <glib.h> #include <string.h> #include <stdio.h> @@ -27,8 +28,6 @@#define BROKEN 1 -#define ARRAY_SIZE (array) (sizeof(array) / sizeof((array)[0])) - typedef struct TestData { int num_cpus;
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Re: [Qemu-devel] [PATCH 2/2] tests: Clean up includes
In reply to Peter MaydellQuoted 5 lines · Peter Maydell
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.This commit was created with
scripts/clean-includes.
Quoted 8 lines
Signed-off-by Peter Maydell <[email protected]>---
This deals with every .c file in tests/ except those in tests/tcg which I think are all standalone programs targeting the guest.
---122 files changed, 122 insertions(+), 202 deletions(-)
You may want to wait for other maintainers to chime in for files they care about; but I looked through the patch and nothing jumped out at me as being incorrect. Many of the files already includes libqtest.c or even osdep.h - for those files, the change is obviously correct.
tests/multiboot/libc.c line 26
Quoted 9 lines
+++
b/tests/multiboot/libc.ctests/multiboot/libc.c +1
-0@@ -20,6 +20,7 @@* THE SOFTWARE. */ +#include "qemu/osdep.h" #include "libc.h" void *memcpy (void *dest,const void *src,int n)
Not so sure about this directory.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Re: [Qemu-devel] [PATCH 2/2] tests: Clean up includes
Quoted 17 lines · Eric Blake
Quoted 1 line · Peter Maydell
122 files changed, 122 insertions(+), 202 deletions(-)You may want to wait for other maintainers to chime in for files they care about; but I looked through the patch and nothing jumped out at me as being incorrect. Many of the files already includes
libqtest.cor evenosdep.h- for those files, the change is obviously correct.Reviewed-by Eric Blake <[email protected]>Tested-by Eric Blake <[email protected]>Quoted 5 lines
+++
b/tests/multiboot/libc.ctests/fdc-test.c +0
-0@@ -20,6 +20,7 @@* THE SOFTWARE. */
Quoted 6 lines
tests/multiboot/libc.c line 26
Quoted 4 lines
tests/multiboot/libc.c +1
-0+#include "qemu/osdep.h" #include "libc.h" void *memcpy (void *dest,const void *src,int n)Not so sure about this directory.
Good catch, will drop.
thanks
-- PMM
Quoted 11 lines · Peter Maydell
This patchset runs clean-includes on all the .c files in tests/, except those in tests/tcg, which I think are all intended as standalone test programs for the guest.
The first patch handles
i440fx-test.cmanually since otherwise compilation would fail due to the redefinition ofARRAY_SIZE. The second patch is automated; I can split it up if people prefer but it seems just about small enough to leave as one patch.With these patches applied Eric's "qapi: Clean up includes in generated files" patch no longer breaks 'make check'.
I applied this series, merged my qapi-next, topped off with Eric's patch, and got a working build.
I'll send a pull request for qapi-next without Eric's patch, to avoid dependencies. If Eric's patch is not merged, but this series is, I'll include it in the next QAPI pull request. Feel free to apply it directly along with this series.