qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

Makefile: Add rules to run vm tests

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Fam Zheng <famz@redhat.com>

+45 -1
+2
Makefile
··· 811 811 -include $(wildcard *.d tests/*.d) 812 812 813 813 include $(SRC_PATH)/tests/docker/Makefile.include 814 + include $(SRC_PATH)/tests/vm/Makefile.include 814 815 815 816 .PHONY: help 816 817 help: ··· 834 835 @echo 'Test targets:' 835 836 @echo ' check - Run all tests (check-help for details)' 836 837 @echo ' docker - Help about targets running tests inside Docker containers' 838 + @echo ' vm-test - Help about targets running tests inside VM' 837 839 @echo '' 838 840 @echo 'Documentation targets:' 839 841 @echo ' html info pdf txt'
+1 -1
configure
··· 6509 6509 fi 6510 6510 6511 6511 # build tree in object directory in case the source is not in the current directory 6512 - DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests" 6512 + DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests tests/vm" 6513 6513 DIRS="$DIRS docs docs/interop fsdev" 6514 6514 DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw" 6515 6515 DIRS="$DIRS roms/seabios roms/vgabios"
+42
tests/vm/Makefile.include
··· 1 + # Makefile for VM tests 2 + 3 + .PHONY: vm-build-all 4 + 5 + IMAGES := ubuntu.i386 freebsd netbsd openbsd 6 + IMAGE_FILES := $(patsubst %, tests/vm/%.img, $(IMAGES)) 7 + 8 + .PRECIOUS: $(IMAGE_FILES) 9 + 10 + vm-test: 11 + @echo "vm-test: Test QEMU in preconfigured virtual machines" 12 + @echo 13 + @echo " vm-build-ubuntu.i386 - Build QEMU in ubuntu i386 VM" 14 + @echo " vm-build-freebsd - Build QEMU in FreeBSD VM" 15 + @echo " vm-build-netbsd - Build QEMU in NetBSD VM" 16 + @echo " vm-build-openbsd - Build QEMU in OpenBSD VM" 17 + 18 + vm-build-all: $(addprefix vm-build-, $(IMAGES)) 19 + 20 + tests/vm/%.img: $(SRC_PATH)/tests/vm/% \ 21 + $(SRC_PATH)/tests/vm/basevm.py \ 22 + $(SRC_PATH)/tests/vm/Makefile.include 23 + $(call quiet-command, \ 24 + $< \ 25 + $(if $(V)$(DEBUG), --debug) \ 26 + --image "$@" \ 27 + --force \ 28 + --build-image $@, \ 29 + " VM-IMAGE $*") 30 + 31 + 32 + # Build in VM $(IMAGE) 33 + vm-build-%: tests/vm/%.img 34 + $(call quiet-command, \ 35 + $(SRC_PATH)/tests/vm/$* \ 36 + $(if $(V)$(DEBUG), --debug) \ 37 + $(if $(DEBUG), --interactive) \ 38 + $(if $(J),--jobs $(J)) \ 39 + --image "$<" \ 40 + --build-qemu $(SRC_PATH), \ 41 + " VM-BUILD $*") 42 +