]> git.proxmox.com Git - mirror_qemu.git/commitdiff
meson: convert tests/qtest to meson
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 4 Aug 2020 18:00:40 +0000 (20:00 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 21 Aug 2020 10:30:20 +0000 (06:30 -0400)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
148 files changed:
meson.build
tests/Makefile.include
tests/meson.build
tests/qtest/Makefile.include [deleted file]
tests/qtest/ac97-test.c
tests/qtest/acpi-utils.h
tests/qtest/ahci-test.c
tests/qtest/arm-cpu-features.c
tests/qtest/boot-order-test.c
tests/qtest/boot-sector.c
tests/qtest/boot-sector.h
tests/qtest/boot-serial-test.c
tests/qtest/cdrom-test.c
tests/qtest/dbus-vmstate-test.c
tests/qtest/device-introspect-test.c
tests/qtest/device-plug-test.c
tests/qtest/drive_del-test.c
tests/qtest/ds1338-test.c
tests/qtest/e1000-test.c
tests/qtest/eepro100-test.c
tests/qtest/endianness-test.c
tests/qtest/es1370-test.c
tests/qtest/fuzz/fuzz.c
tests/qtest/fuzz/fuzz.h
tests/qtest/fuzz/i440fx_fuzz.c
tests/qtest/fuzz/qos_fuzz.c
tests/qtest/fuzz/virtio_net_fuzz.c
tests/qtest/fw_cfg-test.c
tests/qtest/hd-geo-test.c
tests/qtest/hexloader-test.c
tests/qtest/ide-test.c
tests/qtest/ipoctal232-test.c
tests/qtest/ivshmem-test.c
tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c
tests/qtest/libqos/ahci.c
tests/qtest/libqos/ahci.h
tests/qtest/libqos/arm-imx25-pdk-machine.c
tests/qtest/libqos/arm-n800-machine.c
tests/qtest/libqos/arm-raspi2-machine.c
tests/qtest/libqos/arm-sabrelite-machine.c
tests/qtest/libqos/arm-smdkc210-machine.c
tests/qtest/libqos/arm-virt-machine.c
tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c
tests/qtest/libqos/e1000e.c
tests/qtest/libqos/e1000e.h
tests/qtest/libqos/fw_cfg.c
tests/qtest/libqos/i2c-imx.c
tests/qtest/libqos/i2c-omap.c
tests/qtest/libqos/i2c.c
tests/qtest/libqos/i2c.h
tests/qtest/libqos/libqos-pc.c
tests/qtest/libqos/libqos-pc.h
tests/qtest/libqos/libqos-spapr.c
tests/qtest/libqos/libqos-spapr.h
tests/qtest/libqos/libqos.c
tests/qtest/libqos/libqos.h
tests/qtest/libqos/libqtest.h [new file with mode: 0644]
tests/qtest/libqos/malloc-pc.c
tests/qtest/libqos/malloc-pc.h
tests/qtest/libqos/malloc-spapr.c
tests/qtest/libqos/malloc-spapr.h
tests/qtest/libqos/malloc.c
tests/qtest/libqos/meson.build [new file with mode: 0644]
tests/qtest/libqos/pci-pc.c
tests/qtest/libqos/pci-pc.h
tests/qtest/libqos/pci-spapr.c
tests/qtest/libqos/pci-spapr.h
tests/qtest/libqos/pci.c
tests/qtest/libqos/pci.h
tests/qtest/libqos/ppc64_pseries-machine.c
tests/qtest/libqos/qgraph.c
tests/qtest/libqos/qgraph.h
tests/qtest/libqos/qgraph_internal.h
tests/qtest/libqos/qos_external.c
tests/qtest/libqos/qos_external.h
tests/qtest/libqos/rtas.c
tests/qtest/libqos/rtas.h
tests/qtest/libqos/sdhci.c
tests/qtest/libqos/sdhci.h
tests/qtest/libqos/tpci200.c
tests/qtest/libqos/usb.c
tests/qtest/libqos/usb.h
tests/qtest/libqos/virtio-9p.c
tests/qtest/libqos/virtio-9p.h
tests/qtest/libqos/virtio-balloon.c
tests/qtest/libqos/virtio-balloon.h
tests/qtest/libqos/virtio-blk.c
tests/qtest/libqos/virtio-blk.h
tests/qtest/libqos/virtio-mmio.c
tests/qtest/libqos/virtio-mmio.h
tests/qtest/libqos/virtio-net.c
tests/qtest/libqos/virtio-net.h
tests/qtest/libqos/virtio-pci.c
tests/qtest/libqos/virtio-pci.h
tests/qtest/libqos/virtio-rng.c
tests/qtest/libqos/virtio-rng.h
tests/qtest/libqos/virtio-scsi.c
tests/qtest/libqos/virtio-scsi.h
tests/qtest/libqos/virtio-serial.c
tests/qtest/libqos/virtio-serial.h
tests/qtest/libqos/virtio.c
tests/qtest/libqos/virtio.h
tests/qtest/libqos/x86_64_pc-machine.c
tests/qtest/libqtest-single.h
tests/qtest/libqtest.c
tests/qtest/libqtest.h [deleted file]
tests/qtest/m48t59-test.c
tests/qtest/machine-none-test.c
tests/qtest/megasas-test.c
tests/qtest/meson.build [new file with mode: 0644]
tests/qtest/microbit-test.c
tests/qtest/migration-helpers.h
tests/qtest/migration-test.c
tests/qtest/modules-test.c
tests/qtest/ne2000-test.c
tests/qtest/numa-test.c
tests/qtest/nvme-test.c
tests/qtest/pca9552-test.c
tests/qtest/pci-test.c
tests/qtest/pcnet-test.c
tests/qtest/pflash-cfi02-test.c
tests/qtest/pnv-xscom-test.c
tests/qtest/prom-env-test.c
tests/qtest/pvpanic-test.c
tests/qtest/pxe-test.c
tests/qtest/q35-test.c
tests/qtest/qmp-cmd-test.c
tests/qtest/qmp-test.c
tests/qtest/qom-test.c
tests/qtest/rtas-test.c
tests/qtest/sdhci-test.c
tests/qtest/spapr-phb-test.c
tests/qtest/tco-test.c
tests/qtest/test-filter-mirror.c
tests/qtest/test-filter-redirector.c
tests/qtest/test-hmp.c
tests/qtest/tpm-crb-swtpm-test.c
tests/qtest/tpm-tis-device-swtpm-test.c
tests/qtest/tpm-tis-swtpm-test.c
tests/qtest/tpm-util.c
tests/qtest/tulip-test.c
tests/qtest/virtio-rng-test.c
tests/qtest/virtio-test.c
tests/qtest/vmgenid-test.c
tests/qtest/vmxnet3-test.c
tests/qtest/wdt_ib700-test.c
tests/test-qga.c
tests/test-qgraph.c

index d3b74868e2c79d87dfb7144b9402a4e18fd52518..99daa9166669f57b9dbf0968ac0db76f82d478fe 100644 (file)
@@ -535,6 +535,9 @@ subdir('nbd')
 subdir('scsi')
 subdir('block')
 
+# needed for fuzzing binaries
+subdir('tests/qtest/libqos')
+
 block_mods = []
 softmmu_mods = []
 foreach d, list : modules
index 02d31fbe0c7e72e3f845d412e138fdd978263131..99fb5132f7397ed9fcc6483235f262890e33f212 100644 (file)
@@ -109,6 +109,7 @@ check-unit-y += tests/test-qht$(EXESUF)
 check-unit-y += tests/test-qht-par$(EXESUF)
 check-unit-y += tests/test-bitops$(EXESUF)
 check-unit-y += tests/test-bitcnt$(EXESUF)
+check-unit-y += tests/test-qgraph$(EXESUF)
 check-unit-y += tests/check-qom-interface$(EXESUF)
 check-unit-y += tests/check-qom-proplist$(EXESUF)
 check-unit-y += tests/test-qemu-opts$(EXESUF)
@@ -306,19 +307,6 @@ tests/test-qapi-gen-timestamp: \
        @rm -f tests/test-qapi-doc.texi
        @>$@
 
-tests/qtest/dbus-vmstate1.h tests/qtest/dbus-vmstate1.c: tests/qtest/dbus-vmstate1-gen-timestamp ;
-tests/qtest/dbus-vmstate1-gen-timestamp: $(SRC_PATH)/tests/qtest/dbus-vmstate1.xml
-       $(call quiet-command,$(GDBUS_CODEGEN) $< \
-               --interface-prefix org.qemu --generate-c-code tests/qtest/dbus-vmstate1, \
-               "GEN","$(@:%-timestamp=%)")
-       @>$@
-
-tests/qtest/dbus-vmstate-test.o-cflags := -DSRCDIR="$(SRC_PATH)"
-tests/qtest/dbus-vmstate1.o-cflags := $(GIO_CFLAGS)
-tests/qtest/dbus-vmstate1.o-libs := $(GIO_LIBS)
-
-tests/qtest/dbus-vmstate-test.o: tests/qtest/dbus-vmstate1.h
-
 tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y)
 tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y)
 tests/test-qmp-event$(EXESUF): tests/test-qmp-event.o $(test-qapi-obj-y) tests/test-qapi-emit-events.o tests/test-qapi-events.o
@@ -333,6 +321,7 @@ tests/test-shift128$(EXESUF): tests/test-shift128.o $(test-util-obj-y)
 tests/test-mul64$(EXESUF): tests/test-mul64.o $(test-util-obj-y)
 tests/test-bitops$(EXESUF): tests/test-bitops.o $(test-util-obj-y)
 tests/test-bitcnt$(EXESUF): tests/test-bitcnt.o $(test-util-obj-y)
+tests/test-qgraph$(EXESUF): tests/test-qgraph.o tests/qtest/libqos/qgraph.o $(test-util-obj-y)
 tests/test-crypto-hash$(EXESUF): tests/test-crypto-hash.o $(test-crypto-obj-y)
 tests/benchmark-crypto-hash$(EXESUF): tests/benchmark-crypto-hash.o $(test-crypto-obj-y)
 tests/test-crypto-hmac$(EXESUF): tests/test-crypto-hmac.o $(test-crypto-obj-y)
@@ -396,10 +385,8 @@ tests/migration/initrd-stress.img: tests/migration/stress$(EXESUF)
        rm $(INITRD_WORK_DIR)/init
        rmdir $(INITRD_WORK_DIR)
 
-include $(SRC_PATH)/tests/qtest/Makefile.include
-
 tests/test-qga$(EXESUF): qga/qemu-ga$(EXESUF)
-tests/test-qga$(EXESUF): tests/test-qga.o $(qtest-obj-y)
+tests/test-qga$(EXESUF): tests/test-qga.o tests/qtest/libqtest.o $(test-util-obj-y)
 tests/vhost-user-bridge$(EXESUF): tests/vhost-user-bridge.o $(test-util-obj-y) libvhost-user.a
 tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o
 
@@ -440,14 +427,6 @@ define do_test_tap
          "TAP","$@")
 endef
 
-.PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS))
-$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: %-softmmu/all $(check-qtest-y)
-       $(call do_test_human,$(check-qtest-$*-y:%=tests/qtest/%$(EXESUF)) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)), \
-         QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
-         QTEST_QEMU_IMG=qemu-img$(EXESUF))
-
-build-qtest: $(patsubst %, %-softmmu/all, $(QTEST_TARGETS)) $(check-qtest-y)
-
 build-unit: $(check-unit-y)
 
 check-unit: $(check-unit-y)
@@ -458,18 +437,9 @@ check-speed: $(check-speed-y)
 
 # gtester tests with TAP output
 
-$(patsubst %, check-report-qtest-%.tap, $(QTEST_TARGETS)): check-report-qtest-%.tap: %-softmmu/all $(check-qtest-y)
-       $(call do_test_tap, $(check-qtest-$*-y:%=tests/qtest/%$(EXESUF)) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)), \
-         QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
-         QTEST_QEMU_IMG=qemu-img$(EXESUF))
-
 check-report-unit.tap: $(check-unit-y)
        $(call do_test_tap,$^)
 
-# Reports and overall runs
-
-check-report.tap: $(patsubst %,check-report-qtest-%.tap, $(QTEST_TARGETS)) check-report-unit.tap
-
 # Plugins
 ifeq ($(CONFIG_PLUGIN),y)
 .PHONY: plugins
@@ -580,21 +550,18 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images
 
 # Consolidated targets
 
-.PHONY: check-block check-qtest check-unit check check-clean get-vm-images
-check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
+.PHONY: check-block check-unit check check-clean get-vm-images
 ifeq ($(CONFIG_TOOLS),y)
 check-block: $(patsubst %,check-%, $(check-block-y))
 endif
-check-build: build-unit build-qtest
+check-build: build-unit
 
 check-clean:
        rm -rf $(check-unit-y) tests/*.o tests/*/*.o $(QEMU_IOTESTS_HELPERS-y)
-       rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y:%=tests/qtest/%$(EXESUF))) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)))
        rm -f tests/test-qapi-gen-timestamp
-       rm -f tests/qtest/dbus-vmstate1-gen-timestamp
        rm -rf $(TESTS_VENV_DIR) $(TESTS_RESULTS_DIR)
 
-check: check-block check-unit check-qtest
+check: check-block check-unit
 
 clean: check-clean
 
