diff --git a/scripts/vagrant/Vagrantfile b/scripts/vagrant/Vagrantfile index f4d40361c..6904e19d3 100644 --- a/scripts/vagrant/Vagrantfile +++ b/scripts/vagrant/Vagrantfile @@ -94,6 +94,7 @@ Vagrant.configure(2) do |config| spdk_dir=(ENV['SPDK_DIR'] || "none") vhost_host_dir=(ENV['VHOST_HOST_DIR'] || "none") vhost_vm_dir=(ENV['VHOST_VM_DIR'] || "none") + vmemulator=(ENV['SPDK_QEMU_EMULATOR'] || "") config.ssh.forward_agent = true config.ssh.forward_x11 = true @@ -121,6 +122,9 @@ Vagrant.configure(2) do |config| config.vm.provider "libvirt" do |libvirt, override| libvirt.random_hostname = "1" libvirt.disk_bus = "virtio" + if not vmemulator.empty? + libvirt.emulator_path = "#{vmemulator}" + end # we put nvme_disk inside default pool to eliminate libvirt/SELinux Permissions Problems # and to be able to run vagrant from user $HOME directory @@ -139,10 +143,10 @@ Vagrant.configure(2) do |config| libvirt.qemuargs :value => "-device" libvirt.qemuargs :value => "nvme,drive=D22,serial=1234" libvirt.driver = "kvm" - libvirt.graphics_type = "spice" + libvirt.graphics_type = "vnc" libvirt.memory = "#{vmram}" libvirt.cpus = "#{vmcpu}" - libvirt.video_type = "qxl" + libvirt.video_type = "cirrus" # Optional field if we want use other storage pools than default # libvirt.storage_pool_name = "vm" diff --git a/scripts/vagrant/create_vbox.sh b/scripts/vagrant/create_vbox.sh index 0476ae141..afd3b2937 100755 --- a/scripts/vagrant/create_vbox.sh +++ b/scripts/vagrant/create_vbox.sh @@ -19,14 +19,15 @@ display_help() { echo echo " distro = " echo - echo " -b default: ${NVME_FILE}" - echo " -s in kb default: ${SPDK_VAGRANT_VMRAM}" - echo " -n 1 to 4 default: ${SPDK_VAGRANT_VMCPU}" - echo " -x default: \"${SPDK_VAGRANT_HTTP_PROXY}\"" - echo " -p libvirt or virtualbox" - echo " --vhost-host-dir= directory path with vhost test dependencies" - echo " (test VM qcow image, fio binary, ssh keys)" - echo " --vhost-vm-dir= directory where to put vhost dependencies in VM" + echo " -b default: ${NVME_FILE}" + echo " -s in kb default: ${SPDK_VAGRANT_VMRAM}" + echo " -n 1 to 4 default: ${SPDK_VAGRANT_VMCPU}" + echo " -x default: \"${SPDK_VAGRANT_HTTP_PROXY}\"" + echo " -p libvirt or virtualbox" + echo " --vhost-host-dir= directory path with vhost test dependencies" + echo " (test VM qcow image, fio binary, ssh keys)" + echo " --vhost-vm-dir= directory where to put vhost dependencies in VM" + echo " --qemu-emulator= directory path with emulator, default: ${SPDK_QEMU_EMULATOR}" echo " -r dry-run" echo " -l use a local copy of spdk, don't try to rsync from the host." echo " -d deploy a test vm by provisioning all prerequisites for spdk autotest" @@ -55,6 +56,7 @@ SPDK_VAGRANT_DISTRO="distro" SPDK_VAGRANT_VMCPU=4 SPDK_VAGRANT_VMRAM=4096 SPDK_VAGRANT_PROVIDER="virtualbox" +SPDK_QEMU_EMULATOR="" OPTIND=1 NVME_FILE="nvme_disk.img" @@ -64,6 +66,7 @@ while getopts ":b:n:s:x:p:vrldh-:" opt; do case "${OPTARG}" in vhost-host-dir=*) VHOST_HOST_DIR="${OPTARG#*=}" ;; vhost-vm-dir=*) VHOST_VM_DIR="${OPTARG#*=}" ;; + qemu-emulator=*) SPDK_QEMU_EMULATOR="${OPTARG#*=}" ;; *) echo "Invalid argument '$OPTARG'" ;; esac ;; @@ -161,6 +164,7 @@ if [ ${VERBOSE} = 1 ]; then echo SPDK_VAGRANT_HTTP_PROXY=$SPDK_VAGRANT_HTTP_PROXY echo VHOST_HOST_DIR=$VHOST_HOST_DIR echo VHOST_VM_DIR=$VHOST_VM_DIR + echo SPDK_QEMU_EMULATOR=$SPDK_QEMU_EMULATOR echo fi @@ -188,6 +192,10 @@ if [ -n "$SPDK_VAGRANT_PROVIDER" ]; then export SPDK_VAGRANT_PROVIDER fi +if [ -n "$SPDK_QEMU_EMULATOR" ] && [ "$SPDK_VAGRANT_PROVIDER" == "libvirt" ]; then + export SPDK_QEMU_EMULATOR +fi + if [ ${DRY_RUN} = 1 ]; then echo "Environemnt Variables" printenv SPDK_VAGRANT_DISTRO @@ -195,6 +203,7 @@ if [ ${DRY_RUN} = 1 ]; then printenv SPDK_VAGRANT_VMCPU printenv SPDK_VAGRANT_PROVIDER printenv SPDK_VAGRANT_HTTP_PROXY + printenv SPDK_QEMU_EMULATOR printenv SPDK_DIR fi