]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/spdk/test/vhost/migration/migration-tc3b.sh
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / test / vhost / migration / migration-tc3b.sh
index 68d86930172fcdf82fd26edda2375740a50be89f..22d54df7313d08b2ab6894b37b9ed9dee43c73b6 100644 (file)
@@ -8,39 +8,37 @@ incoming_vm=1
 target_vm=2
 target_vm_ctrl=naa.VhostScsi0.$target_vm
 rpc="$rootdir/scripts/rpc.py -s $(get_vhost_dir 1)/rpc.sock"
-share_dir=$TEST_DIR/share
+share_dir=$VHOST_DIR/share
 
-function host_2_cleanup_vhost()
-{
+function host_2_cleanup_vhost() {
        notice "Shutting down VM $target_vm"
        vm_kill $target_vm
 
        notice "Removing bdev & controller from vhost 1 on remote server"
-       $rpc delete_nvme_controller Nvme0
-       $rpc remove_vhost_controller $target_vm_ctrl
+       $rpc bdev_nvme_detach_controller Nvme0
+       $rpc vhost_delete_controller $target_vm_ctrl
 
        notice "Shutting down vhost app"
        vhost_kill 1
        sleep 1
 }
 
-function host_2_start_vhost()
-{
-       echo "BASE DIR $TEST_DIR"
-       vhost_work_dir=$TEST_DIR/vhost1
+function host_2_start_vhost() {
+       echo "BASE DIR $VHOST_DIR"
+       vhost_work_dir=$VHOST_DIR/vhost1
        mkdir -p $vhost_work_dir
        rm -f $vhost_work_dir/*
 
        notice "Starting vhost 1 instance on remote server"
        trap 'host_2_cleanup_vhost; error_exit "${FUNCNAME}" "${LINENO}"' INT ERR EXIT
-       vhost_run --vhost-num=1 --no-pci
+       vhost_run 1 "-u"
 
-       $rpc construct_nvme_bdev -b Nvme0 -t rdma -f ipv4 -a $RDMA_TARGET_IP -s 4420 -n "nqn.2018-02.io.spdk:cnode1"
-       $rpc construct_vhost_scsi_controller $target_vm_ctrl
-       $rpc add_vhost_scsi_lun $target_vm_ctrl 0 Nvme0n1
+       $rpc bdev_nvme_attach_controller -b Nvme0 -t rdma -f ipv4 -a $RDMA_TARGET_IP -s 4420 -n "nqn.2018-02.io.spdk:cnode1"
+       $rpc vhost_create_scsi_controller $target_vm_ctrl
+       $rpc vhost_scsi_controller_add_target $target_vm_ctrl 0 Nvme0n1
 
        vm_setup --os="$os_image" --force=$target_vm --disk-type=spdk_vhost_scsi --disks=VhostScsi0 \
-               --memory=512 --vhost-num=1 --incoming=$incoming_vm
+               --memory=512 --vhost-name=1 --incoming=$incoming_vm
        vm_run $target_vm
        sleep 1
 
@@ -49,7 +47,7 @@ function host_2_start_vhost()
        echo "DONE" > $share_dir/DONE
 }
 
-echo $$ > $TEST_DIR/tc3b.pid
+echo $$ > $VHOST_DIR/tc3b.pid
 host_2_start_vhost
 suspend -f
 
@@ -58,7 +56,7 @@ if ! vm_os_booted $target_vm; then
 fi
 
 if ! is_fio_running $target_vm; then
-       vm_ssh $target_vm "cat /root/migration-tc3.job.out"
+       vm_exec $target_vm "cat /root/migration-tc3.log"
        error "FIO is not running on remote server after migration!"
 fi
 
@@ -67,13 +65,13 @@ timeout=40
 while is_fio_running $target_vm; do
        sleep 1
        echo -n "."
-       if (( timeout-- == 0 )); then
+       if ((timeout-- == 0)); then
                error "timeout while waiting for FIO!"
        fi
 done
 
 notice "FIO result after migration:"
-vm_ssh $target_vm "cat /root/migration-tc3.job.out"
+vm_exec $target_vm "cat /root/migration-tc3.log"
 
 host_2_cleanup_vhost
 echo "DONE" > $share_dir/DONE