@@ -603,7 +570,5 @@ clean: check-clean
 all: $(QEMU_IOTESTS_HELPERS-y)
 
 -include $(wildcard tests/*.d)
--include $(wildcard tests/qtest/*.d)
--include $(wildcard tests/qtest/libqos/*.d)
 
 endif
index 8be9c2233c9498f4b167aa2e18c0ad479f2fda64..d724402cf42011ec54bcda2fffe10f66622c3338 100644 (file)
@@ -8,3 +8,4 @@ if 'CONFIG_TCG' in config_host
 endif
 
 subdir('qapi-schema')
+subdir('qtest')
diff --git a/tests/qtest/Makefile.include b/tests/qtest/Makefile.include
deleted file mode 100644 (file)
index b0204e4..0000000
+++ /dev/null
@@ -1,332 +0,0 @@
-# All QTests for now are POSIX-only, but the dependencies are
-# really in libqtest, not in the testcases themselves.
-
-check-qtest-generic-y += cdrom-test
-check-qtest-generic-y += device-introspect-test
-check-qtest-generic-y += machine-none-test
-check-qtest-generic-y += qmp-test
-check-qtest-generic-y += qmp-cmd-test
-check-qtest-generic-y += qom-test
-check-qtest-generic-$(CONFIG_MODULES) += modules-test
-check-qtest-generic-y += test-hmp
-
-check-qtest-pci-$(CONFIG_RTL8139_PCI) += rtl8139-test
-check-qtest-pci-$(CONFIG_VGA) += display-vga-test
-check-qtest-pci-$(CONFIG_HDA) += intel-hda-test
-check-qtest-pci-$(CONFIG_IVSHMEM_DEVICE) += ivshmem-test
-
-DBUS_DAEMON := $(shell which dbus-daemon 2>/dev/null)
-ifneq ($(GDBUS_CODEGEN),)
-ifneq ($(DBUS_DAEMON),)
-# Temporarily disabled due to Patchew failures:
-#check-qtest-pci-$(CONFIG_GIO) += dbus-vmstate-test
-endif
-endif
-
-check-qtest-i386-$(CONFIG_ISA_TESTDEV) = endianness-test
-check-qtest-i386-y += fdc-test
-check-qtest-i386-y += ide-test
-check-qtest-i386-$(CONFIG_TOOLS) += ahci-test
-check-qtest-i386-y += hd-geo-test
-check-qtest-i386-y += boot-order-test
-check-qtest-i386-y += bios-tables-test
-check-qtest-i386-$(CONFIG_SGA) += boot-serial-test
-check-qtest-i386-$(CONFIG_SLIRP) += pxe-test
-check-qtest-i386-y += rtc-test
-check-qtest-i386-$(CONFIG_ISA_IPMI_KCS) += ipmi-kcs-test
-ifdef CONFIG_LINUX
-check-qtest-i386-$(CONFIG_ISA_IPMI_BT) += ipmi-bt-test
-endif
-check-qtest-i386-y += i440fx-test
-check-qtest-i386-y += fw_cfg-test
-check-qtest-i386-y += device-plug-test
-check-qtest-i386-y += drive_del-test
-check-qtest-i386-$(CONFIG_WDT_IB700) += wdt_ib700-test
-check-qtest-i386-y += tco-test
-check-qtest-i386-y += $(check-qtest-pci-y)
-check-qtest-i386-$(CONFIG_PVPANIC) += pvpanic-test
-check-qtest-i386-$(CONFIG_I82801B11) += i82801b11-test
-check-qtest-i386-$(CONFIG_IOH3420) += ioh3420-test
-check-qtest-i386-$(CONFIG_USB_UHCI) += usb-hcd-uhci-test
-check-qtest-i386-$(call land,$(CONFIG_USB_EHCI),$(CONFIG_USB_UHCI)) += usb-hcd-ehci-test
-check-qtest-i386-$(CONFIG_USB_XHCI_NEC) += usb-hcd-xhci-test
-check-qtest-i386-y += cpu-plug-test
-check-qtest-i386-y += q35-test
-check-qtest-i386-y += vmgenid-test
-check-qtest-i386-$(CONFIG_TPM_CRB) += tpm-crb-swtpm-test
-check-qtest-i386-$(CONFIG_TPM_CRB) += tpm-crb-test
-check-qtest-i386-$(CONFIG_TPM_TIS_ISA) += tpm-tis-swtpm-test
-check-qtest-i386-$(CONFIG_TPM_TIS_ISA) += tpm-tis-test
-check-qtest-i386-$(CONFIG_SLIRP) += test-netfilter
-check-qtest-i386-$(CONFIG_POSIX) += test-filter-mirror
-check-qtest-i386-$(CONFIG_RTL8139_PCI) += test-filter-redirector
-check-qtest-i386-y += migration-test
-check-qtest-i386-y += test-x86-cpuid-compat
-check-qtest-i386-y += numa-test
-
-check-qtest-x86_64-y += $(check-qtest-i386-y)
-
-check-qtest-avr-y += boot-serial-test
-
-check-qtest-alpha-y += boot-serial-test
-check-qtest-alpha-$(CONFIG_VGA) += display-vga-test
-
-check-qtest-hppa-y += boot-serial-test
-check-qtest-hppa-$(CONFIG_VGA) += display-vga-test
-
-check-qtest-m68k-y = boot-serial-test
-
-check-qtest-microblaze-y += boot-serial-test
-
-check-qtest-mips-$(CONFIG_ISA_TESTDEV) = endianness-test
-check-qtest-mips-$(CONFIG_VGA) += display-vga-test
-
-check-qtest-mips64-$(CONFIG_ISA_TESTDEV) = endianness-test
-check-qtest-mips64-$(CONFIG_VGA) += display-vga-test
-
-check-qtest-mips64el-$(CONFIG_ISA_TESTDEV) = endianness-test
-check-qtest-mips64el-$(CONFIG_VGA) += display-vga-test
-
-check-qtest-moxie-y += boot-serial-test
-
-check-qtest-ppc-$(CONFIG_ISA_TESTDEV) = endianness-test
-check-qtest-ppc-y += boot-order-test
-check-qtest-ppc-y += prom-env-test
-check-qtest-ppc-y += drive_del-test
-check-qtest-ppc-y += boot-serial-test
-check-qtest-ppc-$(CONFIG_M48T59) += m48t59-test
-
-check-qtest-ppc64-y += $(check-qtest-ppc-y)
-check-qtest-ppc64-$(CONFIG_PSERIES) += device-plug-test
-check-qtest-ppc64-$(CONFIG_POWERNV) += pnv-xscom-test
-check-qtest-ppc64-y += migration-test
-check-qtest-ppc64-$(CONFIG_PSERIES) += rtas-test
-check-qtest-ppc64-$(CONFIG_SLIRP) += pxe-test
-check-qtest-ppc64-$(CONFIG_USB_UHCI) += usb-hcd-uhci-test
-check-qtest-ppc64-$(CONFIG_USB_XHCI_NEC) += usb-hcd-xhci-test
-check-qtest-ppc64-$(CONFIG_SLIRP) += test-netfilter
-check-qtest-ppc64-$(CONFIG_POSIX) += test-filter-mirror
-check-qtest-ppc64-$(CONFIG_RTL8139_PCI) += test-filter-redirector
-check-qtest-ppc64-$(CONFIG_VGA) += display-vga-test
-check-qtest-ppc64-y += numa-test
-check-qtest-ppc64-$(CONFIG_IVSHMEM_DEVICE) += ivshmem-test
-check-qtest-ppc64-y += cpu-plug-test
-
-check-qtest-sh4-$(CONFIG_ISA_TESTDEV) = endianness-test
-
-check-qtest-sh4eb-$(CONFIG_ISA_TESTDEV) = endianness-test
-
-check-qtest-sparc-y += prom-env-test
-check-qtest-sparc-y += m48t59-test
-check-qtest-sparc-y += boot-serial-test
-
-check-qtest-sparc64-$(CONFIG_ISA_TESTDEV) = endianness-test
-check-qtest-sparc64-y += prom-env-test
-check-qtest-sparc64-y += boot-serial-test
-
-check-qtest-arm-y += arm-cpu-features
-check-qtest-arm-y += microbit-test
-check-qtest-arm-y += m25p80-test
-check-qtest-arm-y += test-arm-mptimer
-check-qtest-arm-y += boot-serial-test
-check-qtest-arm-y += hexloader-test
-check-qtest-arm-$(CONFIG_PFLASH_CFI02) += pflash-cfi02-test
-
-check-qtest-aarch64-y += arm-cpu-features
-check-qtest-aarch64-$(CONFIG_TPM_TIS_SYSBUS) += tpm-tis-device-test
-check-qtest-aarch64-$(CONFIG_TPM_TIS_SYSBUS) += tpm-tis-device-swtpm-test
-check-qtest-aarch64-y += numa-test
-check-qtest-aarch64-y += boot-serial-test
-check-qtest-aarch64-y += migration-test
-
-# TODO: once aarch64 TCG is fixed on ARM 32 bit host, make test unconditional
-ifneq ($(ARCH),arm)
-check-qtest-aarch64-y += bios-tables-test
-endif
-
-check-qtest-microblazeel-y += $(check-qtest-microblaze-y)
-
-check-qtest-xtensaeb-y += $(check-qtest-xtensa-y)
-
-check-qtest-s390x-y = boot-serial-test
-check-qtest-s390x-$(CONFIG_SLIRP) += pxe-test
-check-qtest-s390x-$(CONFIG_SLIRP) += test-netfilter
-check-qtest-s390x-$(CONFIG_POSIX) += test-filter-mirror
-check-qtest-s390x-$(CONFIG_POSIX) += test-filter-redirector
-check-qtest-s390x-y += drive_del-test
-check-qtest-s390x-y += device-plug-test
-check-qtest-s390x-y += virtio-ccw-test
-check-qtest-s390x-y += cpu-plug-test
-check-qtest-s390x-y += migration-test
-
-# libqos / qgraph :
-libqgraph-obj-y = tests/qtest/libqos/qgraph.o
-
-libqos-core-obj-y = $(libqgraph-obj-y) tests/qtest/libqos/pci.o tests/qtest/libqos/fw_cfg.o
-libqos-core-obj-y += tests/qtest/libqos/malloc.o
-libqos-core-obj-y += tests/qtest/libqos/libqos.o
-libqos-spapr-obj-y = $(libqos-core-obj-y) tests/qtest/libqos/malloc-spapr.o
-libqos-spapr-obj-y += tests/qtest/libqos/libqos-spapr.o
-libqos-spapr-obj-y += tests/qtest/libqos/rtas.o
-libqos-spapr-obj-y += tests/qtest/libqos/pci-spapr.o
-libqos-pc-obj-y = $(libqos-core-obj-y) tests/qtest/libqos/pci-pc.o
-libqos-pc-obj-y += tests/qtest/libqos/malloc-pc.o tests/qtest/libqos/libqos-pc.o
-libqos-pc-obj-y += tests/qtest/libqos/ahci.o
-libqos-usb-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/qtest/libqos/usb.o
-
-# qos devices:
-libqos-obj-y =  $(libqgraph-obj-y)
-libqos-obj-y += $(libqos-pc-obj-y) $(libqos-spapr-obj-y)
-libqos-obj-y += tests/qtest/libqos/qos_external.o
-libqos-obj-y += tests/qtest/libqos/e1000e.o
-libqos-obj-y += tests/qtest/libqos/i2c.o
-libqos-obj-y += tests/qtest/libqos/i2c-imx.o
-libqos-obj-y += tests/qtest/libqos/i2c-omap.o
-libqos-obj-y += tests/qtest/libqos/sdhci.o
-libqos-obj-y += tests/qtest/libqos/tpci200.o
-libqos-obj-y += tests/qtest/libqos/virtio.o
-libqos-obj-$(CONFIG_VIRTFS) += tests/qtest/libqos/virtio-9p.o
-libqos-obj-y += tests/qtest/libqos/virtio-balloon.o
-libqos-obj-y += tests/qtest/libqos/virtio-blk.o
-libqos-obj-y += tests/qtest/libqos/virtio-mmio.o
-libqos-obj-y += tests/qtest/libqos/virtio-net.o
-libqos-obj-y += tests/qtest/libqos/virtio-pci.o
-libqos-obj-y += tests/qtest/libqos/virtio-pci-modern.o
-libqos-obj-y += tests/qtest/libqos/virtio-rng.o
-libqos-obj-y += tests/qtest/libqos/virtio-scsi.o
-libqos-obj-y += tests/qtest/libqos/virtio-serial.o
-
-# qos machines:
-libqos-obj-y += tests/qtest/libqos/aarch64-xlnx-zcu102-machine.o
-libqos-obj-y += tests/qtest/libqos/arm-imx25-pdk-machine.o
-libqos-obj-y += tests/qtest/libqos/arm-n800-machine.o
-libqos-obj-y += tests/qtest/libqos/arm-raspi2-machine.o
-libqos-obj-y += tests/qtest/libqos/arm-sabrelite-machine.o
-libqos-obj-y += tests/qtest/libqos/arm-smdkc210-machine.o
-libqos-obj-y += tests/qtest/libqos/arm-virt-machine.o
-libqos-obj-y += tests/qtest/libqos/arm-xilinx-zynq-a9-machine.o
-libqos-obj-y += tests/qtest/libqos/ppc64_pseries-machine.o
-libqos-obj-y += tests/qtest/libqos/x86_64_pc-machine.o
-
-# qos tests:
-qos-test-obj-y += tests/qtest/qos-test.o
-qos-test-obj-y += tests/qtest/ac97-test.o
-qos-test-obj-y += tests/qtest/ds1338-test.o
-qos-test-obj-y += tests/qtest/e1000-test.o
-qos-test-obj-y += tests/qtest/e1000e-test.o
-qos-test-obj-y += tests/qtest/eepro100-test.o
-qos-test-obj-y += tests/qtest/es1370-test.o
-qos-test-obj-y += tests/qtest/ipoctal232-test.o
-qos-test-obj-y += tests/qtest/megasas-test.o
-qos-test-obj-y += tests/qtest/ne2000-test.o
-qos-test-obj-y += tests/qtest/tulip-test.o
-qos-test-obj-y += tests/qtest/nvme-test.o
-qos-test-obj-y += tests/qtest/pca9552-test.o
-qos-test-obj-y += tests/qtest/pci-test.o
-qos-test-obj-y += tests/qtest/pcnet-test.o
-qos-test-obj-y += tests/qtest/sdhci-test.o
-qos-test-obj-y += tests/qtest/spapr-phb-test.o
-qos-test-obj-y += tests/qtest/tmp105-test.o
-qos-test-obj-y += tests/qtest/usb-hcd-ohci-test.o $(libqos-usb-obj-y)
-qos-test-obj-$(CONFIG_VHOST_NET_USER) += tests/qtest/vhost-user-test.o $(chardev-obj-y) $(test-io-obj-y)
-qos-test-obj-y += tests/qtest/virtio-test.o
-qos-test-obj-$(CONFIG_VIRTFS) += tests/qtest/virtio-9p-test.o
-qos-test-obj-y += tests/qtest/virtio-blk-test.o
-qos-test-obj-y += tests/qtest/virtio-net-test.o
-qos-test-obj-y += tests/qtest/virtio-rng-test.o
-qos-test-obj-y += tests/qtest/virtio-scsi-test.o
-qos-test-obj-y += tests/qtest/virtio-serial-test.o
-qos-test-obj-y += tests/qtest/vmxnet3-test.o
-
-check-unit-y += tests/test-qgraph$(EXESUF)
-tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y)
-
-check-qtest-generic-y += qos-test
-tests/qtest/qos-test$(EXESUF): $(qos-test-obj-y) $(libqos-obj-y)
-
-# QTest dependencies:
-tests/qtest/qmp-test$(EXESUF): tests/qtest/qmp-test.o
-tests/qtest/qmp-cmd-test$(EXESUF): tests/qtest/qmp-cmd-test.o
-tests/qtest/device-introspect-test$(EXESUF): tests/qtest/device-introspect-test.o
-tests/qtest/rtc-test$(EXESUF): tests/qtest/rtc-test.o
-tests/qtest/m48t59-test$(EXESUF): tests/qtest/m48t59-test.o
-tests/qtest/hexloader-test$(EXESUF): tests/qtest/hexloader-test.o
-tests/qtest/pflash-cfi02$(EXESUF): tests/qtest/pflash-cfi02-test.o
-tests/qtest/endianness-test$(EXESUF): tests/qtest/endianness-test.o
-tests/qtest/prom-env-test$(EXESUF): tests/qtest/prom-env-test.o $(libqos-obj-y)
-tests/qtest/rtas-test$(EXESUF): tests/qtest/rtas-test.o $(libqos-spapr-obj-y)
-tests/qtest/fdc-test$(EXESUF): tests/qtest/fdc-test.o
-tests/qtest/ide-test$(EXESUF): tests/qtest/ide-test.o $(libqos-pc-obj-y)
-tests/qtest/ahci-test$(EXESUF): tests/qtest/ahci-test.o $(libqos-pc-obj-y) qemu-img$(EXESUF)
-tests/qtest/ipmi-kcs-test$(EXESUF): tests/qtest/ipmi-kcs-test.o
-tests/qtest/ipmi-bt-test$(EXESUF): tests/qtest/ipmi-bt-test.o
-tests/qtest/hd-geo-test$(EXESUF): tests/qtest/hd-geo-test.o $(libqos-obj-y)
-tests/qtest/boot-order-test$(EXESUF): tests/qtest/boot-order-test.o $(libqos-obj-y)
-tests/qtest/boot-serial-test$(EXESUF): tests/qtest/boot-serial-test.o $(libqos-obj-y)
-tests/qtest/bios-tables-test$(EXESUF): tests/qtest/bios-tables-test.o \
-        tests/qtest/tpm-emu.o $(test-io-obj-y) \
-       tests/qtest/boot-sector.o tests/qtest/acpi-utils.o $(libqos-obj-y)
-tests/qtest/pxe-test$(EXESUF): tests/qtest/pxe-test.o tests/qtest/boot-sector.o $(libqos-obj-y)
-tests/qtest/microbit-test$(EXESUF): tests/qtest/microbit-test.o
-tests/qtest/m25p80-test$(EXESUF): tests/qtest/m25p80-test.o
-tests/qtest/i440fx-test$(EXESUF): tests/qtest/i440fx-test.o $(libqos-pc-obj-y)
-tests/qtest/q35-test$(EXESUF): tests/qtest/q35-test.o $(libqos-pc-obj-y)
-tests/qtest/fw_cfg-test$(EXESUF): tests/qtest/fw_cfg-test.o $(libqos-pc-obj-y)
-tests/qtest/rtl8139-test$(EXESUF): tests/qtest/rtl8139-test.o $(libqos-pc-obj-y)
-tests/qtest/pnv-xscom-test$(EXESUF): tests/qtest/pnv-xscom-test.o
-tests/qtest/wdt_ib700-test$(EXESUF): tests/qtest/wdt_ib700-test.o
-tests/qtest/tco-test$(EXESUF): tests/qtest/tco-test.o $(libqos-pc-obj-y)
-tests/qtest/virtio-ccw-test$(EXESUF): tests/qtest/virtio-ccw-test.o
-tests/qtest/display-vga-test$(EXESUF): tests/qtest/display-vga-test.o
-tests/qtest/qom-test$(EXESUF): tests/qtest/qom-test.o
-tests/qtest/modules-test$(EXESUF): tests/qtest/modules-test.o
-tests/qtest/test-hmp$(EXESUF): tests/qtest/test-hmp.o
-tests/qtest/machine-none-test$(EXESUF): tests/qtest/machine-none-test.o
-tests/qtest/device-plug-test$(EXESUF): tests/qtest/device-plug-test.o
-tests/qtest/drive_del-test$(EXESUF): tests/qtest/drive_del-test.o
-tests/qtest/pvpanic-test$(EXESUF): tests/qtest/pvpanic-test.o
-tests/qtest/i82801b11-test$(EXESUF): tests/qtest/i82801b11-test.o
-tests/qtest/intel-hda-test$(EXESUF): tests/qtest/intel-hda-test.o
-tests/qtest/ioh3420-test$(EXESUF): tests/qtest/ioh3420-test.o
-tests/qtest/usb-hcd-uhci-test$(EXESUF): tests/qtest/usb-hcd-uhci-test.o $(libqos-usb-obj-y)
-tests/qtest/usb-hcd-ehci-test$(EXESUF): tests/qtest/usb-hcd-ehci-test.o $(libqos-usb-obj-y)
-tests/qtest/usb-hcd-xhci-test$(EXESUF): tests/qtest/usb-hcd-xhci-test.o $(libqos-usb-obj-y)
-tests/qtest/cpu-plug-test$(EXESUF): tests/qtest/cpu-plug-test.o
-tests/qtest/migration-test$(EXESUF): tests/qtest/migration-test.o tests/qtest/migration-helpers.o
-tests/qtest/test-netfilter$(EXESUF): tests/qtest/test-netfilter.o $(qtest-obj-y)
-tests/qtest/test-filter-mirror$(EXESUF): tests/qtest/test-filter-mirror.o $(qtest-obj-y)
-tests/qtest/test-filter-redirector$(EXESUF): tests/qtest/test-filter-redirector.o $(qtest-obj-y)
-tests/qtest/test-x86-cpuid-compat$(EXESUF): tests/qtest/test-x86-cpuid-compat.o $(qtest-obj-y)
-tests/qtest/ivshmem-test$(EXESUF): tests/qtest/ivshmem-test.o contrib/ivshmem-server/ivshmem-server.o $(libqos-pc-obj-y) $(libqos-spapr-obj-y)
-tests/qtest/dbus-vmstate-test$(EXESUF): tests/qtest/dbus-vmstate-test.o tests/qtest/migration-helpers.o tests/qtest/dbus-vmstate1.o $(libqos-pc-obj-y) $(libqos-spapr-obj-y)
-tests/qtest/test-arm-mptimer$(EXESUF): tests/qtest/test-arm-mptimer.o
-tests/qtest/numa-test$(EXESUF): tests/qtest/numa-test.o
-tests/qtest/vmgenid-test$(EXESUF): tests/qtest/vmgenid-test.o tests/qtest/boot-sector.o tests/qtest/acpi-utils.o
-tests/qtest/cdrom-test$(EXESUF): tests/qtest/cdrom-test.o tests/qtest/boot-sector.o $(libqos-obj-y)
-tests/qtest/arm-cpu-features$(EXESUF): tests/qtest/arm-cpu-features.o
-tests/qtest/tpm-crb-swtpm-test$(EXESUF): tests/qtest/tpm-crb-swtpm-test.o tests/qtest/tpm-emu.o \
-       tests/qtest/tpm-util.o tests/qtest/tpm-tests.o $(test-io-obj-y)
-tests/qtest/tpm-crb-test$(EXESUF): tests/qtest/tpm-crb-test.o tests/qtest/tpm-emu.o $(test-io-obj-y)
-tests/qtest/tpm-tis-swtpm-test$(EXESUF): tests/qtest/tpm-tis-swtpm-test.o tests/qtest/tpm-emu.o \
-       tests/qtest/tpm-util.o tests/qtest/tpm-tests.o $(test-io-obj-y)
-tests/qtest/tpm-tis-device-swtpm-test$(EXESUF): tests/qtest/tpm-tis-device-swtpm-test.o tests/qtest/tpm-emu.o \
-       tests/qtest/tpm-util.o tests/qtest/tpm-tests.o $(test-io-obj-y)
-tests/qtest/tpm-tis-test$(EXESUF): tests/qtest/tpm-tis-test.o tests/qtest/tpm-tis-util.o tests/qtest/tpm-emu.o $(test-io-obj-y)
-tests/qtest/tpm-tis-device-test$(EXESUF): tests/qtest/tpm-tis-device-test.o tests/qtest/tpm-tis-util.o tests/qtest/tpm-emu.o $(test-io-obj-y)
-
-# QTest rules
-
-TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
-QTEST_TARGETS =
-# The qtests are not runnable (yet) under TSan due to a known issue.
-# https://github.com/google/sanitizers/issues/1116
-ifndef CONFIG_TSAN
-ifeq ($(CONFIG_POSIX),y)
-QTEST_TARGETS = $(TARGETS)
-check-qtest-y=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y:%=tests/qtest/%$(EXESUF)))
-check-qtest-y += $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF))
-endif
-endif
-
-qtest-obj-y = tests/qtest/libqtest.o $(test-util-obj-y)
-$(check-qtest-y): $(qtest-obj-y)
index b084e31bff5ffd05caf58a8be29d85a9db619d7b..e09f2495d24da37cd5a94d83afbe2c2291830087 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "libqos/qgraph.h"
 #include "libqos/pci.h"
index 0c86780689315d76a534f9dd524f72e0c0c74206..261784d251896e923538171f8340b9961e6c501b 100644 (file)
@@ -13,7 +13,7 @@
 #ifndef TEST_ACPI_UTILS_H
 #define TEST_ACPI_UTILS_H
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 
 /* DSDT and SSDTs format */
 typedef struct {
index c8d42ceea0575db645ce62ec2f0bdb87b6b9921f..ca4294f44f31079dd23899c2cf09323be06105e0 100644 (file)
@@ -25,7 +25,7 @@
 #include "qemu/osdep.h"
 #include <getopt.h>
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "libqos/libqos-pc.h"
 #include "libqos/ahci.h"
 #include "libqos/pci-pc.h"
index f7e062c1891efe2c11efad44767a1826cb3f8b6f..77b5e30a9cf5703806dd6b1caaaef26d58c8d80e 100644 (file)
@@ -10,7 +10,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu/bitops.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qjson.h"
 
index 2f1c07221c0b60a1adb272b47c2354be11158345..fac580d6c45cf8d4e8dc72dd6a02758a881766ba 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "qemu/osdep.h"
 #include "libqos/fw_cfg.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qapi/qmp/qdict.h"
 #include "standard-headers/linux/qemu_fw_cfg.h"
 
index 9e66c6d0130a35eb4bd7e703d22ab40d1ba037b5..24df5c4734668793c418b448afb5dac55036f7ff 100644 (file)
@@ -13,7 +13,7 @@
 #include "qemu/osdep.h"
 #include "boot-sector.h"
 #include "qemu-common.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 
 #define LOW(x) ((x) & 0xff)
 #define HIGH(x) ((x) >> 8)
index 6ee6bb4d97f4eb98b694095c20f50d54fc383536..b339fdee4c84c56a5de85c58981896c0b9a61922 100644 (file)
@@ -14,7 +14,7 @@
 #ifndef TEST_BOOT_SECTOR_H
 #define TEST_BOOT_SECTOR_H
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 
 /* Create boot disk file. fname must be a suitable string for mkstemp() */
 int boot_sector_init(char *fname);
index bfe7624dc6daf11c997623a1bf6867a8641487ea..b6b1c23cd01c35893f8d002d9feb6f70de77788e 100644 (file)
@@ -14,7 +14,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "libqos/libqos-spapr.h"
 
 static const uint8_t bios_avr[] = {
index 833a0508a14258aa85ba3dd5095a4ea09d34d1b0..e9afab693cf14c7830f2993991b68a9b985be746 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "boot-sector.h"
 #include "qapi/qmp/qdict.h"
 
index 2e5e47dec28f620bdaa4566e21ddeac16a002498..aca9b98b7a356608092da3fbb0f109ab4d758642 100644 (file)
@@ -1,7 +1,7 @@
 #include "qemu/osdep.h"
 #include <glib/gstdio.h>
 #include <gio/gio.h>
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu-common.h"
 #include "dbus-vmstate1.h"
 #include "migration-helpers.h"
index d68b7856a7a0f06414c221cf50fd2634faf81c6c..9f22340ee53f4c2de6052b0ca19f3290d1a03142 100644 (file)
@@ -22,7 +22,7 @@
 #include "qapi/qmp/qstring.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qlist.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 
 const char common_args[] = "-nodefaults -machine none";
 
index 318e422d518c012c2b303d0ec0c19268b7402e42..921489274195ad4a367f8de782027287323cbf59 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qstring.h"
 
index 5f8839b2320f42d2659e2a58e15f9e9b19d6907f..2ab11ad2251ec997e896cea056d5c3a466aa2f22 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "libqos/virtio.h"
 #include "qapi/qmp/qdict.h"
 
index f6ade9a050fb50a44a00b8338308234acd765128..c5d46bcc643d40a1d05037587e5d0bfbd65b430b 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "libqos/i2c.h"
 
 #define DS1338_ADDR 0x68
index c387984ef6d69dbf0361b83f19e96f00e5896775..ea286d1793046b0508ec7ed4714740ee947a84bd 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "libqos/qgraph.h"
 #include "libqos/pci.h"
index 8dbffff0b81b1632a876ad1dcfa7d4623dfa4f4a..d72ad099f1eb7b98988c19a7117a5adb893693ef 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "libqos/qgraph.h"
 #include "libqos/pci.h"
index cc088ac01a3fa8add50375a2d7966ced06845f01..4e79e22c28c15a1f2bf9b49e1c9215215d1a4873 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "qemu/osdep.h"
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/bswap.h"
 
 typedef struct TestCase TestCase;
index adccdac1be57ef6df00cfa18d13df28e7f399db4..2fd7fd2d3d3039e64c2e22596d9018b40f488da9 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "libqos/qgraph.h"
 #include "libqos/pci.h"
index 031594a686079d4f80d4ea419473433e9d790e41..1ceea8470269a63c182e2ddd52c9b6674e9d3c3a 100644 (file)
@@ -20,7 +20,7 @@
 #include "sysemu/sysemu.h"
 #include "qemu/main-loop.h"
 #include "qemu/rcu.h"
-#include "tests/qtest/libqtest.h"
+#include "tests/qtest/libqos/libqtest.h"
 #include "tests/qtest/libqos/qgraph.h"
 #include "fuzz.h"
 
index 9ca3d107c5f5e436aa772f0c41d4afde109b010d..8eb765edc88400c3c2960576103c039884e00fcc 100644 (file)
@@ -18,7 +18,7 @@
 #include "qemu/units.h"
 #include "qapi/error.h"
 
-#include "tests/qtest/libqtest.h"
+#include "tests/qtest/libqos/libqtest.h"
 
 /**
  * A libfuzzer fuzzing target
index bf966d478b6882d0a3a573005042ae432fa440e7..f45373f5d30f4a74311723178cc60c5a1b87bbd0 100644 (file)
@@ -13,7 +13,7 @@
 #include "qemu/osdep.h"
 
 #include "qemu/main-loop.h"
-#include "tests/qtest/libqtest.h"
+#include "tests/qtest/libqos/libqtest.h"
 #include "tests/qtest/libqos/pci.h"
 #include "tests/qtest/libqos/pci-pc.h"
 #include "fuzz.h"
index d52f3ebd8330b59b082619cc2e920261348843cf..b943577b8c9edcdc9569dd70cfe4f774ccd350d6 100644 (file)
@@ -25,7 +25,7 @@
 #include "sysemu/sysemu.h"
 #include "qemu/main-loop.h"
 
-#include "tests/qtest/libqtest.h"
+#include "tests/qtest/libqos/libqtest.h"
 #include "tests/qtest/libqos/malloc.h"
 #include "tests/qtest/libqos/qgraph.h"
 #include "tests/qtest/libqos/qgraph_internal.h"
index a33bd73067be8dbd6256648d7210152207d30897..277a9e2b64e5751e6924aec9f3786020420d0aab 100644 (file)
@@ -13,7 +13,7 @@
 #include "qemu/osdep.h"
 
 #include "standard-headers/linux/virtio_config.h"
-#include "tests/qtest/libqtest.h"
+#include "tests/qtest/libqos/libqtest.h"
 #include "tests/qtest/libqos/virtio-net.h"
 #include "fuzz.h"
 #include "fork_fuzz.h"
index 5dc807ba2385398714bfae552ff7366635923bcd..95b3907c18c471f2f946f3cd09798f4b10436a5c 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "qemu/osdep.h"
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "standard-headers/linux/qemu_fw_cfg.h"
 #include "libqos/fw_cfg.h"
 #include "qemu/bswap.h"
index 48e8e02d6ecc02649641f1f1bce6dccd553402a6..f7b7cfbc2d1ac14148f987f186f4bc6673c118fd 100644 (file)
@@ -19,7 +19,7 @@
 #include "qemu-common.h"
 #include "qemu/bswap.h"
 #include "qapi/qmp/qlist.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "libqos/fw_cfg.h"
 #include "libqos/libqos.h"
 #include "standard-headers/linux/qemu_fw_cfg.h"
index 8b7aa2d72d0dfda9f5cafb56128206aa9e2382bb..561502052a6748ba75c741de3f36b8e32958b0f4 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 
 /* Load 'test.hex' and verify that the in-memory contents are as expected.
  * 'test.hex' is a memory test pattern stored in Hexadecimal Object
index 5cfd97f915f74945871affb22fb6726259f962d3..3f8081e77d056f6b5d43a8345bbfc557ffd609f7 100644 (file)
@@ -25,7 +25,7 @@
 #include "qemu/osdep.h"
 
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "libqos/libqos.h"
 #include "libqos/pci-pc.h"
 #include "libqos/malloc-pc.h"
index 53a8c9b13ce582764e56a4fa85edafe4fc32d760..65ce10b81befb05396ddd691873bb7999f0accc9 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "libqos/qgraph.h"
 
index ecda25647265aa98ca9b59a7c015a5070605cc41..d5c8b9f12853bd4d3fff15b090b2cb53b7cf53c3 100644 (file)
@@ -13,7 +13,7 @@
 #include "contrib/ivshmem-server/ivshmem-server.h"
 #include "libqos/libqos-pc.h"
 #include "libqos/libqos-spapr.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu-common.h"
 
 #define TMPSHMSIZE (1 << 20)
index 8f827aeb52539533fb8e2348065014ff553037b0..79631cc7a9ad87a4f2019dbf05ec3304b0adc4b4 100644 (file)
@@ -19,8 +19,8 @@
 #include "qemu/osdep.h"
 #include "libqtest.h"
 #include "qemu/module.h"
-#include "libqos/malloc.h"
-#include "libqos/qgraph.h"
+#include "malloc.h"
+#include "qgraph.h"
 #include "sdhci.h"
 
 typedef struct QXlnxZCU102Machine QXlnxZCU102Machine;
index cc1b08eabef0e4900448f9e32ffd3b83fdee9e0f..2946abc15ae2edfb7a2c33c9b19b7b2f9bec3be9 100644 (file)
@@ -25,8 +25,8 @@
 #include "qemu/osdep.h"
 
 #include "libqtest.h"
-#include "libqos/ahci.h"
-#include "libqos/pci-pc.h"
+#include "ahci.h"
+#include "pci-pc.h"
 
 #include "qemu-common.h"
 #include "qemu/host-utils.h"
@@ -579,7 +579,7 @@ void ahci_write_fis(AHCIQState *ahci, AHCICommand *cmd)
     /* NCQ commands use exclusively 8 bit fields and needs no adjustment.
      * Only the count field needs to be adjusted for non-NCQ commands.
      * The auxiliary FIS fields are defined per-command and are not currently
-     * implemented in libqos/ahci.o, but may or may not need to be flipped. */
+     * implemented in ahci.o, but may or may not need to be flipped. */
     if (!cmd->props->ncq) {
         tmp.count = cpu_to_le16(tmp.count);
     }
index 44ab1104b5e97783b595191807699b173befc367..88835b622830c006cbd0fcbb1151f4fb05d296a5 100644 (file)
@@ -25,9 +25,9 @@
  * THE SOFTWARE.
  */
 
-#include "libqos/libqos.h"
-#include "libqos/pci.h"
-#include "libqos/malloc-pc.h"
+#include "libqos.h"
+#include "pci.h"
+#include "malloc-pc.h"
 
 /*** Supplementary PCI Config Space IDs & Masks ***/
 #define PCI_DEVICE_ID_INTEL_Q35_AHCI   (0x2922)
index 0da3f19c0e2ef085c1fe3d3cb72ecbc0ffa778fb..6692adfa4fcb8589e73675d3f0f616ad2d0b8e9a 100644 (file)
@@ -20,9 +20,9 @@
 
 #include "qemu/osdep.h"
 #include "libqtest.h"
-#include "libqos/malloc.h"
-#include "libqos/qgraph.h"
-#include "libqos/i2c.h"
+#include "malloc.h"
+#include "qgraph.h"
+#include "i2c.h"
 
 #define ARM_PAGE_SIZE            4096
 #define IMX25_PDK_RAM_START      0x80000000
index 35f82070fa5f5f5269f5d3356b8a97ac2acefba1..ff2049c3a7eb38410cee411376058c8d337a5526 100644 (file)
@@ -20,9 +20,9 @@
 
 #include "qemu/osdep.h"
 #include "libqtest.h"
-#include "libqos/malloc.h"
-#include "libqos/qgraph.h"
-#include "libqos/i2c.h"
+#include "malloc.h"
+#include "qgraph.h"
+#include "i2c.h"
 
 #define ARM_PAGE_SIZE            4096
 #define N800_RAM_START      0x80000000
index 8480d80669cfd7d04456b3eae8e3c398d1df5df6..35bb4709a4534a81dddbe1909a3e820d46fa6431 100644 (file)
@@ -19,8 +19,8 @@
 #include "qemu/osdep.h"
 #include "libqtest.h"
 #include "qemu/module.h"
-#include "libqos/malloc.h"
-#include "libqos/qgraph.h"
+#include "malloc.h"
+#include "qgraph.h"
 #include "sdhci.h"
 
 #define ARM_PAGE_SIZE             4096
index f6e403b5380e5f3051091426efbd56699221f240..72425f0ad4043905bdd584b6d09181836153e214 100644 (file)
@@ -19,8 +19,8 @@
 #include "qemu/osdep.h"
 #include "libqtest.h"
 #include "qemu/module.h"
-#include "libqos/malloc.h"
-#include "libqos/qgraph.h"
+#include "malloc.h"
+#include "qgraph.h"
 #include "sdhci.h"
 
 #define ARM_PAGE_SIZE            4096
index eebac7feeb9b5cf1b0f7dd2cb1c1cf123ce40612..321b8826d4a2b64d8fbda630e30d46e8006e886c 100644 (file)
@@ -19,8 +19,8 @@
 #include "qemu/osdep.h"
 #include "libqtest.h"
 #include "qemu/module.h"
-#include "libqos/malloc.h"
-#include "libqos/qgraph.h"
+#include "malloc.h"
+#include "qgraph.h"
 #include "sdhci.h"
 
 #define ARM_PAGE_SIZE             4096
index 9316598f9e5b4c46d1270ea85e50ca4294d0f157..e0f59322845aeebeb9b7a703185800038c7a9384 100644 (file)
@@ -19,9 +19,9 @@
 #include "qemu/osdep.h"
 #include "libqtest.h"
 #include "qemu/module.h"
-#include "libqos/malloc.h"
-#include "libqos/qgraph.h"
-#include "libqos/virtio-mmio.h"
+#include "malloc.h"
+#include "qgraph.h"
+#include "virtio-mmio.h"
 
 #define ARM_PAGE_SIZE               4096
 #define VIRTIO_MMIO_BASE_ADDR       0x0A003E00
index 473acce99343e5c9d04b352507f556fde2014984..56e53c745bffd4f80e9414bc45924ded4a85581e 100644 (file)
@@ -19,8 +19,8 @@
 #include "qemu/osdep.h"
 #include "libqtest.h"
 #include "qemu/module.h"
-#include "libqos/malloc.h"
-#include "libqos/qgraph.h"
+#include "malloc.h"
+#include "qgraph.h"
 #include "sdhci.h"
 
 typedef struct QXilinxZynqA9Machine QXilinxZynqA9Machine;
index e2927ed2da12efde99745b92d9af54f142f90be5..a451f6168f63d8672cc52943801fd9e8562fa71c 100644 (file)
 
 #include "qemu/osdep.h"
 #include "libqtest.h"
-#include "libqos/pci-pc.h"
+#include "pci-pc.h"
 #include "qemu/sockets.h"
 #include "qemu/iov.h"
 #include "qemu/module.h"
 #include "qemu/bitops.h"
-#include "libqos/malloc.h"
-#include "libqos/qgraph.h"
+#include "malloc.h"
+#include "qgraph.h"
 #include "e1000e.h"
 
 #define E1000E_IMS      (0x00d0)
index 35183b28757eea00f563e42e84ac826c4bf05848..a22f5fdbad0dc0303a14af569da81ab9a68dc06f 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef QGRAPH_E1000E_H
 #define QGRAPH_E1000E_H
 
-#include "libqos/qgraph.h"
+#include "qgraph.h"
 #include "pci.h"
 
 #define E1000E_RX0_MSG_ID           (0)
index 1f46258f96bfd73ce55b634a6b28815d203331ad..6b8e1babe51e963f95c572bef51c4b2f4ab87b1d 100644 (file)
@@ -13,7 +13,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqos/fw_cfg.h"
+#include "fw_cfg.h"
 #include "libqtest.h"
 #include "qemu/bswap.h"
 #include "hw/nvram/fw_cfg.h"
index f33ece55a37f32c7582212fdfa91d966cb1f72b8..8f9a7e383146694e428e0dc9852e2acea2f425a8 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqos/i2c.h"
+#include "i2c.h"
 
 
 #include "libqtest.h"
index 9ae8214fa802779ee708ec19c0dacc8027c4fa1f..eb4e453485dbdfa7d22e681b1767e54457c65715 100644 (file)
@@ -7,7 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 #include "qemu/osdep.h"
-#include "libqos/i2c.h"
+#include "i2c.h"
 
 
 #include "qemu/bswap.h"
index 38f800dbab7246aef77357b609cdf542dc454437..ade1bdb40e05e56bf64da292c57d375cbc4dd439 100644 (file)
@@ -7,7 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 #include "qemu/osdep.h"
-#include "libqos/i2c.h"
+#include "i2c.h"
 #include "libqtest.h"
 
 void qi2c_send(QI2CDevice *i2cdev, const uint8_t *buf, uint16_t len)
index c65f0878349ee915ba769f9923a36dae415bb590..1341bac1c599114e61e99d487855e77bb97526ea 100644 (file)
@@ -10,7 +10,7 @@
 #define LIBQOS_I2C_H
 
 #include "libqtest.h"
-#include "libqos/qgraph.h"
+#include "qgraph.h"
 
 typedef struct I2CAdapter I2CAdapter;
 struct I2CAdapter {
index d04abc548bade6a0a3aaa5d9fcc780d702af2c68..db420a596e9afea774ec86641c203e819d7cc0aa 100644 (file)
@@ -1,7 +1,7 @@
 #include "qemu/osdep.h"
-#include "libqos/libqos-pc.h"
-#include "libqos/malloc-pc.h"
-#include "libqos/pci-pc.h"
+#include "libqos-pc.h"
+#include "malloc-pc.h"
+#include "pci-pc.h"
 
 static QOSOps qos_ops = {
     .alloc_init = pc_alloc_init,
index a0e4c45516fbe32a0182347565d0d279673a81d4..1a9923ead42fc134a2c11748ccb517bfe8ebba89 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef LIBQOS_PC_H
 #define LIBQOS_PC_H
 
-#include "libqos/libqos.h"
+#include "libqos.h"
 
 QOSState *qtest_pc_vboot(const char *cmdline_fmt, va_list ap);
 QOSState *qtest_pc_boot(const char *cmdline_fmt, ...);
index 8766d543ce59c4471c84731b0f0cef404e8074e9..db0e87ba5c42ddd78ad028da6ecbb68de480ae02 100644 (file)
@@ -1,7 +1,7 @@
 #include "qemu/osdep.h"
-#include "libqos/libqos-spapr.h"
-#include "libqos/malloc-spapr.h"
-#include "libqos/pci-spapr.h"
+#include "libqos-spapr.h"
+#include "malloc-spapr.h"
+#include "pci-spapr.h"
 
 static QOSOps qos_ops = {
     .alloc_init = spapr_alloc_init,
index 49bd72d20b9756e726a1b1907f887dab013d8e1a..c61338917acd3e00a97344016b30e4148644ed05 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef LIBQOS_SPAPR_H
 #define LIBQOS_SPAPR_H
 
-#include "libqos/libqos.h"
+#include "libqos.h"
 
 QOSState *qtest_spapr_vboot(const char *cmdline_fmt, va_list ap);
 QOSState *qtest_spapr_boot(const char *cmdline_fmt, ...);
index f229eb2cb831c95a4f74fa7937d0ff42a021bf3f..2251e864efe1a00c51e41a50ddb8602a2cbd9639 100644 (file)
@@ -2,8 +2,8 @@
 #include <sys/wait.h>
 
 #include "libqtest.h"
-#include "libqos/libqos.h"
-#include "libqos/pci.h"
+#include "libqos.h"
+#include "pci.h"
 #include "qapi/qmp/qdict.h"
 
 /*** Test Setup & Teardown ***/
index 8e971c25a3df460f3d89692cbcf5168606b21904..e0b2bfe7caf9071df7a4f9df698522d5c5e1cd72 100644 (file)
@@ -2,8 +2,8 @@
 #define LIBQOS_H
 
 #include "libqtest.h"
-#include "libqos/pci.h"
-#include "libqos/malloc.h"
+#include "pci.h"
+#include "malloc.h"
 
 typedef struct QOSState QOSState;
 
diff --git a/tests/qtest/libqos/libqtest.h b/tests/qtest/libqos/libqtest.h
new file mode 100644 (file)
index 0000000..f5cf93c
--- /dev/null
@@ -0,0 +1,736 @@
+/*
+ * QTest
+ *
+ * Copyright IBM, Corp. 2012
+ * Copyright Red Hat, Inc. 2012
+ * Copyright SUSE LINUX Products GmbH 2013
+ *
+ * Authors:
+ *  Anthony Liguori   <aliguori@us.ibm.com>
+ *  Paolo Bonzini     <pbonzini@redhat.com>
+ *  Andreas Färber    <afaerber@suse.de>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+#ifndef LIBQTEST_H
+#define LIBQTEST_H
+
+#include "qapi/qmp/qobject.h"
+#include "qapi/qmp/qdict.h"
+
+typedef struct QTestState QTestState;
+
+/**
+ * qtest_initf:
+ * @fmt...: Format for creating other arguments to pass to QEMU, formatted
+ * like sprintf().
+ *
+ * Convenience wrapper around qtest_init().
+ *
+ * Returns: #QTestState instance.
+ */
+QTestState *qtest_initf(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
+
+/**
+ * qtest_vinitf:
+ * @fmt: Format for creating other arguments to pass to QEMU, formatted
+ * like vsprintf().
+ * @ap: Format arguments.
+ *
+ * Convenience wrapper around qtest_init().
+ *
+ * Returns: #QTestState instance.
+ */
+QTestState *qtest_vinitf(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0);
+
+/**
+ * qtest_init:
+ * @extra_args: other arguments to pass to QEMU.  CAUTION: these
+ * arguments are subject to word splitting and shell evaluation.
+ *
+ * Returns: #QTestState instance.
+ */
+QTestState *qtest_init(const char *extra_args);
+
+/**
+ * qtest_init_without_qmp_handshake:
+ * @extra_args: other arguments to pass to QEMU.  CAUTION: these
+ * arguments are subject to word splitting and shell evaluation.
+ *
+ * Returns: #QTestState instance.
+ */
+QTestState *qtest_init_without_qmp_handshake(const char *extra_args);
+
+/**
+ * qtest_init_with_serial:
+ * @extra_args: other arguments to pass to QEMU.  CAUTION: these
+ * arguments are subject to word splitting and shell evaluation.
+ * @sock_fd: pointer to store the socket file descriptor for
+ * connection with serial.
+ *
+ * Returns: #QTestState instance.
+ */
+QTestState *qtest_init_with_serial(const char *extra_args, int *sock_fd);
+
+/**
+ * qtest_quit:
+ * @s: #QTestState instance to operate on.
+ *
+ * Shut down the QEMU process associated to @s.
+ */
+void qtest_quit(QTestState *s);
+
+/**
+ * qtest_qmp_fds:
+ * @s: #QTestState instance to operate on.
+ * @fds: array of file descriptors
+ * @fds_num: number of elements in @fds
+ * @fmt...: QMP message to send to qemu, formatted like
+ * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * supported after '%'.
+ *
+ * Sends a QMP message to QEMU with fds and returns the response.
+ */
+QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num,
+                     const char *fmt, ...)
+    GCC_FMT_ATTR(4, 5);
+
+/**
+ * qtest_qmp:
+ * @s: #QTestState instance to operate on.
+ * @fmt...: QMP message to send to qemu, formatted like
+ * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * supported after '%'.
+ *
+ * Sends a QMP message to QEMU and returns the response.
+ */
+QDict *qtest_qmp(QTestState *s, const char *fmt, ...)
+    GCC_FMT_ATTR(2, 3);
+
+/**
+ * qtest_qmp_send:
+ * @s: #QTestState instance to operate on.
+ * @fmt...: QMP message to send to qemu, formatted like
+ * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * supported after '%'.
+ *
+ * Sends a QMP message to QEMU and leaves the response in the stream.
+ */
+void qtest_qmp_send(QTestState *s, const char *fmt, ...)
+    GCC_FMT_ATTR(2, 3);
+
+/**
+ * qtest_qmp_send_raw:
+ * @s: #QTestState instance to operate on.
+ * @fmt...: text to send, formatted like sprintf()
+ *
+ * Sends text to the QMP monitor verbatim.  Need not be valid JSON;
+ * this is useful for negative tests.
+ */
+void qtest_qmp_send_raw(QTestState *s, const char *fmt, ...)
+    GCC_FMT_ATTR(2, 3);
+
+/**
+ * qtest_vqmp_fds:
+ * @s: #QTestState instance to operate on.
+ * @fds: array of file descriptors
+ * @fds_num: number of elements in @fds
+ * @fmt: QMP message to send to QEMU, formatted like
+ * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * supported after '%'.
+ * @ap: QMP message arguments
+ *
+ * Sends a QMP message to QEMU with fds and returns the response.
+ */
+QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num,
+                      const char *fmt, va_list ap)
+    GCC_FMT_ATTR(4, 0);
+
+/**
+ * qtest_vqmp:
+ * @s: #QTestState instance to operate on.
+ * @fmt: QMP message to send to QEMU, formatted like
+ * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * supported after '%'.
+ * @ap: QMP message arguments
+ *
+ * Sends a QMP message to QEMU and returns the response.
+ */
+QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap)
+    GCC_FMT_ATTR(2, 0);
+
+/**
+ * qtest_qmp_vsend_fds:
+ * @s: #QTestState instance to operate on.
+ * @fds: array of file descriptors
+ * @fds_num: number of elements in @fds
+ * @fmt: QMP message to send to QEMU, formatted like
+ * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * supported after '%'.
+ * @ap: QMP message arguments
+ *
+ * Sends a QMP message to QEMU and leaves the response in the stream.
+ */
+void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num,
+                         const char *fmt, va_list ap)
+    GCC_FMT_ATTR(4, 0);
+
+/**
+ * qtest_qmp_vsend:
+ * @s: #QTestState instance to operate on.
+ * @fmt: QMP message to send to QEMU, formatted like
+ * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * supported after '%'.
+ * @ap: QMP message arguments
+ *
+ * Sends a QMP message to QEMU and leaves the response in the stream.
+ */
+void qtest_qmp_vsend(QTestState *s, const char *fmt, va_list ap)
+    GCC_FMT_ATTR(2, 0);
+
+/**
+ * qtest_receive:
+ * @s: #QTestState instance to operate on.
+ *
+ * Reads a QMP message from QEMU and returns the response.
+ */
+QDict *qtest_qmp_receive(QTestState *s);
+
+/**
+ * qtest_qmp_eventwait:
+ * @s: #QTestState instance to operate on.
+ * @s: #event event to wait for.
+ *
+ * Continuously polls for QMP responses until it receives the desired event.
+ */
+void qtest_qmp_eventwait(QTestState *s, const char *event);
+
+/**
+ * qtest_qmp_eventwait_ref:
+ * @s: #QTestState instance to operate on.
+ * @s: #event event to wait for.
+ *
+ * Continuously polls for QMP responses until it receives the desired event.
+ * Returns a copy of the event for further investigation.
+ */
+QDict *qtest_qmp_eventwait_ref(QTestState *s, const char *event);
+
+/**
+ * qtest_qmp_receive_success:
+ * @s: #QTestState instance to operate on
+ * @event_cb: Event callback
+ * @opaque: Argument for @event_cb
+ *
+ * Poll QMP messages until a command success response is received.
+ * If @event_cb, call it for each event received, passing @opaque,
+ * the event's name and data.
+ * Return the success response's "return" member.
+ */
+QDict *qtest_qmp_receive_success(QTestState *s,
+                                 void (*event_cb)(void *opaque,
+                                                  const char *name,
+                                                  QDict *data),
+                                 void *opaque);
+
+/**
+ * qtest_hmp:
+ * @s: #QTestState instance to operate on.
+ * @fmt...: HMP command to send to QEMU, formats arguments like sprintf().
+ *
+ * Send HMP command to QEMU via QMP's human-monitor-command.
+ * QMP events are discarded.
+ *
+ * Returns: the command's output.  The caller should g_free() it.
+ */
+char *qtest_hmp(QTestState *s, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
+
+/**
+ * qtest_hmpv:
+ * @s: #QTestState instance to operate on.
+ * @fmt: HMP command to send to QEMU, formats arguments like vsprintf().
+ * @ap: HMP command arguments
+ *
+ * Send HMP command to QEMU via QMP's human-monitor-command.
+ * QMP events are discarded.
+ *
+ * Returns: the command's output.  The caller should g_free() it.
+ */
+char *qtest_vhmp(QTestState *s, const char *fmt, va_list ap)
+    GCC_FMT_ATTR(2, 0);
+
+void qtest_module_load(QTestState *s, const char *prefix, const char *libname);
+
+/**
+ * qtest_get_irq:
+ * @s: #QTestState instance to operate on.
+ * @num: Interrupt to observe.
+ *
+ * Returns: The level of the @num interrupt.
+ */
+bool qtest_get_irq(QTestState *s, int num);
+
+/**
+ * qtest_irq_intercept_in:
+ * @s: #QTestState instance to operate on.
+ * @string: QOM path of a device.
+ *
+ * Associate qtest irqs with the GPIO-in pins of the device
+ * whose path is specified by @string.
+ */
+void qtest_irq_intercept_in(QTestState *s, const char *string);
+
+/**
+ * qtest_irq_intercept_out:
+ * @s: #QTestState instance to operate on.
+ * @string: QOM path of a device.
+ *
+ * Associate qtest irqs with the GPIO-out pins of the device
+ * whose path is specified by @string.
+ */
+void qtest_irq_intercept_out(QTestState *s, const char *string);
+
+/**
+ * qtest_set_irq_in:
+ * @s: QTestState instance to operate on.
+ * @string: QOM path of a device
+ * @name: IRQ name
+ * @irq: IRQ number
+ * @level: IRQ level
+ *
+ * Force given device/irq GPIO-in pin to the given level.
+ */
+void qtest_set_irq_in(QTestState *s, const char *string, const char *name,
+                      int irq, int level);
+
+/**
+ * qtest_outb:
+ * @s: #QTestState instance to operate on.
+ * @addr: I/O port to write to.
+ * @value: Value being written.
+ *
+ * Write an 8-bit value to an I/O port.
+ */
+void qtest_outb(QTestState *s, uint16_t addr, uint8_t value);
+
+/**
+ * qtest_outw:
+ * @s: #QTestState instance to operate on.
+ * @addr: I/O port to write to.
+ * @value: Value being written.
+ *
+ * Write a 16-bit value to an I/O port.
+ */
+void qtest_outw(QTestState *s, uint16_t addr, uint16_t value);
+
+/**
+ * qtest_outl:
+ * @s: #QTestState instance to operate on.
+ * @addr: I/O port to write to.
+ * @value: Value being written.
+ *
+ * Write a 32-bit value to an I/O port.
+ */
+void qtest_outl(QTestState *s, uint16_t addr, uint32_t value);
+
+/**
+ * qtest_inb:
+ * @s: #QTestState instance to operate on.
+ * @addr: I/O port to read from.
+ *
+ * Returns an 8-bit value from an I/O port.
+ */
+uint8_t qtest_inb(QTestState *s, uint16_t addr);
+
+/**
+ * qtest_inw:
+ * @s: #QTestState instance to operate on.
+ * @addr: I/O port to read from.
+ *
+ * Returns a 16-bit value from an I/O port.
+ */
+uint16_t qtest_inw(QTestState *s, uint16_t addr);
+
+/**
+ * qtest_inl:
+ * @s: #QTestState instance to operate on.
+ * @addr: I/O port to read from.
+ *
+ * Returns a 32-bit value from an I/O port.
+ */
+uint32_t qtest_inl(QTestState *s, uint16_t addr);
+
+/**
+ * qtest_writeb:
+ * @s: #QTestState instance to operate on.
+ * @addr: Guest address to write to.
+ * @value: Value being written.
+ *
+ * Writes an 8-bit value to memory.
+ */
+void qtest_writeb(QTestState *s, uint64_t addr, uint8_t value);
+
+/**
+ * qtest_writew:
+ * @s: #QTestState instance to operate on.
+ * @addr: Guest address to write to.
+ * @value: Value being written.
+ *
+ * Writes a 16-bit value to memory.
+ */
+void qtest_writew(QTestState *s, uint64_t addr, uint16_t value);
+
+/**
+ * qtest_writel:
+ * @s: #QTestState instance to operate on.
+ * @addr: Guest address to write to.
+ * @value: Value being written.
+ *
+ * Writes a 32-bit value to memory.
+ */
+void qtest_writel(QTestState *s, uint64_t addr, uint32_t value);
+
+/**
+ * qtest_writeq:
+ * @s: #QTestState instance to operate on.
+ * @addr: Guest address to write to.
+ * @value: Value being written.
+ *
+ * Writes a 64-bit value to memory.
+ */
+void qtest_writeq(QTestState *s, uint64_t addr, uint64_t value);
+
+/**
+ * qtest_readb:
+ * @s: #QTestState instance to operate on.
+ * @addr: Guest address to read from.
+ *
+ * Reads an 8-bit value from memory.
+ *
+ * Returns: Value read.
+ */
+uint8_t qtest_readb(QTestState *s, uint64_t addr);
+
+/**
+ * qtest_readw:
+ * @s: #QTestState instance to operate on.
+ * @addr: Guest address to read from.
+ *
+ * Reads a 16-bit value from memory.
+ *
+ * Returns: Value read.
+ */
+uint16_t qtest_readw(QTestState *s, uint64_t addr);
+
+/**
+ * qtest_readl:
+ * @s: #QTestState instance to operate on.
+ * @addr: Guest address to read from.
+ *
+ * Reads a 32-bit value from memory.
+ *
+ * Returns: Value read.
+ */
+uint32_t qtest_readl(QTestState *s, uint64_t addr);
+
+/**
+ * qtest_readq:
+ * @s: #QTestState instance to operate on.
+ * @addr: Guest address to read from.
+ *
+ * Reads a 64-bit value from memory.
+ *
+ * Returns: Value read.
+ */
+uint64_t qtest_readq(QTestState *s, uint64_t addr);
+
+/**
+ * qtest_memread:
+ * @s: #QTestState instance to operate on.
+ * @addr: Guest address to read from.
+ * @data: Pointer to where memory contents will be stored.
+ * @size: Number of bytes to read.
+ *
+ * Read guest memory into a buffer.
+ */
+void qtest_memread(QTestState *s, uint64_t addr, void *data, size_t size);
+
+/**
+ * qtest_rtas_call:
+ * @s: #QTestState instance to operate on.
+ * @name: name of the command to call.
+ * @nargs: Number of args.
+ * @args: Guest address to read args from.
+ * @nret: Number of return value.
+ * @ret: Guest address to write return values to.
+ *
+ * Call an RTAS function
+ */
+uint64_t qtest_rtas_call(QTestState *s, const char *name,
+                         uint32_t nargs, uint64_t args,
+                         uint32_t nret, uint64_t ret);
+
+/**
+ * qtest_bufread:
+ * @s: #QTestState instance to operate on.
+ * @addr: Guest address to read from.
+ * @data: Pointer to where memory contents will be stored.
+ * @size: Number of bytes to read.
+ *
+ * Read guest memory into a buffer and receive using a base64 encoding.
+ */
+void qtest_bufread(QTestState *s, uint64_t addr, void *data, size_t size);
+
+/**
+ * qtest_memwrite:
+ * @s: #QTestState instance to operate on.
+ * @addr: Guest address to write to.
+ * @data: Pointer to the bytes that will be written to guest memory.
+ * @size: Number of bytes to write.
+ *
+ * Write a buffer to guest memory.
+ */
+void qtest_memwrite(QTestState *s, uint64_t addr, const void *data, size_t size);
+
+/**
+ * qtest_bufwrite:
+ * @s: #QTestState instance to operate on.
+ * @addr: Guest address to write to.
+ * @data: Pointer to the bytes that will be written to guest memory.
+ * @size: Number of bytes to write.
+ *
+ * Write a buffer to guest memory and transmit using a base64 encoding.
+ */
+void qtest_bufwrite(QTestState *s, uint64_t addr,
+                    const void *data, size_t size);
+
+/**
+ * qtest_memset:
+ * @s: #QTestState instance to operate on.
+ * @addr: Guest address to write to.
+ * @patt: Byte pattern to fill the guest memory region with.
+ * @size: Number of bytes to write.
+ *
+ * Write a pattern to guest memory.
+ */
+void qtest_memset(QTestState *s, uint64_t addr, uint8_t patt, size_t size);
+
+/**
+ * qtest_clock_step_next:
+ * @s: #QTestState instance to operate on.
+ *
+ * Advance the QEMU_CLOCK_VIRTUAL to the next deadline.
+ *
+ * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
+ */
+int64_t qtest_clock_step_next(QTestState *s);
+
+/**
+ * qtest_clock_step:
+ * @s: QTestState instance to operate on.
+ * @step: Number of nanoseconds to advance the clock by.
+ *
+ * Advance the QEMU_CLOCK_VIRTUAL by @step nanoseconds.
+ *
+ * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
+ */
+int64_t qtest_clock_step(QTestState *s, int64_t step);
+
+/**
+ * qtest_clock_set:
+ * @s: QTestState instance to operate on.
+ * @val: Nanoseconds value to advance the clock to.
+ *
+ * Advance the QEMU_CLOCK_VIRTUAL to @val nanoseconds since the VM was launched.
+ *
+ * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
+ */
+int64_t qtest_clock_set(QTestState *s, int64_t val);
+
+/**
+ * qtest_big_endian:
+ * @s: QTestState instance to operate on.
+ *
+ * Returns: True if the architecture under test has a big endian configuration.
+ */
+bool qtest_big_endian(QTestState *s);
+
+/**
+ * qtest_get_arch:
+ *
+ * Returns: The architecture for the QEMU executable under test.
+ */
+const char *qtest_get_arch(void);
+
+/**
+ * qtest_add_func:
+ * @str: Test case path.
+ * @fn: Test case function
+ *
+ * Add a GTester testcase with the given name and function.
+ * The path is prefixed with the architecture under test, as
+ * returned by qtest_get_arch().
+ */
+void qtest_add_func(const char *str, void (*fn)(void));
+
+/**
+ * qtest_add_data_func:
+ * @str: Test case path.
+ * @data: Test case data
+ * @fn: Test case function
+ *
+ * Add a GTester testcase with the given name, data and function.
+ * The path is prefixed with the architecture under test, as
+ * returned by qtest_get_arch().
+ */
+void qtest_add_data_func(const char *str, const void *data,
+                         void (*fn)(const void *));
+
+/**
+ * qtest_add_data_func_full:
+ * @str: Test case path.
+ * @data: Test case data
+ * @fn: Test case function
+ * @data_free_func: GDestroyNotify for data
+ *
+ * Add a GTester testcase with the given name, data and function.
+ * The path is prefixed with the architecture under test, as
+ * returned by qtest_get_arch().
+ *
+ * @data is passed to @data_free_func() on test completion.
+ */
+void qtest_add_data_func_full(const char *str, void *data,
+                              void (*fn)(const void *),
+                              GDestroyNotify data_free_func);
+
+/**
+ * qtest_add:
+ * @testpath: Test case path
+ * @Fixture: Fixture type
+ * @tdata: Test case data
+ * @fsetup: Test case setup function
+ * @ftest: Test case function
+ * @fteardown: Test case teardown function
+ *
+ * Add a GTester testcase with the given name, data and functions.
+ * The path is prefixed with the architecture under test, as
+ * returned by qtest_get_arch().
+ */
+#define qtest_add(testpath, Fixture, tdata, fsetup, ftest, fteardown) \
+    do { \
+        char *path = g_strdup_printf("/%s/%s", qtest_get_arch(), testpath); \
+        g_test_add(path, Fixture, tdata, fsetup, ftest, fteardown); \
+        g_free(path); \
+    } while (0)
+
+void qtest_add_abrt_handler(GHookFunc fn, const void *data);
+
+/**
+ * qtest_qmp_assert_success:
+ * @qts: QTestState instance to operate on
+ * @fmt...: QMP message to send to qemu, formatted like
+ * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * supported after '%'.
+ *
+ * Sends a QMP message to QEMU and asserts that a 'return' key is present in
+ * the response.
+ */
+void qtest_qmp_assert_success(QTestState *qts, const char *fmt, ...)
+    GCC_FMT_ATTR(2, 3);
+
+QDict *qmp_fd_receive(int fd);
+void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num,
+                      const char *fmt, va_list ap) GCC_FMT_ATTR(4, 0);
+void qmp_fd_vsend(int fd, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0);
+void qmp_fd_send(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
+void qmp_fd_send_raw(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
+void qmp_fd_vsend_raw(int fd, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0);
+QDict *qmp_fdv(int fd, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0);
+QDict *qmp_fd(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
+
+/**
+ * qtest_cb_for_every_machine:
+ * @cb: Pointer to the callback function
+ * @skip_old_versioned: true if versioned old machine types should be skipped
+ *
+ *  Call a callback function for every name of all available machines.
+ */
+void qtest_cb_for_every_machine(void (*cb)(const char *machine),
+                                bool skip_old_versioned);
+
+/**
+ * qtest_qmp_device_add_qdict:
+ * @qts: QTestState instance to operate on
+ * @drv: Name of the device that should be added
+ * @arguments: QDict with properties for the device to intialize
+ *
+ * Generic hot-plugging test via the device_add QMP command with properties
+ * supplied in form of QDict. Use NULL for empty properties list.
+ */
+void qtest_qmp_device_add_qdict(QTestState *qts, const char *drv,
+                                const QDict *arguments);
+
+/**
+ * qtest_qmp_device_add:
+ * @qts: QTestState instance to operate on
+ * @driver: Name of the device that should be added
+ * @id: Identification string
+ * @fmt...: QMP message to send to qemu, formatted like
+ * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * supported after '%'.
+ *
+ * Generic hot-plugging test via the device_add QMP command.
+ */
+void qtest_qmp_device_add(QTestState *qts, const char *driver, const char *id,
+                          const char *fmt, ...) GCC_FMT_ATTR(4, 5);
+
+/**
+ * qtest_qmp_device_del:
+ * @qts: QTestState instance to operate on
+ * @id: Identification string
+ *
+ * Generic hot-unplugging test via the device_del QMP command.
+ */
+void qtest_qmp_device_del(QTestState *qts, const char *id);
+
+/**
+ * qmp_rsp_is_err:
+ * @rsp: QMP response to check for error
+ *
+ * Test @rsp for error and discard @rsp.
+ * Returns 'true' if there is error in @rsp and 'false' otherwise.
+ */
+bool qmp_rsp_is_err(QDict *rsp);
+
+/**
+ * qmp_assert_error_class:
+ * @rsp: QMP response to check for error
+ * @class: an error class
+ *
+ * Assert the response has the given error class and discard @rsp.
+ */
+void qmp_assert_error_class(QDict *rsp, const char *class);
+
+/**
+ * qtest_probe_child:
+ * @s: QTestState instance to operate on.
+ *
+ * Returns: true if the child is still alive.
+ */
+bool qtest_probe_child(QTestState *s);
+
+/**
+ * qtest_set_expected_status:
+ * @s: QTestState instance to operate on.
+ * @status: an expected exit status.
+ *
+ * Set expected exit status of the child.
+ */
+void qtest_set_expected_status(QTestState *s, int status);
+
+QTestState *qtest_inproc_init(QTestState **s, bool log, const char* arch,
+                    void (*send)(void*, const char*));
+
+void qtest_client_inproc_recv(void *opaque, const char *str);
+#endif
index 6f92ce41350c8bec1b5c1c3be8666bb7d9c9d377..16ff9609ccc0d9894af5ea4a176b69f158210640 100644 (file)
@@ -11,8 +11,8 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqos/malloc-pc.h"
-#include "libqos/fw_cfg.h"
+#include "malloc-pc.h"
+#include "fw_cfg.h"
 
 #include "standard-headers/linux/qemu_fw_cfg.h"
 
index 21e75ae00493eb9aaaabe510b844774784c1a1a7..d8d79853c8442e0bd983de668af4199b4d806f83 100644 (file)
@@ -13,7 +13,7 @@
 #ifndef LIBQOS_MALLOC_PC_H
 #define LIBQOS_MALLOC_PC_H
 
-#include "libqos/malloc.h"
+#include "malloc.h"
 
 void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags);
 
index 2a6b7e3776a30f26323751a4be48bd53b61fc609..84862e48768a57873a13fb5050d689eb9489eb1c 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqos/malloc-spapr.h"
+#include "malloc-spapr.h"
 
 #include "qemu-common.h"
 
index e5fe9bfc4b548d811d5375ecaaa6d4cf30010d61..f99572fd71d94944d31da5e4e953857ce0bf1603 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef LIBQOS_MALLOC_SPAPR_H
 #define LIBQOS_MALLOC_SPAPR_H
 
-#include "libqos/malloc.h"
+#include "malloc.h"
 
 void spapr_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags);
 
index 615422a5c4da4c161f247d410811e991c7127fb7..f708b0143262d287a98591a2b49612803a4f8e09 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqos/malloc.h"
+#include "malloc.h"
 #include "qemu-common.h"
 #include "qemu/host-utils.h"
 
diff --git a/tests/qtest/libqos/meson.build b/tests/qtest/libqos/meson.build
new file mode 100644 (file)
index 0000000..19931b9
--- /dev/null
@@ -0,0 +1,57 @@
+libqos = static_library('qos',
+  files('../libqtest.c',
+        'qgraph.c',
+        'qos_external.c',
+        'pci.c',
+        'fw_cfg.c',
+        'malloc.c',
+        'libqos.c',
+
+        # spapr
+        'malloc-spapr.c',
+        'libqos-spapr.c',
+        'rtas.c',
+        'pci-spapr.c',
+
+        # pc
+        'pci-pc.c',
+        'malloc-pc.c',
+        'libqos-pc.c',
+        'ahci.c',
+
+        # usb
+        'usb.c',
+
+        # qgraph devices:
+        'e1000e.c',
+        'i2c.c',
+        'i2c-imx.c',
+        'i2c-omap.c',
+        'sdhci.c',
+        'tpci200.c',
+        'virtio.c',
+        'virtio-9p.c',
+        'virtio-balloon.c',
+        'virtio-blk.c',
+        'virtio-mmio.c',
+        'virtio-net.c',
+        'virtio-pci.c',
+        'virtio-pci-modern.c',
+        'virtio-rng.c',
+        'virtio-scsi.c',
+        'virtio-serial.c',
+
+        # qgraph machines:
+        'aarch64-xlnx-zcu102-machine.c',
+        'arm-imx25-pdk-machine.c',
+        'arm-n800-machine.c',
+        'arm-raspi2-machine.c',
+        'arm-sabrelite-machine.c',
+        'arm-smdkc210-machine.c',
+        'arm-virt-machine.c',
+        'arm-xilinx-zynq-a9-machine.c',
+        'ppc64_pseries-machine.c',
+        'x86_64_pc-machine.c',
+), build_by_default: false)
+
+qos = declare_dependency(link_whole: libqos)
index 3bb2eb3ba83a01400e166b7484ccae583722aec0..f97844289f138c1d082723ef90ebc5f6d0eb883c 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "qemu/osdep.h"
 #include "libqtest.h"
-#include "libqos/pci-pc.h"
+#include "pci-pc.h"
 #include "qapi/qmp/qdict.h"
 #include "hw/pci/pci_regs.h"
 
index 4690005232342636a6bd01fc5a0838ca9b146b7b..49ec9507f22de21a6c01f6023b39c2ac884cdc86 100644 (file)
@@ -13,9 +13,9 @@
 #ifndef LIBQOS_PCI_PC_H
 #define LIBQOS_PCI_PC_H
 
-#include "libqos/pci.h"
-#include "libqos/malloc.h"
-#include "libqos/qgraph.h"
+#include "pci.h"
+#include "malloc.h"
+#include "qgraph.h"
 
 typedef struct QPCIBusPC {
     QOSGraphObject obj;
index d6f8c01cb7b01fc9f4a396979240f9108a3687ac..262226985f378e8af0c65e12577d7f94e9464115 100644 (file)
@@ -7,9 +7,9 @@
 
 #include "qemu/osdep.h"
 #include "libqtest.h"
-#include "libqos/pci-spapr.h"
-#include "libqos/rtas.h"
-#include "libqos/qgraph.h"
+#include "pci-spapr.h"
+#include "rtas.h"
+#include "qgraph.h"
 
 #include "hw/pci/pci_regs.h"
 
index d9e25631c6a9a2c996e0b438ada497b943868cee..20a43718b7dbfce60c4cd568aea61fa00fd0717b 100644 (file)
@@ -8,9 +8,9 @@
 #ifndef LIBQOS_PCI_SPAPR_H
 #define LIBQOS_PCI_SPAPR_H
 
-#include "libqos/malloc.h"
-#include "libqos/pci.h"
-#include "libqos/qgraph.h"
+#include "malloc.h"
+#include "pci.h"
+#include "qgraph.h"
 
 /* From include/hw/pci-host/spapr.h */
 
index 2309a724e434b0342f9d963e6833a44b607bdf19..e1e96189c821734850901cb6401fb6e219be5636 100644 (file)
  */
 
 #include "qemu/osdep.h"
-#include "libqos/pci.h"
+#include "pci.h"
 
 #include "hw/pci/pci_regs.h"
 #include "qemu/host-utils.h"
-#include "libqos/qgraph.h"
+#include "qgraph.h"
 
 void qpci_device_foreach(QPCIBus *bus, int vendor_id, int device_id,
                          void (*func)(QPCIDevice *dev, int devfn, void *data),
index 590c1751906e844161be201e960727ce2f6b272f..ee64fdecbda854381559c638e682d7d90e4a3518 100644 (file)
@@ -14,7 +14,7 @@
 #define LIBQOS_PCI_H
 
 #include "libqtest.h"
-#include "libqos/qgraph.h"
+#include "qgraph.h"
 
 #define QPCI_PIO_LIMIT    0x10000
 
index 5d7bd88f2f8cc9eaf5513675af2b5a79b96a8c86..24ca1799765f382eef46e61996b68dffec96e352 100644 (file)
 
 #include "qemu/osdep.h"
 #include "libqtest.h"
-#include "libqos/qgraph.h"
+#include "qgraph.h"
 #include "pci-spapr.h"
 #include "qemu/module.h"
-#include "libqos/malloc-spapr.h"
+#include "malloc-spapr.h"
 
 typedef struct QSPAPR_pci_host QSPAPR_pci_host;
 typedef struct Qppc64_pseriesMachine Qppc64_pseriesMachine;
index eb0af8ab4ae9f3fff3dd3d39ff6d5ef095bd10be..fc49cfa8794e442440eb396f6a1e03fc4f053bbe 100644 (file)
@@ -19,8 +19,8 @@
 #include "qemu/osdep.h"
 #include "libqtest.h"
 #include "qemu/queue.h"
-#include "libqos/qgraph_internal.h"
-#include "libqos/qgraph.h"
+#include "qgraph_internal.h"
+#include "qgraph.h"
 
 #define QGRAPH_PRINT_DEBUG 0
 #define QOS_ROOT ""
index db1244eb59f3115a921314746fd4c56005c56c1f..10543269ce42cec78adfddc69331811f7f3880d4 100644 (file)
@@ -106,7 +106,7 @@ typedef void *(*QOSBeforeTest) (GString *cmd_line, void *arg);
  * <example>
  *   <title>Creating new driver an its interface</title>
  *   <programlisting>
- #include "libqos/qgraph.h"
+ #include "qgraph.h"
 
  struct My_driver {
      QOSGraphObject obj;
@@ -190,7 +190,7 @@ typedef void *(*QOSBeforeTest) (GString *cmd_line, void *arg);
  * <example>
  *   <title>Creating new test</title>
  *   <programlisting>
- * #include "libqos/qgraph.h"
+ * #include "qgraph.h"
  *
  * static void my_test_function(void *obj, void *data)
  * {
@@ -230,7 +230,7 @@ typedef void *(*QOSBeforeTest) (GString *cmd_line, void *arg);
  * a valid test path will be:
  * "/x86_64/pc/other_node/my_driver/my_interface/my_test".
  *
- * Additional examples are also in libqos/test-qgraph.c
+ * Additional examples are also in test-qgraph.c
  *
  * Command line:
  * Command line is built by using node names and optional arguments
index aa3123f0f2bdaee9e63a0ccf0372c9d271de9713..968fa6945096c1d8f32fe5886bcdb47cb5d817c1 100644 (file)
 #define QGRAPH_INTERNAL_H
 
 /* This header is declaring additional helper functions defined in
- * libqos/qgraph.c
+ * qgraph.c
  * It should not be included in tests
  */
 
-#include "libqos/qgraph.h"
+#include "qgraph.h"
 
 typedef struct QOSGraphMachine QOSGraphMachine;
 typedef enum QOSEdgeType QOSEdgeType;
index 0dfc05cfb638e1dfdfba9bf2849eae17390b1858..10ee0f75b288dc0f270e94a321514323ed1804bf 100644 (file)
 #include "qapi/qmp/qstring.h"
 #include "qemu/module.h"
 #include "qapi/qmp/qlist.h"
-#include "libqos/malloc.h"
-#include "libqos/qgraph.h"
-#include "libqos/qgraph_internal.h"
-#include "libqos/qos_external.h"
+#include "malloc.h"
+#include "qgraph.h"
+#include "qgraph_internal.h"
+#include "qos_external.h"
 
 static void machine_apply_to_node(const char *name)
 {
index 56a2f37fde9e8237ed4237a240c98733d8b59465..8446e3df0b1ceacab01a4fdb186813771d1ea06f 100644 (file)
@@ -19,7 +19,9 @@
 #ifndef QOS_EXTERNAL_H
 #define QOS_EXTERNAL_H
 
-#include "libqos/malloc.h"
+#include "qgraph.h"
+
+#include "malloc.h"
 #include "qapi/qapi-types-machine.h"
 #include "qapi/qapi-types-qom.h"
 
index d81ff4274da0a906e6e4bbb94d73f14e85ca636e..db29d5554dcb51b1d15f315c989125ba1c0440a8 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "qemu/osdep.h"
 #include "libqtest.h"
-#include "libqos/rtas.h"
+#include "rtas.h"
 
 static void qrtas_copy_args(QTestState *qts, uint64_t target_args,
                             uint32_t nargs, uint32_t *args)
index 459e23aaf4d02163f811c4d572b84f899b3cd1e5..f38f99dfab84533f47e760b7b8d0f149b5a05802 100644 (file)
@@ -5,7 +5,7 @@
 
 #ifndef LIBQOS_RTAS_H
 #define LIBQOS_RTAS_H
-#include "libqos/malloc.h"
+#include "malloc.h"
 
 int qrtas_get_time_of_day(QTestState *qts, QGuestAllocator *alloc,
                           struct tm *tm, uint32_t *ns);
index fbf2e36aecbceae8bf665dd770153df014a54726..65f0d07fc5ace15f99f536b7db5e5ab5d9d0ac45 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "qemu/osdep.h"
 #include "libqtest.h"
-#include "libqos/qgraph.h"
+#include "qgraph.h"
 #include "pci.h"
 #include "qemu/module.h"
 #include "sdhci.h"
index 1acd3096e2fee209c5a471257af8859b58ded157..22d647b1fd51fd06c485c386574bf5abe716e1fb 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef QGRAPH_QSDHCI_H
 #define QGRAPH_QSDHCI_H
 
-#include "libqos/qgraph.h"
+#include "qgraph.h"
 #include "pci.h"
 
 typedef struct QSDHCI QSDHCI;
index ae590a456ec60e24857091d6ef1d537e6ea40e95..1787b1f188d3d8213aa3b939e6c5eefc2cdb2da9 100644 (file)
@@ -10,8 +10,8 @@
 #include "qemu/osdep.h"
 #include "libqtest.h"
 #include "qemu/module.h"
-#include "libqos/qgraph.h"
-#include "libqos/pci.h"
+#include "qgraph.h"
+#include "pci.h"
 
 typedef struct QTpci200 QTpci200;
 typedef struct QIpack QIpack;
index d7a9cb3c72a4febd05d03e705f4b9f7da62d5b14..8b45b0298446a1f861f72ac6890cdc39b8d4ef94 100644 (file)
@@ -14,7 +14,7 @@
 #include "qemu/osdep.h"
 #include "libqtest.h"
 #include "hw/usb/uhci-regs.h"
-#include "libqos/usb.h"
+#include "usb.h"
 
 void qusb_pci_init_one(QPCIBus *pcibus, struct qhc *hc, uint32_t devfn, int bar)
 {
index eeced39a2f9f06a4e523548e43f2f18c3fe9d90d..50030d7fb112db4e7991793976928d58262b1dc2 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef LIBQOS_USB_H
 #define LIBQOS_USB_H
 
-#include "libqos/pci-pc.h"
+#include "pci-pc.h"
 
 struct qhc {
     QPCIDevice *dev;
index c87b56132a3814a1c0b65a1d6922bf884d99d160..2e300063e3d0acb506a88b24d8f07b7a331f116c 100644 (file)
@@ -20,8 +20,8 @@
 #include "libqtest.h"
 #include "qemu/module.h"
 #include "standard-headers/linux/virtio_ids.h"
-#include "libqos/virtio-9p.h"
-#include "libqos/qgraph.h"
+#include "virtio-9p.h"
+#include "qgraph.h"
 
 static QGuestAllocator *alloc;
 
index be9621a5e3c1f42c5b12142c6c64917efdaf4e12..b1e6badc4ad208ae4e7ebe85339f1efa1e50612c 100644 (file)
@@ -19,9 +19,9 @@
 #ifndef TESTS_LIBQOS_VIRTIO_9P_H
 #define TESTS_LIBQOS_VIRTIO_9P_H
 
-#include "libqos/qgraph.h"
-#include "libqos/virtio.h"
-#include "libqos/virtio-pci.h"
+#include "qgraph.h"
+#include "virtio.h"
+#include "virtio-pci.h"
 
 typedef struct QVirtio9P QVirtio9P;
 typedef struct QVirtio9PPCI QVirtio9PPCI;
index 9745f4a83cc548f2ef7068a361fbcec31c3721ef..a3da5c234d49753fedc77e3288ac1f92d470cc8f 100644 (file)
@@ -19,8 +19,8 @@
 #include "qemu/osdep.h"
 #include "libqtest.h"
 #include "qemu/module.h"
-#include "libqos/qgraph.h"
-#include "libqos/virtio-balloon.h"
+#include "qgraph.h"
+#include "virtio-balloon.h"
 
 /* virtio-balloon-device */
 static void *qvirtio_balloon_get_driver(QVirtioBalloon *v_balloon,
index 5b919303a6cb4a68634546de95ff29024877b338..309894c338c6b097f66c269b051733413f85142f 100644 (file)
@@ -19,9 +19,9 @@
 #ifndef TESTS_LIBQOS_VIRTIO_BALLOON_H
 #define TESTS_LIBQOS_VIRTIO_BALLOON_H
 
-#include "libqos/qgraph.h"
-#include "libqos/virtio.h"
-#include "libqos/virtio-pci.h"
+#include "qgraph.h"
+#include "virtio.h"
+#include "virtio-pci.h"
 
 typedef struct QVirtioBalloon QVirtioBalloon;
 typedef struct QVirtioBalloonPCI QVirtioBalloonPCI;
index 5fc69401be218d7f94b34a32e5d4caeddfb110b2..5da02591bcc2c2889b195242231dd4c2dae38da3 100644 (file)
@@ -20,8 +20,8 @@
 #include "libqtest.h"
 #include "qemu/module.h"
 #include "standard-headers/linux/virtio_blk.h"
-#include "libqos/qgraph.h"
-#include "libqos/virtio-blk.h"
+#include "qgraph.h"
+#include "virtio-blk.h"
 
 #define PCI_SLOT                0x04
 #define PCI_FN                  0x00
index 5170f13cfecf23587f0d3a4282d5739dfb2e9cd7..dcef38851ea141f65c3ca43512268cab7c95ab2d 100644 (file)
@@ -19,9 +19,9 @@
 #ifndef TESTS_LIBQOS_VIRTIO_BLK_H
 #define TESTS_LIBQOS_VIRTIO_BLK_H
 
-#include "libqos/qgraph.h"
-#include "libqos/virtio.h"
-#include "libqos/virtio-pci.h"
+#include "qgraph.h"
+#include "virtio.h"
+#include "virtio-pci.h"
 
 typedef struct QVirtioBlk QVirtioBlk;
 typedef struct QVirtioBlkPCI QVirtioBlkPCI;
index e0a2bd7bc631609eab1cd79e419d85809fa95328..75efda30299aab163ad30c162eb6009406cda192 100644 (file)
 #include "qemu/osdep.h"
 #include "libqtest.h"
 #include "qemu/module.h"
-#include "libqos/virtio.h"
-#include "libqos/virtio-mmio.h"
-#include "libqos/malloc.h"
-#include "libqos/qgraph.h"
+#include "virtio.h"
+#include "virtio-mmio.h"
+#include "malloc.h"
+#include "qgraph.h"
 #include "standard-headers/linux/virtio_ring.h"
 
 static uint8_t qvirtio_mmio_config_readb(QVirtioDevice *d, uint64_t off)
index 0e45778b07def98adf3998b5bbba3c4d12d0627d..30803bc91cec5427f8006f42ad6977fb927efa79 100644 (file)
@@ -10,8 +10,8 @@
 #ifndef LIBQOS_VIRTIO_MMIO_H
 #define LIBQOS_VIRTIO_MMIO_H
 
-#include "libqos/virtio.h"
-#include "libqos/qgraph.h"
+#include "virtio.h"
+#include "qgraph.h"
 
 #define QVIRTIO_MMIO_MAGIC_VALUE        0x000
 #define QVIRTIO_MMIO_VERSION            0x004
index a9e253afe4903a688367d8346ed87c1ea8aa12d3..1cae07f60d6cb588cbebb94c73d8f6f9510a8b15 100644 (file)
@@ -19,8 +19,8 @@
 #include "qemu/osdep.h"
 #include "libqtest.h"
 #include "qemu/module.h"
-#include "libqos/qgraph.h"
-#include "libqos/virtio-net.h"
+#include "qgraph.h"
+#include "virtio-net.h"
 #include "hw/virtio/virtio-net.h"
 
 
index b8cbec04af6fbaca97909f9a085e7ba65d4f3be6..5ba2161de27adac77cd6f30f3a4893ad8d096a7a 100644 (file)
@@ -19,9 +19,9 @@
 #ifndef TESTS_LIBQOS_VIRTIO_NET_H
 #define TESTS_LIBQOS_VIRTIO_NET_H
 
-#include "libqos/qgraph.h"
-#include "libqos/virtio.h"
-#include "libqos/virtio-pci.h"
+#include "qgraph.h"
+#include "virtio.h"
+#include "virtio-pci.h"
 
 typedef struct QVirtioNet QVirtioNet;
 typedef struct QVirtioNetPCI QVirtioNetPCI;
index 62851c29bb2a5b1a1f0775025f18e1fb7f2164f7..cd3c0f5bf33518ddb9dba995a9a8ada58f98001e 100644 (file)
@@ -9,13 +9,13 @@
 
 #include "qemu/osdep.h"
 #include "libqtest.h"
-#include "libqos/virtio.h"
-#include "libqos/virtio-pci.h"
-#include "libqos/pci.h"
-#include "libqos/pci-pc.h"
-#include "libqos/malloc.h"
-#include "libqos/malloc-pc.h"
-#include "libqos/qgraph.h"
+#include "virtio.h"
+#include "virtio-pci.h"
+#include "pci.h"
+#include "pci-pc.h"
+#include "malloc.h"
+#include "malloc-pc.h"
+#include "qgraph.h"
 #include "standard-headers/linux/virtio_ring.h"
 #include "standard-headers/linux/virtio_pci.h"
 
index 294d5567eebccecbf9a3b7de30376016e39ef070..f5115cacba2b94a6e0b8d5e14cc1d34239edf07a 100644 (file)
@@ -10,9 +10,9 @@
 #ifndef LIBQOS_VIRTIO_PCI_H
 #define LIBQOS_VIRTIO_PCI_H
 
-#include "libqos/virtio.h"
-#include "libqos/pci.h"
-#include "libqos/qgraph.h"
+#include "virtio.h"
+#include "pci.h"
+#include "qgraph.h"
 
 typedef struct QVirtioPCIMSIXOps QVirtioPCIMSIXOps;
 
index 46f8d95b1febb4581ecccaafcc3137c6a3f0265b..2e09dd7c48cb2669ab1df06df26d37acc5b185b4 100644 (file)
@@ -19,8 +19,8 @@
 #include "qemu/osdep.h"
 #include "libqtest.h"
 #include "qemu/module.h"
-#include "libqos/qgraph.h"
-#include "libqos/virtio-rng.h"
+#include "qgraph.h"
+#include "virtio-rng.h"
 
 /* virtio-rng-device */
 static void *qvirtio_rng_get_driver(QVirtioRng *v_rng,
index 9342372efa9df6aacda37dc5abd3d297ad349a70..9ca102b59938ebb56d752f4a93916f7dc9a7d045 100644 (file)
@@ -19,9 +19,9 @@
 #ifndef TESTS_LIBQOS_VIRTIO_RNG_H
 #define TESTS_LIBQOS_VIRTIO_RNG_H
 
-#include "libqos/qgraph.h"
-#include "libqos/virtio.h"
-#include "libqos/virtio-pci.h"
+#include "qgraph.h"
+#include "virtio.h"
+#include "virtio-pci.h"
 
 typedef struct QVirtioRng QVirtioRng;
 typedef struct QVirtioRngPCI QVirtioRngPCI;
index c8c35984282568e0756a6e0b59f8b5ebebca834a..5644e32fc3194df341f6c11bfe0a865be38c6214 100644 (file)
@@ -20,8 +20,8 @@
 #include "libqtest.h"
 #include "qemu/module.h"
 #include "standard-headers/linux/virtio_ids.h"
-#include "libqos/qgraph.h"
-#include "libqos/virtio-scsi.h"
+#include "qgraph.h"
+#include "virtio-scsi.h"
 
 /* virtio-scsi-device */
 static void *qvirtio_scsi_get_driver(QVirtioSCSI *v_scsi,
index 9e3774d99a84de446bf0660e778fff578ab9efe5..531315e6ad466ae64da6ee685c7dbba00677c2e5 100644 (file)
@@ -19,9 +19,9 @@
 #ifndef TESTS_LIBQOS_VIRTIO_SCSI_H
 #define TESTS_LIBQOS_VIRTIO_SCSI_H
 
-#include "libqos/qgraph.h"
-#include "libqos/virtio.h"
-#include "libqos/virtio-pci.h"
+#include "qgraph.h"
+#include "virtio.h"
+#include "virtio-pci.h"
 
 typedef struct QVirtioSCSI QVirtioSCSI;
 typedef struct QVirtioSCSIPCI QVirtioSCSIPCI;
index b95654085d2b8344640059df7e158ecf5be6835d..ee34afd95ad8078217443ee3526e8500e95b3992 100644 (file)
@@ -19,8 +19,8 @@
 #include "qemu/osdep.h"
 #include "libqtest.h"
 #include "qemu/module.h"
-#include "libqos/qgraph.h"
-#include "libqos/virtio-serial.h"
+#include "qgraph.h"
+#include "virtio-serial.h"
 
 static void *qvirtio_serial_get_driver(QVirtioSerial *v_serial,
                                        const char *interface)
index 3328c6cf191a8b4eeec7ba690680ea613c5a5f0e..3db43b2bb8807433d5563a57edc98881ee9a9d62 100644 (file)
@@ -19,9 +19,9 @@
 #ifndef TESTS_LIBQOS_VIRTIO_SERIAL_H
 #define TESTS_LIBQOS_VIRTIO_SERIAL_H
 
-#include "libqos/qgraph.h"
-#include "libqos/virtio.h"
-#include "libqos/virtio-pci.h"
+#include "qgraph.h"
+#include "virtio.h"
+#include "virtio-pci.h"
 
 typedef struct QVirtioSerial QVirtioSerial;
 typedef struct QVirtioSerialPCI QVirtioSerialPCI;
index 9aa360620c19b413a35b55ee1ad23ee8184ef1ca..6fe7bf9555fca71326ec3b9b3707e71ad36e8c67 100644 (file)
@@ -10,7 +10,7 @@
 #include "qemu/osdep.h"
 #include "qemu/bswap.h"
 #include "libqtest.h"
-#include "libqos/virtio.h"
+#include "virtio.h"
 #include "standard-headers/linux/virtio_config.h"
 #include "standard-headers/linux/virtio_ring.h"
 
index 529ef7555a224603427ede985c0f7fdd5499419e..b8bd06e1b85118dfc83472fb389139aa414e3b2a 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef LIBQOS_VIRTIO_H
 #define LIBQOS_VIRTIO_H
 
-#include "libqos/malloc.h"
+#include "malloc.h"
 #include "standard-headers/linux/virtio_ring.h"
 
 #define QVIRTIO_F_BAD_FEATURE           0x40000000ull
index 0edb1c91446da2a38c61e28242cdb6d6302e4873..ad96742a92d6f0f8fe804fd2ef9f118508cabbde 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "qemu/osdep.h"
 #include "libqtest.h"
-#include "libqos/qgraph.h"
+#include "qgraph.h"
 #include "pci-pc.h"
 #include "qemu/module.h"
 #include "malloc-pc.h"
index 6f1bb1331c5217763d5d49e5d707103ea2fc3b39..176979a2ce9b6869cf1a760f092063c171c99e83 100644 (file)
@@ -11,7 +11,7 @@
 #ifndef LIBQTEST_SINGLE_H
 #define LIBQTEST_SINGLE_H
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 
 QTestState *global_qtest __attribute__((common, weak));
 
index fd4680590dbc98882da843d9badded37aaf86cab..26f1223642eb0d3e28ae06c5c5dd39540af2e833 100644 (file)
@@ -20,7 +20,7 @@
 #include <sys/wait.h>
 #include <sys/un.h>
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu-common.h"
 #include "qemu/ctype.h"
 #include "qemu/cutils.h"
diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqtest.h
deleted file mode 100644 (file)
index f5cf93c..0000000
+++ /dev/null
@@ -1,736 +0,0 @@
-/*
- * QTest
- *
- * Copyright IBM, Corp. 2012
- * Copyright Red Hat, Inc. 2012
- * Copyright SUSE LINUX Products GmbH 2013
- *
- * Authors:
- *  Anthony Liguori   <aliguori@us.ibm.com>
- *  Paolo Bonzini     <pbonzini@redhat.com>
- *  Andreas Färber    <afaerber@suse.de>
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- *
- */
-#ifndef LIBQTEST_H
-#define LIBQTEST_H
-
-#include "qapi/qmp/qobject.h"
-#include "qapi/qmp/qdict.h"
-
-typedef struct QTestState QTestState;
-
-/**
- * qtest_initf:
- * @fmt...: Format for creating other arguments to pass to QEMU, formatted
- * like sprintf().
- *
- * Convenience wrapper around qtest_init().
- *
- * Returns: #QTestState instance.
- */
-QTestState *qtest_initf(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
-
-/**
- * qtest_vinitf:
- * @fmt: Format for creating other arguments to pass to QEMU, formatted
- * like vsprintf().
- * @ap: Format arguments.
- *
- * Convenience wrapper around qtest_init().
- *
- * Returns: #QTestState instance.
- */
-QTestState *qtest_vinitf(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0);
-
-/**
- * qtest_init:
- * @extra_args: other arguments to pass to QEMU.  CAUTION: these
- * arguments are subject to word splitting and shell evaluation.
- *
- * Returns: #QTestState instance.
- */
-QTestState *qtest_init(const char *extra_args);
-
-/**
- * qtest_init_without_qmp_handshake:
- * @extra_args: other arguments to pass to QEMU.  CAUTION: these
- * arguments are subject to word splitting and shell evaluation.
- *
- * Returns: #QTestState instance.
- */
-QTestState *qtest_init_without_qmp_handshake(const char *extra_args);
-
-/**
- * qtest_init_with_serial:
- * @extra_args: other arguments to pass to QEMU.  CAUTION: these
- * arguments are subject to word splitting and shell evaluation.
- * @sock_fd: pointer to store the socket file descriptor for
- * connection with serial.
- *
- * Returns: #QTestState instance.
- */
-QTestState *qtest_init_with_serial(const char *extra_args, int *sock_fd);
-
-/**
- * qtest_quit:
- * @s: #QTestState instance to operate on.
- *
- * Shut down the QEMU process associated to @s.
- */
-void qtest_quit(QTestState *s);
-
-/**
- * qtest_qmp_fds:
- * @s: #QTestState instance to operate on.
- * @fds: array of file descriptors
- * @fds_num: number of elements in @fds
- * @fmt...: QMP message to send to qemu, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
- * supported after '%'.
- *
- * Sends a QMP message to QEMU with fds and returns the response.
- */
-QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num,
-                     const char *fmt, ...)
-    GCC_FMT_ATTR(4, 5);
-
-/**
- * qtest_qmp:
- * @s: #QTestState instance to operate on.
- * @fmt...: QMP message to send to qemu, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
- * supported after '%'.
- *
- * Sends a QMP message to QEMU and returns the response.
- */
-QDict *qtest_qmp(QTestState *s, const char *fmt, ...)
-    GCC_FMT_ATTR(2, 3);
-
-/**
- * qtest_qmp_send:
- * @s: #QTestState instance to operate on.
- * @fmt...: QMP message to send to qemu, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
- * supported after '%'.
- *
- * Sends a QMP message to QEMU and leaves the response in the stream.
- */
-void qtest_qmp_send(QTestState *s, const char *fmt, ...)
-    GCC_FMT_ATTR(2, 3);
-
-/**
- * qtest_qmp_send_raw:
- * @s: #QTestState instance to operate on.
- * @fmt...: text to send, formatted like sprintf()
- *
- * Sends text to the QMP monitor verbatim.  Need not be valid JSON;
- * this is useful for negative tests.
- */
-void qtest_qmp_send_raw(QTestState *s, const char *fmt, ...)
-    GCC_FMT_ATTR(2, 3);
-
-/**
- * qtest_vqmp_fds:
- * @s: #QTestState instance to operate on.
- * @fds: array of file descriptors
- * @fds_num: number of elements in @fds
- * @fmt: QMP message to send to QEMU, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
- * supported after '%'.
- * @ap: QMP message arguments
- *
- * Sends a QMP message to QEMU with fds and returns the response.
- */
-QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num,
-                      const char *fmt, va_list ap)
-    GCC_FMT_ATTR(4, 0);
-
-/**
- * qtest_vqmp:
- * @s: #QTestState instance to operate on.
- * @fmt: QMP message to send to QEMU, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
- * supported after '%'.
- * @ap: QMP message arguments
- *
- * Sends a QMP message to QEMU and returns the response.
- */
-QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap)
-    GCC_FMT_ATTR(2, 0);
-
-/**
- * qtest_qmp_vsend_fds:
- * @s: #QTestState instance to operate on.
- * @fds: array of file descriptors
- * @fds_num: number of elements in @fds
- * @fmt: QMP message to send to QEMU, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
- * supported after '%'.
- * @ap: QMP message arguments
- *
- * Sends a QMP message to QEMU and leaves the response in the stream.
- */
-void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num,
-                         const char *fmt, va_list ap)
-    GCC_FMT_ATTR(4, 0);
-
-/**
- * qtest_qmp_vsend:
- * @s: #QTestState instance to operate on.
- * @fmt: QMP message to send to QEMU, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
- * supported after '%'.
- * @ap: QMP message arguments
- *
- * Sends a QMP message to QEMU and leaves the response in the stream.
- */
-void qtest_qmp_vsend(QTestState *s, const char *fmt, va_list ap)
-    GCC_FMT_ATTR(2, 0);
-
-/**
- * qtest_receive:
- * @s: #QTestState instance to operate on.
- *
- * Reads a QMP message from QEMU and returns the response.
- */
-QDict *qtest_qmp_receive(QTestState *s);
-
-/**
- * qtest_qmp_eventwait:
- * @s: #QTestState instance to operate on.
- * @s: #event event to wait for.
- *
- * Continuously polls for QMP responses until it receives the desired event.
- */
-void qtest_qmp_eventwait(QTestState *s, const char *event);
-
-/**
- * qtest_qmp_eventwait_ref:
- * @s: #QTestState instance to operate on.
- * @s: #event event to wait for.
- *
- * Continuously polls for QMP responses until it receives the desired event.
- * Returns a copy of the event for further investigation.
- */
-QDict *qtest_qmp_eventwait_ref(QTestState *s, const char *event);
-
-/**
- * qtest_qmp_receive_success:
- * @s: #QTestState instance to operate on
- * @event_cb: Event callback
- * @opaque: Argument for @event_cb
- *
- * Poll QMP messages until a command success response is received.
- * If @event_cb, call it for each event received, passing @opaque,
- * the event's name and data.
- * Return the success response's "return" member.
- */
-QDict *qtest_qmp_receive_success(QTestState *s,
-                                 void (*event_cb)(void *opaque,
-                                                  const char *name,
-                                                  QDict *data),
-                                 void *opaque);
-
-/**
- * qtest_hmp:
- * @s: #QTestState instance to operate on.
- * @fmt...: HMP command to send to QEMU, formats arguments like sprintf().
- *
- * Send HMP command to QEMU via QMP's human-monitor-command.
- * QMP events are discarded.
- *
- * Returns: the command's output.  The caller should g_free() it.
- */
-char *qtest_hmp(QTestState *s, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
-
-/**
- * qtest_hmpv:
- * @s: #QTestState instance to operate on.
- * @fmt: HMP command to send to QEMU, formats arguments like vsprintf().
- * @ap: HMP command arguments
- *
- * Send HMP command to QEMU via QMP's human-monitor-command.
- * QMP events are discarded.
- *
- * Returns: the command's output.  The caller should g_free() it.
- */
-char *qtest_vhmp(QTestState *s, const char *fmt, va_list ap)
-    GCC_FMT_ATTR(2, 0);
-
-void qtest_module_load(QTestState *s, const char *prefix, const char *libname);
-
-/**
- * qtest_get_irq:
- * @s: #QTestState instance to operate on.
- * @num: Interrupt to observe.
- *
- * Returns: The level of the @num interrupt.
- */
-bool qtest_get_irq(QTestState *s, int num);
-
-/**
- * qtest_irq_intercept_in:
- * @s: #QTestState instance to operate on.
- * @string: QOM path of a device.
- *
- * Associate qtest irqs with the GPIO-in pins of the device
- * whose path is specified by @string.
- */
-void qtest_irq_intercept_in(QTestState *s, const char *string);
-
-/**
- * qtest_irq_intercept_out:
- * @s: #QTestState instance to operate on.
- * @string: QOM path of a device.
- *
- * Associate qtest irqs with the GPIO-out pins of the device
- * whose path is specified by @string.
- */
-void qtest_irq_intercept_out(QTestState *s, const char *string);
-
-/**
- * qtest_set_irq_in:
- * @s: QTestState instance to operate on.
- * @string: QOM path of a device
- * @name: IRQ name
- * @irq: IRQ number
- * @level: IRQ level
- *
- * Force given device/irq GPIO-in pin to the given level.
- */
-void qtest_set_irq_in(QTestState *s, const char *string, const char *name,
-                      int irq, int level);
-
-/**
- * qtest_outb:
- * @s: #QTestState instance to operate on.
- * @addr: I/O port to write to.
- * @value: Value being written.
- *
- * Write an 8-bit value to an I/O port.
- */
-void qtest_outb(QTestState *s, uint16_t addr, uint8_t value);
-
-/**
- * qtest_outw:
- * @s: #QTestState instance to operate on.
- * @addr: I/O port to write to.
- * @value: Value being written.
- *
- * Write a 16-bit value to an I/O port.
- */
-void qtest_outw(QTestState *s, uint16_t addr, uint16_t value);
-
-/**
- * qtest_outl:
- * @s: #QTestState instance to operate on.
- * @addr: I/O port to write to.
- * @value: Value being written.
- *
- * Write a 32-bit value to an I/O port.
- */
-void qtest_outl(QTestState *s, uint16_t addr, uint32_t value);
-
-/**
- * qtest_inb:
- * @s: #QTestState instance to operate on.
- * @addr: I/O port to read from.
- *
- * Returns an 8-bit value from an I/O port.
- */
-uint8_t qtest_inb(QTestState *s, uint16_t addr);
-
-/**
- * qtest_inw:
- * @s: #QTestState instance to operate on.
- * @addr: I/O port to read from.
- *
- * Returns a 16-bit value from an I/O port.
- */
-uint16_t qtest_inw(QTestState *s, uint16_t addr);
-
-/**
- * qtest_inl:
- * @s: #QTestState instance to operate on.
- * @addr: I/O port to read from.
- *
- * Returns a 32-bit value from an I/O port.
- */
-uint32_t qtest_inl(QTestState *s, uint16_t addr);
-
-/**
- * qtest_writeb:
- * @s: #QTestState instance to operate on.
- * @addr: Guest address to write to.
- * @value: Value being written.
- *
- * Writes an 8-bit value to memory.
- */
-void qtest_writeb(QTestState *s, uint64_t addr, uint8_t value);
-
-/**
- * qtest_writew:
- * @s: #QTestState instance to operate on.
- * @addr: Guest address to write to.
- * @value: Value being written.
- *
- * Writes a 16-bit value to memory.
- */
-void qtest_writew(QTestState *s, uint64_t addr, uint16_t value);
-
-/**
- * qtest_writel:
- * @s: #QTestState instance to operate on.
- * @addr: Guest address to write to.
- * @value: Value being written.
- *
- * Writes a 32-bit value to memory.
- */
-void qtest_writel(QTestState *s, uint64_t addr, uint32_t value);
-
-/**
- * qtest_writeq:
- * @s: #QTestState instance to operate on.
- * @addr: Guest address to write to.
- * @value: Value being written.
- *
- * Writes a 64-bit value to memory.
- */
-void qtest_writeq(QTestState *s, uint64_t addr, uint64_t value);
-
-/**
- * qtest_readb:
- * @s: #QTestState instance to operate on.
- * @addr: Guest address to read from.
- *
- * Reads an 8-bit value from memory.
- *
- * Returns: Value read.
- */
-uint8_t qtest_readb(QTestState *s, uint64_t addr);
-
-/**
- * qtest_readw:
- * @s: #QTestState instance to operate on.
- * @addr: Guest address to read from.
- *
- * Reads a 16-bit value from memory.
- *
- * Returns: Value read.
- */
-uint16_t qtest_readw(QTestState *s, uint64_t addr);
-
-/**
- * qtest_readl:
- * @s: #QTestState instance to operate on.
- * @addr: Guest address to read from.
- *
- * Reads a 32-bit value from memory.
- *
- * Returns: Value read.
- */
-uint32_t qtest_readl(QTestState *s, uint64_t addr);
-
-/**
- * qtest_readq:
- * @s: #QTestState instance to operate on.
- * @addr: Guest address to read from.
- *
- * Reads a 64-bit value from memory.
- *
- * Returns: Value read.
- */
-uint64_t qtest_readq(QTestState *s, uint64_t addr);
-
-/**
- * qtest_memread:
- * @s: #QTestState instance to operate on.
- * @addr: Guest address to read from.
- * @data: Pointer to where memory contents will be stored.
- * @size: Number of bytes to read.
- *
- * Read guest memory into a buffer.
- */
-void qtest_memread(QTestState *s, uint64_t addr, void *data, size_t size);
-
-/**
- * qtest_rtas_call:
- * @s: #QTestState instance to operate on.
- * @name: name of the command to call.
- * @nargs: Number of args.
- * @args: Guest address to read args from.
- * @nret: Number of return value.
- * @ret: Guest address to write return values to.
- *
- * Call an RTAS function
- */
-uint64_t qtest_rtas_call(QTestState *s, const char *name,
-                         uint32_t nargs, uint64_t args,
-                         uint32_t nret, uint64_t ret);
-
-/**
- * qtest_bufread:
- * @s: #QTestState instance to operate on.
- * @addr: Guest address to read from.
- * @data: Pointer to where memory contents will be stored.
- * @size: Number of bytes to read.
- *
- * Read guest memory into a buffer and receive using a base64 encoding.
- */
-void qtest_bufread(QTestState *s, uint64_t addr, void *data, size_t size);
-
-/**
- * qtest_memwrite:
- * @s: #QTestState instance to operate on.
- * @addr: Guest address to write to.
- * @data: Pointer to the bytes that will be written to guest memory.
- * @size: Number of bytes to write.
- *
- * Write a buffer to guest memory.
- */
-void qtest_memwrite(QTestState *s, uint64_t addr, const void *data, size_t size);
-
-/**
- * qtest_bufwrite:
- * @s: #QTestState instance to operate on.
- * @addr: Guest address to write to.
- * @data: Pointer to the bytes that will be written to guest memory.
- * @size: Number of bytes to write.
- *
- * Write a buffer to guest memory and transmit using a base64 encoding.
- */
-void qtest_bufwrite(QTestState *s, uint64_t addr,
-                    const void *data, size_t size);
-
-/**
- * qtest_memset:
- * @s: #QTestState instance to operate on.
- * @addr: Guest address to write to.
- * @patt: Byte pattern to fill the guest memory region with.
- * @size: Number of bytes to write.
- *
- * Write a pattern to guest memory.
- */
-void qtest_memset(QTestState *s, uint64_t addr, uint8_t patt, size_t size);
-
-/**
- * qtest_clock_step_next:
- * @s: #QTestState instance to operate on.
- *
- * Advance the QEMU_CLOCK_VIRTUAL to the next deadline.
- *
- * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
- */
-int64_t qtest_clock_step_next(QTestState *s);
-
-/**
- * qtest_clock_step:
- * @s: QTestState instance to operate on.
- * @step: Number of nanoseconds to advance the clock by.
- *
- * Advance the QEMU_CLOCK_VIRTUAL by @step nanoseconds.
- *
- * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
- */
-int64_t qtest_clock_step(QTestState *s, int64_t step);
-
-/**
- * qtest_clock_set:
- * @s: QTestState instance to operate on.
- * @val: Nanoseconds value to advance the clock to.
- *
- * Advance the QEMU_CLOCK_VIRTUAL to @val nanoseconds since the VM was launched.
- *
- * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
- */
-int64_t qtest_clock_set(QTestState *s, int64_t val);
-
-/**
- * qtest_big_endian:
- * @s: QTestState instance to operate on.
- *
- * Returns: True if the architecture under test has a big endian configuration.
- */
-bool qtest_big_endian(QTestState *s);
-
-/**
- * qtest_get_arch:
- *
- * Returns: The architecture for the QEMU executable under test.
- */
-const char *qtest_get_arch(void);
-
-/**
- * qtest_add_func:
- * @str: Test case path.
- * @fn: Test case function
- *
- * Add a GTester testcase with the given name and function.
- * The path is prefixed with the architecture under test, as
- * returned by qtest_get_arch().
- */
-void qtest_add_func(const char *str, void (*fn)(void));
-
-/**
- * qtest_add_data_func:
- * @str: Test case path.
- * @data: Test case data
- * @fn: Test case function
- *
- * Add a GTester testcase with the given name, data and function.
- * The path is prefixed with the architecture under test, as
- * returned by qtest_get_arch().
- */
-void qtest_add_data_func(const char *str, const void *data,
-                         void (*fn)(const void *));
-
-/**
- * qtest_add_data_func_full:
- * @str: Test case path.
- * @data: Test case data
- * @fn: Test case function
- * @data_free_func: GDestroyNotify for data
- *
- * Add a GTester testcase with the given name, data and function.
- * The path is prefixed with the architecture under test, as
- * returned by qtest_get_arch().
- *
- * @data is passed to @data_free_func() on test completion.
- */
-void qtest_add_data_func_full(const char *str, void *data,
-                              void (*fn)(const void *),
-                              GDestroyNotify data_free_func);
-
-/**
- * qtest_add:
- * @testpath: Test case path
- * @Fixture: Fixture type
- * @tdata: Test case data
- * @fsetup: Test case setup function
- * @ftest: Test case function
- * @fteardown: Test case teardown function
- *
- * Add a GTester testcase with the given name, data and functions.
- * The path is prefixed with the architecture under test, as
- * returned by qtest_get_arch().
- */
-#define qtest_add(testpath, Fixture, tdata, fsetup, ftest, fteardown) \
-    do { \
-        char *path = g_strdup_printf("/%s/%s", qtest_get_arch(), testpath); \
-        g_test_add(path, Fixture, tdata, fsetup, ftest, fteardown); \
-        g_free(path); \
-    } while (0)
-
-void qtest_add_abrt_handler(GHookFunc fn, const void *data);
-
-/**
- * qtest_qmp_assert_success:
- * @qts: QTestState instance to operate on
- * @fmt...: QMP message to send to qemu, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
- * supported after '%'.
- *
- * Sends a QMP message to QEMU and asserts that a 'return' key is present in
- * the response.
- */
-void qtest_qmp_assert_success(QTestState *qts, const char *fmt, ...)
-    GCC_FMT_ATTR(2, 3);
-
-QDict *qmp_fd_receive(int fd);
-void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num,
-                      const char *fmt, va_list ap) GCC_FMT_ATTR(4, 0);
-void qmp_fd_vsend(int fd, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0);
-void qmp_fd_send(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
-void qmp_fd_send_raw(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
-void qmp_fd_vsend_raw(int fd, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0);
-QDict *qmp_fdv(int fd, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0);
-QDict *qmp_fd(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
-
-/**
- * qtest_cb_for_every_machine:
- * @cb: Pointer to the callback function
- * @skip_old_versioned: true if versioned old machine types should be skipped
- *
- *  Call a callback function for every name of all available machines.
- */
-void qtest_cb_for_every_machine(void (*cb)(const char *machine),
-                                bool skip_old_versioned);
-
-/**
- * qtest_qmp_device_add_qdict:
- * @qts: QTestState instance to operate on
- * @drv: Name of the device that should be added
- * @arguments: QDict with properties for the device to intialize
- *
- * Generic hot-plugging test via the device_add QMP command with properties
- * supplied in form of QDict. Use NULL for empty properties list.
- */
-void qtest_qmp_device_add_qdict(QTestState *qts, const char *drv,
-                                const QDict *arguments);
-
-/**
- * qtest_qmp_device_add:
- * @qts: QTestState instance to operate on
- * @driver: Name of the device that should be added
- * @id: Identification string
- * @fmt...: QMP message to send to qemu, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
- * supported after '%'.
- *
- * Generic hot-plugging test via the device_add QMP command.
- */
-void qtest_qmp_device_add(QTestState *qts, const char *driver, const char *id,
-                          const char *fmt, ...) GCC_FMT_ATTR(4, 5);
-
-/**
- * qtest_qmp_device_del:
- * @qts: QTestState instance to operate on
- * @id: Identification string
- *
- * Generic hot-unplugging test via the device_del QMP command.
- */
-void qtest_qmp_device_del(QTestState *qts, const char *id);
-
-/**
- * qmp_rsp_is_err:
- * @rsp: QMP response to check for error
- *
- * Test @rsp for error and discard @rsp.
- * Returns 'true' if there is error in @rsp and 'false' otherwise.
- */
-bool qmp_rsp_is_err(QDict *rsp);
-
-/**
- * qmp_assert_error_class:
- * @rsp: QMP response to check for error
- * @class: an error class
- *
- * Assert the response has the given error class and discard @rsp.
- */
-void qmp_assert_error_class(QDict *rsp, const char *class);
-
-/**
- * qtest_probe_child:
- * @s: QTestState instance to operate on.
- *
- * Returns: true if the child is still alive.
- */
-bool qtest_probe_child(QTestState *s);
-
-/**
- * qtest_set_expected_status:
- * @s: QTestState instance to operate on.
- * @status: an expected exit status.
- *
- * Set expected exit status of the child.
- */
-void qtest_set_expected_status(QTestState *s, int status);
-
-QTestState *qtest_inproc_init(QTestState **s, bool log, const char* arch,
-                    void (*send)(void*, const char*));
-
-void qtest_client_inproc_recv(void *opaque, const char *str);
-#endif
index b94a1230f7fdf742102597f402e2ea894689320b..6db3234100a3b8a074b6b3667af453179f95fde0 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "qemu/osdep.h"
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 
 #define RTC_SECONDS             0x9
 #define RTC_MINUTES             0xa
index 57107f1aec8a8396f1ae0b3a770f5cf8ed66aca1..aab06b9fc2392e36f6031be86e3ca8dca6dd99b4 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "qemu-common.h"
 #include "qemu/cutils.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qapi/qmp/qdict.h"
 
 
index d6796b9bd74df3a14ee539b26d0f02183c616113..eae70ff95f9c3942a784c165895aca9d6fe80d17 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/bswap.h"
 #include "qemu/module.h"
 #include "libqos/qgraph.h"
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
new file mode 100644 (file)
index 0000000..30cb88d
--- /dev/null
@@ -0,0 +1,257 @@
+# All QTests for now are POSIX-only, but the dependencies are
+# really in libqtest, not in the testcases themselves.
+if not config_host.has_key('CONFIG_POSIX')
+  subdir_done()
+endif
+
+qtests_generic = [
+  'cdrom-test',
+  'device-introspect-test',
+  'machine-none-test',
+  'qmp-test',
+  'qmp-cmd-test',
+  'qom-test',
+  'test-hmp',
+  'qos-test',
+]
+if config_host.has_key('CONFIG_MODULES')
+  qtests_generic += [ 'modules-test' ]
+endif
+
+qtests_pci = \
+  (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) +                  \
+  (config_all_devices.has_key('CONFIG_IVSHMEM_DEVICE') ? ['ivshmem-test'] : [])
+
+qtests_i386 = \
+  (config_host.has_key('CONFIG_SLIRP') ? ['pxe-test', 'test-netfilter'] : []) +             \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +                     \
+  (have_tools ? ['ahci-test'] : []) +                                                       \
+  (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +           \
+  (config_all_devices.has_key('CONFIG_SGA') ? ['boot-serial-test'] : []) +                  \
+  (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['test-filter-redirector'] : []) +    \
+  (config_all_devices.has_key('CONFIG_ISA_IPMI_KCS') ? ['ipmi-kcs-test'] : []) +            \
+  (config_host.has_key('CONFIG_LINUX') and                                                  \
+   config_all_devices.has_key('CONFIG_ISA_IPMI_BT') ? ['ipmi-bt-test'] : []) +              \
+  (config_all_devices.has_key('CONFIG_WDT_IB700') ? ['wdt_ib700-test'] : []) +              \
+  (config_all_devices.has_key('CONFIG_PVPANIC') ? ['pvpanic-test'] : []) +                  \
+  (config_all_devices.has_key('CONFIG_HDA') ? ['intel-hda-test'] : []) +                    \
+  (config_all_devices.has_key('CONFIG_I82801B11') ? ['i82801b11-test'] : []) +             \
+  (config_all_devices.has_key('CONFIG_IOH3420') ? ['ioh3420-test'] : []) +                  \
+  (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) +            \
+  (config_all_devices.has_key('CONFIG_USB_UHCI') and                                        \
+   config_all_devices.has_key('CONFIG_USB_EHCI') ? ['usb-hcd-ehci-test'] : []) +            \
+  (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) +        \
+  (config_all_devices.has_key('CONFIG_TPM_CRB') ? ['tpm-crb-test'] : []) +                  \
+  (config_all_devices.has_key('CONFIG_TPM_CRB') ? ['tpm-crb-swtpm-test'] : []) +            \
+  (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-test'] : []) +              \
+  (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-swtpm-test'] : []) +        \
+  (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) +              \
+  qtests_pci +                                                                              \
+  ['fdc-test',
+   'ide-test',
+   'ahci-test',
+   'hd-geo-test',
+   'boot-order-test',
+   'bios-tables-test',
+   'rtc-test',
+   'i440fx-test',
+   'fw_cfg-test',
+   'device-plug-test',
+   'drive_del-test',
+   'tco-test',
+   'cpu-plug-test',
+   'q35-test',
+   'vmgenid-test',
+   'migration-test',
+   'test-x86-cpuid-compat',
+   'numa-test']
+
+dbus_daemon = find_program('dbus-daemon', required: false)
+if dbus_daemon.found() and config_host.has_key('GDBUS_CODEGEN')
+  # Temporarily disabled due to Patchew failures:
+  #qtests_i386 += ['dbus-vmstate-test']
+  dbus_vmstate1 = custom_target('dbus-vmstate description',
+                                output: ['dbus-vmstate1.h', 'dbus-vmstate1.c'],
+                                input: files('dbus-vmstate1.xml'),
+                                command: [config_host['GDBUS_CODEGEN'],
+                                          '@INPUT@',
+                                          '--interface-prefix', 'org.qemu',
+                                          '--generate-c-code', '@BASENAME@']).to_list()
+else
+  dbus_vmstate1 = []
+endif
+
+qtests_x86_64 = qtests_i386
+
+qtests_alpha = [ 'boot-serial-test' ] +                                                      \
+  (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
+
+qtests_avr = [ 'boot-serial-test' ]
+
+qtests_hppa = [ 'boot-serial-test' ] +                                                       \
+  (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
+
+qtests_m68k = [ 'boot-serial-test' ]
+qtests_microblaze = [ 'boot-serial-test' ]
+qtests_microblazeel = qtests_microblaze
+
+qtests_mips = \
+  (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
+  (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
+
+qtests_mips64 = \
+  (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
+  (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
+
+qtests_mips64el = \
+  (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
+  (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
+
+qtests_moxie = [ 'boot-serial-test' ]
+
+qtests_ppc = \
+  (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
+  (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) +                     \
+  ['boot-order-test', 'prom-env-test', 'drive_del-test', 'boot-serial-test']                 \
+
+qtests_ppc64 = \
+  (config_all_devices.has_key('CONFIG_PSERIES') ? ['device-plug-test'] : []) +               \
+  (config_all_devices.has_key('CONFIG_POWERNV') ? ['pnv-xscom-test'] : []) +                 \
+  (config_all_devices.has_key('CONFIG_PSERIES') ? ['rtas-test'] : []) +                      \
+  (config_host.has_key('CONFIG_SLIRP') ? ['pxe-test', 'test-netfilter'] : []) +              \
+  (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) +             \
+  (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) +         \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +                      \
+  qtests_pci + ['migration-test', 'numa-test', 'cpu-plug-test']
+
+qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
+qtests_sh4eb = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
+
+qtests_sparc = ['prom-env-test', 'm48t59-test', 'boot-serial-test']
+
+qtests_sparc64 = \
+  (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
+  ['prom-env-test', 'boot-serial-test']
+
+qtests_arm = \
+  (config_all_devices.has_key('CONFIG_PFLASH_CFI02') ? ['pflash-cfi02-test'] : []) +         \
+  ['arm-cpu-features',
+   'microbit-test',
+   'm25p80-test',
+   'test-arm-mptimer',
+   'boot-serial-test',
+   'hexloader-test']
+
+# TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional
+qtests_aarch64 = \
+  (cpu != 'arm' ? ['bios-tables-test'] : []) +                                                  \
+  (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-test'] : []) +        \
+  (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-swtpm-test'] : []) +  \
+  ['numa-test',
+   'boot-serial-test',
+   'migration-test']
+
+qtests_s390x = \
+  (config_host.has_key('CONFIG_SLIRP') ? ['pxe-test', 'test-netfilter'] : []) +                 \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +                         \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) +                     \
+  ['boot-serial-test',
+   'drive_del-test',
+   'device-plug-test',
+   'virtio-ccw-test',
+   'cpu-plug-test',
+   'migration-test']
+
+qos_test_ss = ss.source_set()
+qos_test_ss.add(
+  'ac97-test.c',
+  'ds1338-test.c',
+  'e1000-test.c',
+  'e1000e-test.c',
+  'eepro100-test.c',
+  'es1370-test.c',
+  'ipoctal232-test.c',
+  'megasas-test.c',
+  'ne2000-test.c',
+  'tulip-test.c',
+  'nvme-test.c',
+  'pca9552-test.c',
+  'pci-test.c',
+  'pcnet-test.c',
+  'sdhci-test.c',
+  'spapr-phb-test.c',
+  'tmp105-test.c',
+  'usb-hcd-ohci-test.c',
+  'virtio-test.c',
+  'virtio-blk-test.c',
+  'virtio-net-test.c',
+  'virtio-rng-test.c',
+  'virtio-scsi-test.c',
+  'virtio-serial-test.c',
+  'vmxnet3-test.c',
+)
+qos_test_ss.add(when: 'CONFIG_VIRTFS', if_true: files('virtio-9p-test.c'))
+qos_test_ss.add(when: 'CONFIG_VHOST_USER', if_true: files('vhost-user-test.c'))
+
+extra_qtest_deps = {
+  'bios-tables-test': [io],
+  'ivshmem-test': [rt],
+  'qos-test': [chardev, io],
+  'tpm-crb-swtpm-test': [io],
+  'tpm-crb-test': [io],
+  'tpm-tis-swtpm-test': [io],
+  'tpm-tis-test': [io],
+  'tpm-tis-device-swtpm-test': [io],
+  'tpm-tis-device-test': [io],
+}
+extra_qtest_srcs = {
+  'bios-tables-test': files('boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'),
+  'pxe-test': files('boot-sector.c'),
+  'cdrom-test': files('boot-sector.c'),
+  'migration-test': files('migration-helpers.c'),
+  'ivshmem-test': files('../../contrib/ivshmem-server/ivshmem-server.c'),
+  'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1,
+  'vmgenid-test': files('boot-sector.c', 'acpi-utils.c'),
+  'tpm-crb-swtpm-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tests.c'),
+  'tpm-crb-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tests.c'),
+  'tpm-tis-device-swtpm-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tis-util.c', 'tpm-tests.c'),
+  'tpm-tis-device-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tis-util.c', 'tpm-tests.c'),
+  'tpm-tis-swtpm-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tis-util.c', 'tpm-tests.c'),
+  'tpm-tis-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tis-util.c', 'tpm-tests.c'),
+  'qos-test': qos_test_ss.apply(config_host, strict: false).sources()
+}
+
+
+qtest_executables = {}
+foreach dir : target_dirs
+  if not dir.endswith('-softmmu')
+    continue
+  endif
+
+  target_base = dir.split('-')[0]
+  qtests = get_variable('qtests_' + target_base, []) + qtests_generic
+
+  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))
+  
+  foreach test : qtests
+    # Executables are shared across targets, declare them only the first time we
+    # encounter them
+    if not qtest_executables.has_key(test)
+      qtest_executables += {
+        test: executable(test,
+                         files(test + '.c') + extra_qtest_srcs.get(test, []),
+                         dependencies: [qemuutil, qos] + extra_qtest_deps.get(test, []))
+      }
+    endif
+    # FIXME: missing dependency on the emulator binary and qemu-img
+    test('qtest-@0@: @1@'.format(target_base, test),
+         qtest_executables[test],
+         env: qtest_env,
+         args: ['--tap', '-k'],
+         protocol: 'tap',
+         suite: ['qtest', 'qtest-' + target_base])
+  endforeach
+endforeach
index 04e199ec33f452e990802fba6d7d559bfb6c1aa6..2b255579dfddf203d8f3a8b2e0de0f773adc19e5 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "qemu/osdep.h"
 #include "exec/hwaddr.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 
 #include "hw/arm/nrf51.h"
 #include "hw/char/nrf51_uart.h"
index a11808b3b77c4901cc25904282d2946cd360fbc9..d63bba9630f9572fe4f33a4f606474d7ee63224c 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef MIGRATION_HELPERS_H_
 #define MIGRATION_HELPERS_H_
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 
 extern bool got_stop;
 
index 21ea5ba1d283caaaa4c729467ff5bfad920bfe13..00a233cd8c00911081969b02fdc8e7f4103a765b 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "qemu/osdep.h"
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qapi/error.h"
 #include "qapi/qmp/qdict.h"
 #include "qemu/module.h"
@@ -25,7 +25,7 @@
 #include "qapi/qobject-output-visitor.h"
 
 #include "migration-helpers.h"
-#include "migration/migration-test.h"
+#include "tests/migration/migration-test.h"
 
 /* TODO actually test the results and get rid of this */
 #define qtest_qmp_discard_response(...) qobject_unref(qtest_qmp(__VA_ARGS__))
index 88217686e14e3924833b3feff87e9b014484029e..c238b3f4221608762b584b33047e53b7a6597e20 100644 (file)
@@ -1,5 +1,5 @@
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 
 const char common_args[] = "-nodefaults -machine none";
 
index 3fc0e555d5e25de99ff5c9635c8c336ace19b398..43cfc4535aabe14833ce4a423006254eb8829719 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "libqos/qgraph.h"
 #include "libqos/pci.h"
index e1ed6d4322bafdbff03bb2721beae5ca62f051c4..b25ebf97d8c52339c74592b2e282d0d3f0e740d7 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qlist.h"
 
index ff0442150c5bee79847bbc9cf7fc428791999efd..d32c953a3824e429b7d78f761f30995afad7e06b 100644 (file)
@@ -10,7 +10,7 @@
 #include "qemu/osdep.h"
 #include "qemu/module.h"
 #include "qemu/units.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "libqos/qgraph.h"
 #include "libqos/pci.h"
 
index d80ed93cd3a519fdebe93f9af386fc11fea18007..42a131266512c77cff0440f86b192f965a1613ad 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "qemu/osdep.h"
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "libqos/qgraph.h"
 #include "libqos/i2c.h"
 #include "hw/misc/pca9552_regs.h"
index 4b2092b94973abcc3dd704ab5bdd55c1810eb9c4..e15d4d94d1d0c65b20981cd4c5fd350835ce5473 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "libqos/qgraph.h"
 #include "libqos/pci.h"
index 900944fa7e34c220418bca663240be5fde61b3ba..7583aeb3c38ff3758eaca23e4d72971dd9f2e5de 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "libqos/qgraph.h"
 #include "libqos/pci.h"
index 17aa669b2eadd8a21a5d2c2c090aa301e5d25b63..afb702b565c816cc8aa70c8c151bfdc580a23cc8 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 
 /*
  * To test the pflash_cfi02 device, we run QEMU with the musicpal machine with
index 2c46d5cf6de3c9e85e700d6e884ad8c6e01f769a..c8d40433620af77afaa9873282b539b2ff46e83a 100644 (file)
@@ -8,7 +8,7 @@
  */
 #include "qemu/osdep.h"
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 
 typedef enum PnvChipType {
     PNV_CHIP_POWER8E,     /* AKA Murano (default) */
index 60e6ec315335ce59890c54cb62343ee3ec87ad9c..f41d80154a5135799dcbddfff94c5ce54e65268c 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "libqos/libqos-spapr.h"
 
 #define MAGIC   0xcafec0de
index ff9176adf3ce2ddb60ce7a44b56be6f67520d96f..e57639481ebd017905830a8c673f330760f5aa12 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qapi/qmp/qdict.h"
 
 static void test_panic(void)
index 1161a773a4a77b429c8887dc913d731e4cf2cda9..32bbae33c5977c700402c6381a8c1d562c32b601 100644 (file)
@@ -15,7 +15,7 @@
 #include "qemu/osdep.h"
 #include <glib/gstdio.h>
 #include "qemu-common.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "boot-sector.h"
 #include "libqos/libqos-spapr.h"
 
index c922d81bc020739074c86e6c43a152d42d7ec91b..b7cf1449906f568bde04578d63cf29878b7a8e1b 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "libqos/pci.h"
 #include "libqos/pci-pc.h"
 #include "hw/pci-host/q35.h"
index f7b1aa7fdc4529652a7dd0886609ad52c43d5907..f34e68858a7ca9bc8add2ea980738c02f2ba567e 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qapi/error.h"
 #include "qapi/qapi-visit-introspect.h"
 #include "qapi/qmp/qdict.h"
index 1a8876b6cacd94d40b408aab1317b026f22fd5d3..5950c3ebbb525cc9e557aa0c11ce58434cc595e3 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qapi/error.h"
 #include "qapi/qapi-visit-control.h"
 #include "qapi/qmp/qdict.h"
index 1acf0d73697477dc3561f9558d32a3e415d368e9..eb34af843b794dbc028cfb9382ed9184f30fb1eb 100644 (file)
@@ -13,7 +13,7 @@
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qlist.h"
 #include "qemu/cutils.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 
 static void test_properties(QTestState *qts, const char *path, bool recurse)
 {
index 167b42db386dcc6212e8ec5f1f0f6ae9a995c517..a7e83e7d40acc4602fb55a1fa5db78e5f03a6e9e 100644 (file)
@@ -1,6 +1,6 @@
 #include "qemu/osdep.h"
 #include "qemu/cutils.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 
 #include "libqos/libqos-spapr.h"
 #include "libqos/rtas.h"
index 6275e7626c215638d7647bb2088f59b93a908c3c..a110cfe3219ce2b254218fcda89dbd9dadecdfe4 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/registerfields.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "libqos/pci-pc.h"
 #include "hw/pci/pci.h"
index 093dc22f2f41d707ffcdbe3af6a8c897669ea0b6..ea8d59650721533b23e3c8836079b2834be314bf 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "libqos/qgraph.h"
 
index 254f7353701c788727af9faedce3ad7697519c95..47bc7ad3019d00967ec12403624c1316241e6cdd 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "qemu/osdep.h"
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "libqos/pci.h"
 #include "libqos/pci-pc.h"
 #include "qapi/qmp/qdict.h"
index 1e3ced84a92847ed277f44e5fe5129c758e000c7..bc0dee64dd93b8f6191a61f477b054c653d9e343 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qapi/qmp/qdict.h"
 #include "qemu/iov.h"
 #include "qemu/sockets.h"
index e4d53220fd6498a524d80f9c4d9aeb2b263461da..829db8c2eaa199aa59779d495bc6cf5334ce9966 100644 (file)
@@ -52,7 +52,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qapi/qmp/qdict.h"
 #include "qemu/iov.h"
 #include "qemu/sockets.h"
index d5e7ebd17643bdeb5eb457a790296ca0ed0a77ae..aea1384bac956399d033b80251955066f2b98ed8 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 
 static int verbose;
 
index 55fdb5657d910ca3feaad9b5b762d2471778f6ba..1d82a48c04bec4ca7bb999d0b7f08f2dee425a7c 100644 (file)
@@ -15,7 +15,7 @@
 #include "qemu/osdep.h"
 #include <glib/gstdio.h>
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "tpm-tests.h"
 #include "hw/acpi/tpm.h"
index 7b200351426a38f3a187f09509d45cd1ded3d7fe..f7126eff9e742098697f0d3f66668fa3b0e06be0 100644 (file)
@@ -16,7 +16,7 @@
 #include "qemu/osdep.h"
 #include <glib/gstdio.h>
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "tpm-tests.h"
 #include "hw/acpi/tpm.h"
index 90131cb3c487515f1a3f1124c8b9785296e1a11e..fa590e68f1155da83c1efa7b355fa54091881f83 100644 (file)
@@ -15,7 +15,7 @@
 #include "qemu/osdep.h"
 #include <glib/gstdio.h>
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "tpm-tests.h"
 #include "hw/acpi/tpm.h"
index 58a95937455699a9e4b567fe250c83d4e7aa84d5..e2b29ef0f8c72010cba435a0dd86b4c0f67edf8d 100644 (file)
@@ -15,7 +15,7 @@
 #include "qemu/osdep.h"
 
 #include "hw/acpi/tpm.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "tpm-util.h"
 #include "qapi/qmp/qdict.h"
 
index 2fb6c4d5a781f444ac1eedeb15d35d48af4d5bbc..da16cbfafcc277ab9a7e46d9a4d1627ce7199076 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "libqos/qgraph.h"
 #include "libqos/pci.h"
index 092ba130684dfdc378265f17ba1d779aec75fa35..e6b8cd8e0cfa2ef8422cc7317fd99d295559ab4d 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "libqos/qgraph.h"
 #include "libqos/virtio-rng.h"
index f7c6afdcf11130a173a042db3a04eecc51d68a9b..63134176303a8bae9d946b9a5120e6289a0a4fe8 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "libqos/qgraph.h"
 #include "libqos/pci.h"
index efba76e7164e284f0f97920be0ddcb06fb0f4865..6781a514479bc47af0199d5a4705cf94635e0df9 100644 (file)
@@ -14,7 +14,7 @@
 #include "hw/acpi/acpi-defs.h"
 #include "boot-sector.h"
 #include "acpi-utils.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qapi/qmp/qdict.h"
 
 #define VGID_GUID "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87"
index a81025252c87989952cea07c1c546d55e25639f0..97c23fd3a8f6d133b1cf18dc0573ffeba36d7c92 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qemu/module.h"
 #include "libqos/qgraph.h"
 #include "libqos/pci.h"
index 797288d939fac2fb51f7200bfc3119e824bd29d0..6c36e43fb8358e589255f6822ebfbea15f62fff2 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qapi/qmp/qdict.h"
 #include "qemu/timer.h"
 
index d1b4c3e8ce5bc45f11a0edb0cadd4fae368e79bb..4ac4c221095b075dbdd9b36fa715b9637786530d 100644 (file)
@@ -4,7 +4,7 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 
-#include "libqtest.h"
+#include "libqos/libqtest.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qlist.h"
 
index 5c7e457075fec4b19b00eb5d7dd98bafef4447dd..267291c6ed5149f3ad78e757e383989030e8798e 100644 (file)
@@ -17,9 +17,8 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
-#include "libqos/qgraph.h"
-#include "libqos/qgraph_internal.h"
+#include "qtest/libqos/qgraph.h"
+#include "qtest/libqos/qgraph_internal.h"
 
 #define MACHINE_PC "x86_64/pc"
 #define MACHINE_RASPI2 "arm/raspi2"