aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-08-03 17:04:25 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-08-21 06:30:40 -0400
commit64ed6f92ffebb419ba71ef61e7bdb5f165c5043a (patch)
tree1b7a2d3f7448e8e5c54c03d5a258cc3759dfe12d /tests/qtest
parentf556b4a10d3ccd6cad01f704e4ccb2252520d61e (diff)
downloadqemu-64ed6f92ffebb419ba71ef61e7bdb5f165c5043a.zip
qemu-64ed6f92ffebb419ba71ef61e7bdb5f165c5043a.tar.gz
qemu-64ed6f92ffebb419ba71ef61e7bdb5f165c5043a.tar.bz2
meson: link emulators without Makefile.target
The binaries move to the root directory, e.g. qemu-system-i386 or qemu-arm. This requires changes to qtests, CI, etc. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/qtest')
-rw-r--r--tests/qtest/fuzz/Makefile.include39
-rw-r--r--tests/qtest/fuzz/i440fx_fuzz.c4
-rw-r--r--tests/qtest/fuzz/meson.build35
-rw-r--r--tests/qtest/fuzz/qtest_wrappers.c2
-rw-r--r--tests/qtest/fuzz/virtio_net_fuzz.c3
-rw-r--r--tests/qtest/fuzz/virtio_scsi_fuzz.c8
-rw-r--r--tests/qtest/libqos/qgraph.h2
-rw-r--r--tests/qtest/meson.build2
-rw-r--r--tests/qtest/rtas-test.c2
9 files changed, 47 insertions, 50 deletions
diff --git a/tests/qtest/fuzz/Makefile.include b/tests/qtest/fuzz/Makefile.include
deleted file mode 100644
index 5bde793..0000000
--- a/tests/qtest/fuzz/Makefile.include
+++ /dev/null
@@ -1,39 +0,0 @@
-QEMU_PROG_FUZZ=qemu-fuzz-$(TARGET_NAME)$(EXESUF)
-
-fuzz-obj-y += tests/qtest/libqtest.o
-fuzz-obj-y += $(libqos-obj-y)
-fuzz-obj-y += tests/qtest/fuzz/fuzz.o # Fuzzer skeleton
-fuzz-obj-y += tests/qtest/fuzz/fork_fuzz.o
-fuzz-obj-y += tests/qtest/fuzz/qos_fuzz.o
-fuzz-obj-y += tests/qtest/fuzz/qtest_wrappers.o
-
-# Targets
-fuzz-obj-$(CONFIG_PCI_I440FX) += tests/qtest/fuzz/i440fx_fuzz.o
-fuzz-obj-$(CONFIG_VIRTIO_NET) += tests/qtest/fuzz/virtio_net_fuzz.o
-fuzz-obj-$(CONFIG_SCSI) += tests/qtest/fuzz/virtio_scsi_fuzz.o
-
-FUZZ_CFLAGS += -I$(SRC_PATH)/tests -I$(SRC_PATH)/tests/qtest
-
-# Linker Script to force coverage-counters into known regions which we can mark
-# shared
-FUZZ_LDFLAGS += -Xlinker -T$(SRC_PATH)/tests/qtest/fuzz/fork_fuzz.ld
-
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_inb
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_inw
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_inl
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_outb
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_outw
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_outl
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_readb
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_readw
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_readl
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_readq
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_writeb
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_writew
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_writel
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_writeq
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_memread
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_bufread
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_memwrite
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_bufwrite
-FUZZ_LDFLAGS += -Wl,-wrap,qtest_memset
diff --git a/tests/qtest/fuzz/i440fx_fuzz.c b/tests/qtest/fuzz/i440fx_fuzz.c
index f45373f..86796bf 100644
--- a/tests/qtest/fuzz/i440fx_fuzz.c
+++ b/tests/qtest/fuzz/i440fx_fuzz.c
@@ -17,8 +17,8 @@
#include "tests/qtest/libqos/pci.h"
#include "tests/qtest/libqos/pci-pc.h"
#include "fuzz.h"
-#include "fuzz/qos_fuzz.h"
-#include "fuzz/fork_fuzz.h"
+#include "qos_fuzz.h"
+#include "fork_fuzz.h"
#define I440FX_PCI_HOST_BRIDGE_CFG 0xcf8
diff --git a/tests/qtest/fuzz/meson.build b/tests/qtest/fuzz/meson.build
new file mode 100644
index 0000000..bb0a3f2
--- /dev/null
+++ b/tests/qtest/fuzz/meson.build
@@ -0,0 +1,35 @@
+specific_fuzz_ss.add(files('fuzz.c', 'fork_fuzz.c', 'qos_fuzz.c',
+ 'qtest_wrappers.c'), qos)
+
+# Targets
+specific_fuzz_ss.add(when: 'CONFIG_I440FX', if_true: files('i440fx_fuzz.c'))
+specific_fuzz_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('virtio_net_fuzz.c'))
+specific_fuzz_ss.add(when: 'CONFIG_VIRTIO_SCSI', if_true: files('virtio_scsi_fuzz.c'))
+
+# unfortunately declare_dependency does not support link_depends, so
+# this will be duplicated in meson.build
+fork_fuzz = declare_dependency(
+ link_args: ['-fsanitize=fuzzer',
+ '-Wl,-T,' + (meson.current_source_dir() / 'fork_fuzz.ld'),
+ '-Wl,-wrap,qtest_inb',
+ '-Wl,-wrap,qtest_inw',
+ '-Wl,-wrap,qtest_inl',
+ '-Wl,-wrap,qtest_outb',
+ '-Wl,-wrap,qtest_outw',
+ '-Wl,-wrap,qtest_outl',
+ '-Wl,-wrap,qtest_readb',
+ '-Wl,-wrap,qtest_readw',
+ '-Wl,-wrap,qtest_readl',
+ '-Wl,-wrap,qtest_readq',
+ '-Wl,-wrap,qtest_writeb',
+ '-Wl,-wrap,qtest_writew',
+ '-Wl,-wrap,qtest_writel',
+ '-Wl,-wrap,qtest_writeq',
+ '-Wl,-wrap,qtest_memread',
+ '-Wl,-wrap,qtest_bufread',
+ '-Wl,-wrap,qtest_memwrite',
+ '-Wl,-wrap,qtest_bufwrite',
+ '-Wl,-wrap,qtest_memset']
+)
+
+specific_fuzz_ss.add(fork_fuzz)
diff --git a/tests/qtest/fuzz/qtest_wrappers.c b/tests/qtest/fuzz/qtest_wrappers.c
index 713c830..0580f8d 100644
--- a/tests/qtest/fuzz/qtest_wrappers.c
+++ b/tests/qtest/fuzz/qtest_wrappers.c
@@ -12,7 +12,7 @@
*/
#include "qemu/osdep.h"
-#include "cpu.h"
+#include "hw/core/cpu.h"
#include "exec/ioport.h"
#include "fuzz.h"
diff --git a/tests/qtest/fuzz/virtio_net_fuzz.c b/tests/qtest/fuzz/virtio_net_fuzz.c
index 277a9e2..0e873ab 100644
--- a/tests/qtest/fuzz/virtio_net_fuzz.c
+++ b/tests/qtest/fuzz/virtio_net_fuzz.c
@@ -61,7 +61,8 @@ static void virtio_net_fuzz_multi(QTestState *s,
* backend. Otherwise, always place the input on a virtqueue.
*/
if (vqa.rx && sockfds_initialized) {
- write(sockfds[0], Data, vqa.length);
+ int ignored = write(sockfds[0], Data, vqa.length);
+ (void) ignored;
} else {
vqa.rx = 0;
uint64_t req_addr = guest_alloc(t_alloc, vqa.length);
diff --git a/tests/qtest/fuzz/virtio_scsi_fuzz.c b/tests/qtest/fuzz/virtio_scsi_fuzz.c
index 3a9ea13..6ff6fab 100644
--- a/tests/qtest/fuzz/virtio_scsi_fuzz.c
+++ b/tests/qtest/fuzz/virtio_scsi_fuzz.c
@@ -12,10 +12,10 @@
#include "qemu/osdep.h"
-#include "tests/qtest/libqtest.h"
-#include "libqos/virtio-scsi.h"
-#include "libqos/virtio.h"
-#include "libqos/virtio-pci.h"
+#include "tests/qtest/libqos/libqtest.h"
+#include "tests/qtest/libqos/virtio-scsi.h"
+#include "tests/qtest/libqos/virtio.h"
+#include "tests/qtest/libqos/virtio-pci.h"
#include "standard-headers/linux/virtio_ids.h"
#include "standard-headers/linux/virtio_pci.h"
#include "standard-headers/linux/virtio_scsi.h"
diff --git a/tests/qtest/libqos/qgraph.h b/tests/qtest/libqos/qgraph.h
index 1054326..5f63d35 100644
--- a/tests/qtest/libqos/qgraph.h
+++ b/tests/qtest/libqos/qgraph.h
@@ -226,7 +226,7 @@ typedef void *(*QOSBeforeTest) (GString *cmd_line, void *arg);
* my_test <--consumed_by-- my_interface <--produces--+
*
* Assuming there the binary is
- * QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64
+ * QTEST_QEMU_BINARY=./qemu-system-x86_64
* a valid test path will be:
* "/x86_64/pc/other_node/my_driver/my_interface/my_test".
*
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index 30cb88d..8f8fdb1 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -234,7 +234,7 @@ foreach dir : target_dirs
qtest_env = environment()
qtest_env.set('QTEST_QEMU_IMG', './qemu-img')
qtest_env.set('G_TEST_DBUS_DAEMON', meson.source_root() / 'tests/dbus-vmstate-daemon.sh')
- qtest_env.set('QTEST_QEMU_BINARY', '@0@-softmmu/qemu-system-@0@'.format(target_base))
+ qtest_env.set('QTEST_QEMU_BINARY', './qemu-system-' + target_base)
foreach test : qtests
# Executables are shared across targets, declare them only the first time we
diff --git a/tests/qtest/rtas-test.c b/tests/qtest/rtas-test.c
index a7e83e7..16751db 100644
--- a/tests/qtest/rtas-test.c
+++ b/tests/qtest/rtas-test.c
@@ -31,7 +31,7 @@ int main(int argc, char *argv[])
g_test_init(&argc, &argv, NULL);
if (strcmp(arch, "ppc64")) {
- g_printerr("RTAS requires ppc64-softmmu/qemu-system-ppc64\n");
+ g_printerr("RTAS requires qemu-system-ppc64\n");
exit(EXIT_FAILURE);
}
qtest_add_func("rtas/get-time-of-day", test_rtas_get_time_of_day);