@@ -48,3 +48,8 @@ CONSOLE=" -serial mon:stdio"
# Native AIO is probably better for our goal which is test proofing
# production systems.
AIO=",aio=native"
+
+# Exported test/scratch dirs for 9p test in kvm guest, and virtfs security model
+#VIRTFS_TEST_PATH=/tmp/9ptest
+#VIRTFS_SCRATCH_PATH=/tmp/9pscratch
+#VIRTFS_MODEL=mapped
@@ -78,6 +78,22 @@ fi
if test -z "$VIRTFS_PATH"; then
VIRTFS_PATH=/tmp/kvm-xfstests-$USER
fi
+VIRTFS="-fsdev local,id=v_tmp,path=$VIRTFS_PATH,security_model=none "
+VIRTFS+="-device virtio-9p-pci,fsdev=v_tmp,mount_tag=v_tmp "
+
+if test -z "$VIRTFS_MODEL"; then
+ VIRTFS_MODEL=none
+fi
+if test -n "$VIRTFS_TEST_PATH"; then
+ VIRTFS+="-fsdev local,id=p9test,path=$VIRTFS_TEST_PATH,"
+ VIRTFS+="security_model=$VIRTFS_MODEL "
+ VIRTFS+="-device virtio-9p-pci,fsdev=p9test,mount_tag=9ptest "
+fi
+if test -n "$VIRTFS_SCRATCH_PATH"; then
+ VIRTFS+=" -fsdev local,id=p9scratch,path=$VIRTFS_SCRATCH_PATH,"
+ VIRTFS+="security_model=$VIRTFS_MODEL "
+ VIRTFS+="-device virtio-9p-pci,fsdev=p9scratch,mount_tag=9pscratch "
+fi
VDH=$(mktemp /tmp/kvm-upload.XXXXXXXX)
trap 'rm -f "$VDH"' 0
@@ -119,8 +135,7 @@ $NO_ACTION $IONICE $QEMU -boot order=c $NET \
-drive file=$VDG,cache=none,if=virtio,format=raw$AIO \
-drive file=$VDH,if=virtio,format=raw \
-vga none -nographic -smp $NR_CPU -m $MEM \
- -fsdev local,id=v_tmp,path=$VIRTFS_PATH,security_model=none \
- -device virtio-9p-pci,fsdev=v_tmp,mount_tag=v_tmp \
+ $VIRTFS \
$VIRTIO_RNG \
$CONSOLE \
$MONITOR \
@@ -282,7 +282,7 @@ do
fi
fi
case "$TEST_DEV" in
- */ovl) ;;
+ */ovl|9p*) ;;
*:/*) ;;
*)
if ! [ -b $TEST_DEV -o -c $TEST_DEV ]; then
@@ -399,6 +399,18 @@ while [ "$1" != "" ]; do
supported_flavors kvm
VIRTFS_PATH="$1"
;;
+ --virtfs-test) shift
+ supported_flavors kvm
+ VIRTFS_TEST_PATH="$1"
+ ;;
+ --virtfs-scratch) shift
+ supported_flavors kvm
+ VIRTFS_SCRATCH_PATH="$1"
+ ;;
+ --virtfs-model) shift
+ supported_flavors kvm
+ VIRTFS_MODEL="$1"
+ ;;
--archive)
supported_flavors kvm
DO_ARCHIVE=1
Add 9p test support, introduce three new configurable variables - VIRTFS_TEST_PATH: path to be exported to kvm guest as TEST_DEV - VIRTFS_SCRATCH_PATH: path to be exported to kvm guest as SCRATCH_DEV - VIRTFS_MODEL: security model, "none" as default The mount tags in guest are 9ptest and 9pscratch. Signed-off-by: Eryu Guan <eguan@linux.alibaba.com> --- kvm-xfstests/config.kvm | 5 +++++ kvm-xfstests/kvm-xfstests | 19 +++++++++++++++++-- kvm-xfstests/test-appliance/files/root/runtests.sh | 2 +- kvm-xfstests/util/parse_cli | 12 ++++++++++++ 4 files changed, 35 insertions(+), 3 deletions(-)