]> git.proxmox.com Git - mirror_qemu.git/commitdiff
meson: convert migration/initrd-stress
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 28 Aug 2020 11:07:34 +0000 (15:07 +0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Sep 2020 09:43:16 +0000 (11:43 +0200)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-17-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tests/Makefile.include
tests/meson.build
tests/migration/initrd-stress.sh [new file with mode: 0755]
tests/migration/meson.build [new file with mode: 0644]

index fe22ccfcc6c0ed2fb0ed1302985721178fc6df27..1592a647f4336182afa36c3d21bcbf4ad61a6f5f 100644 (file)
@@ -38,20 +38,6 @@ export SRC_PATH
 SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
    $(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak)))
 
-QEMU_CFLAGS += -I$(SRC_PATH)/tests -I$(SRC_PATH)/tests/qtest
-
-tests/migration/stress$(EXESUF): tests/migration/stress.o
-       $(call quiet-command, $(LINKPROG) -static -O3 $(PTHREAD_LIB) -o $@ $< ,"LINK","$(TARGET_DIR)$@")
-
-INITRD_WORK_DIR=tests/migration/initrd
-
-tests/migration/initrd-stress.img: tests/migration/stress$(EXESUF)
-       mkdir -p $(INITRD_WORK_DIR)
-       cp $< $(INITRD_WORK_DIR)/init
-       (cd $(INITRD_WORK_DIR) && (find | cpio --quiet -o -H newc | gzip -9)) > $@
-       rm $(INITRD_WORK_DIR)/init
-       rmdir $(INITRD_WORK_DIR)
-
 SPEED = quick
 
 # gtester tests, possibly with verbose output
index 94e34f72a842a80abda70ca8bc12b5d83d5bebc1..998e4c48f905c02d8724f10a687496edc2423f10 100644 (file)
@@ -268,3 +268,4 @@ endif
 
 subdir('qapi-schema')
 subdir('qtest')
+subdir('migration')
diff --git a/tests/migration/initrd-stress.sh b/tests/migration/initrd-stress.sh
new file mode 100755 (executable)
index 0000000..0f20ac2
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+INITRD="$1"
+STRESS="$2"
+
+INITRD_DIR=$(mktemp -d -p '' "initrd-stress.XXXXXX")
+trap 'rm -rf $INITRD_DIR' EXIT
+
+cp "$STRESS" "$INITRD_DIR/init"
+(cd "$INITRD_DIR" && (find | cpio --quiet -o -H newc | gzip -9)) > "$INITRD"
diff --git a/tests/migration/meson.build b/tests/migration/meson.build
new file mode 100644 (file)
index 0000000..f215ee7
--- /dev/null
@@ -0,0 +1,14 @@
+stress = executable(
+  'stress',
+  files('stress.c'),
+  dependencies: [glib],
+  link_args: ['-static'],
+  build_by_default: false,
+)
+
+custom_target(
+  'initrd-stress.img',
+  output: 'initrd-stress.img',
+  input: stress,
+  command: [find_program('initrd-stress.sh'), '@OUTPUT@', '@INPUT@']
+)