Allow override the fc_pci_device variable

Other than allow users to pick their own variable name,
this is useful for the use case of using a particular fc device
for a specific test.

Change-Id: Iefd7f7a3b7b7a15efc8fa5d00dda886a2c87ecf2
This commit is contained in:
Ramy Asselin 2015-06-10 14:37:36 -07:00
parent 32d9765539
commit e56925a18f
1 changed files with 5 additions and 2 deletions

View File

@ -37,13 +37,15 @@
#
# The maximum number of FC devices to passthrough, failing if they cannot all be
# aquired
# export FC_NUM=2
# export FC_NUM=2 (default 1)
#
# For single node setups where the hypervisor is the same as the provider, and dns
# is not configured, export this variable to use the provider ip as the hypervisor
# export FC_SINGLE_NODE=1
FC_NUM=${FC_NUM:-1}
FC_PCI_VAR_NAME=${FC_PCI_VAR_NAME:-"fc_pci_device"}
echo "Planning to passthrough $FC_NUM pci devices"
eth0_ip=$(hostname -I | cut -f1 -d' ')
@ -116,7 +118,8 @@ else
fi
echo "Found Hypervisor hostname: $HYPERVISOR"
fc_pci_device=$(ssh -i $PROVIDER_KEY $PROVIDER_USER@$HYPERVISOR 'echo $fc_pci_device')
fc_pci_device_cmd="echo \$$FC_PCI_VAR_NAME"
fc_pci_device=$(ssh -i $PROVIDER_KEY $PROVIDER_USER@$HYPERVISOR "$fc_pci_device_cmd")
if [[ -z $fc_pci_device ]]; then
echo "No FC device known. Set fc_pci_device in your /etc/profile.d or /etc/environment (depending on distro and ssh configuration) to the desired 'Class Device path', e.g. '0000:21:00.2'"