Merge "Allow customizing libvirt NIC driver"

This commit is contained in:
Zuul 2018-05-31 15:56:20 +00:00 committed by Gerrit Code Review
commit af5e811467
2 changed files with 7 additions and 2 deletions

View File

@ -1609,6 +1609,10 @@ function create_bridge_and_vms {
vm_opts+=" -L $UEFI_LOADER_PATH -N $UEFI_NVRAM_PATH" vm_opts+=" -L $UEFI_LOADER_PATH -N $UEFI_NVRAM_PATH"
fi fi
if [[ -n "$LIBVIRT_NIC_DRIVER" ]]; then
vm_opts+=" -D $LIBVIRT_NIC_DRIVER"
fi
local bridge_mac local bridge_mac
bridge_mac=$(ip link show dev $IRONIC_VM_NETWORK_BRIDGE | grep -Eo "ether [A-Za-z0-9:]+"|sed "s/ether\ //") bridge_mac=$(ip link show dev $IRONIC_VM_NETWORK_BRIDGE | grep -Eo "ether [A-Za-z0-9:]+"|sed "s/ether\ //")

View File

@ -12,7 +12,7 @@ export PS4='+ ${BASH_SOURCE:-}:${FUNCNAME[0]:-}:L${LINENO:-}: '
# Keep track of the DevStack directory # Keep track of the DevStack directory
TOP_DIR=$(cd $(dirname "$0")/.. && pwd) TOP_DIR=$(cd $(dirname "$0")/.. && pwd)
while getopts "n:c:i:m:M:d:a:b:e:E:p:o:f:l:L:N:A:" arg; do while getopts "n:c:i:m:M:d:a:b:e:E:p:o:f:l:L:N:A:D:" arg; do
case $arg in case $arg in
n) NAME=$OPTARG;; n) NAME=$OPTARG;;
c) CPU=$OPTARG;; c) CPU=$OPTARG;;
@ -33,6 +33,7 @@ while getopts "n:c:i:m:M:d:a:b:e:E:p:o:f:l:L:N:A:" arg; do
L) UEFI_LOADER=$OPTARG;; L) UEFI_LOADER=$OPTARG;;
N) UEFI_NVRAM=$OPTARG;; N) UEFI_NVRAM=$OPTARG;;
A) MAC_ADDRESS=$OPTARG;; A) MAC_ADDRESS=$OPTARG;;
D) NIC_DRIVER=$OPTARG;;
esac esac
done done
@ -43,7 +44,7 @@ if [ -z "$UEFI_LOADER" ] && [ ! -z "$UEFI_NVRAM" ]; then
exit 1 exit 1
fi fi
LIBVIRT_NIC_DRIVER=${LIBVIRT_NIC_DRIVER:-"virtio"} LIBVIRT_NIC_DRIVER=${NIC_DRIVER:-"virtio"}
LIBVIRT_STORAGE_POOL=${LIBVIRT_STORAGE_POOL:-"default"} LIBVIRT_STORAGE_POOL=${LIBVIRT_STORAGE_POOL:-"default"}
LIBVIRT_CONNECT_URI=${LIBVIRT_CONNECT_URI:-"qemu:///system"} LIBVIRT_CONNECT_URI=${LIBVIRT_CONNECT_URI:-"qemu:///system"}