scripts/vagrant: fix scripts for default emulator

Default emulator does not support OCSSD and Multi-namespace NVMe's.
Add if statement to check if user change emulator.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I30858bfed0c2e571c1aefa6ff7ccbf3bc436a294
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476454
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
This commit is contained in:
Maciej Wawryk 2019-12-02 11:34:57 +01:00 committed by Tomasz Zawadzki
parent ab04d59c57
commit 7561d1b5c2
2 changed files with 2 additions and 3 deletions

View File

@ -150,7 +150,7 @@ Vagrant.configure(2) do |config|
libvirt.qemuargs :value => "-drive"
libvirt.qemuargs :value => "format=raw,file=#{nvme_disk},if=none,id=#{nvme_disk_id}"
libvirt.qemuargs :value => "-device"
if nvme_namespaces["#{index}".to_i].nil?
if nvme_namespaces["#{index}".to_i].nil? || nvme_namespaces["#{index}".to_i] == "1"
libvirt.qemuargs :value => "nvme,drive=#{nvme_disk_id},serial=1234#{index}"
else
libvirt.qemuargs :value => "nvme,drive=#{nvme_disk_id},serial=1234#{index},namespaces=#{nvme_namespaces["#{index}".to_i]}"

View File

@ -178,7 +178,6 @@ fi
if [ -z "$NVME_FILE" ]; then
TMP="/var/lib/libvirt/images/nvme_disk.img"
NVME_DISKS_TYPE="nvme"
NVME_DISKS_NAMESPACES="1"
else
TMP=""
for args in $NVME_FILE; do
@ -188,7 +187,7 @@ else
type="nvme"
fi
NVME_DISKS_TYPE+="$type,";
if [ -z "$namespace" ]; then
if [ -z "$namespace" ] && [ -n "$SPDK_QEMU_EMULATOR" ]; then
namespace="1"
fi
NVME_DISKS_NAMESPACES+="$namespace,";