From e56925a18fc32bc8692a467f67dcefa8f7a3057c Mon Sep 17 00:00:00 2001 From: Ramy Asselin Date: Wed, 10 Jun 2015 14:37:36 -0700 Subject: [PATCH] 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 --- .../fibre_channel/invoke_fc_passthrough.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/provisioning_scripts/fibre_channel/invoke_fc_passthrough.sh b/provisioning_scripts/fibre_channel/invoke_fc_passthrough.sh index 84ce526..20ca57e 100644 --- a/provisioning_scripts/fibre_channel/invoke_fc_passthrough.sh +++ b/provisioning_scripts/fibre_channel/invoke_fc_passthrough.sh @@ -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'"