Merge "Use specific credentials for tempest plugin setup"
diff --git a/lib/nova_plugins/functions-libvirt b/lib/nova_plugins/functions-libvirt
index 58adde7..d3827c3 100644
--- a/lib/nova_plugins/functions-libvirt
+++ b/lib/nova_plugins/functions-libvirt
@@ -81,17 +81,7 @@
         install_package qemu-kvm
 
         install_package libvirt libvirt-devel
-        if is_arch "x86_64"; then
-            # NOTE(yoctozepto): recent edk2-ovmf on CentOS Stream 8 x86_64 started failing with
-            # "libvirt.libvirtError: internal error: unknown feature amd-sev-es",
-            # so reinstall a known working version until the relevant bugs get fixed:
-            #   * https://bugzilla.redhat.com/show_bug.cgi?id=1961558
-            #   * https://bugzilla.redhat.com/show_bug.cgi?id=1961562
-            # TODO(yoctozepto): Remove this code when the time is right.
-            if [ "$os_VENDOR" = "CentOSStream" ]; then
-                install_package edk2-ovmf-20200602gitca407c7246bf-4.el8
-            fi
-        elif is_arch "aarch64"; then
+        if is_arch "aarch64"; then
             install_package edk2.git-aarch64
         fi
 
diff --git a/lib/os-vif b/lib/os-vif
new file mode 100644
index 0000000..865645c
--- /dev/null
+++ b/lib/os-vif
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# support vsctl or native.
+# until bug #1929446 is resolved we override the os-vif default
+# and fall back to the legacy "vsctl" driver.
+OS_VIF_OVS_OVSDB_INTERFACE=${OS_VIF_OVS_OVSDB_INTERFACE:="vsctl"}
+
+function is_ml2_ovs {
+    if [[ "${Q_AGENT}" == "openvswitch" ]]; then
+        echo "True"
+    fi
+    echo "False"
+}
+
+# This should be true for any ml2/ovs job but should be set to false for
+# all other ovs based jobs e.g. ml2/ovn
+OS_VIF_OVS_ISOLATE_VIF=${OS_VIF_OVS_ISOLATE_VIF:=$(is_ml2_ovs)}
+OS_VIF_OVS_ISOLATE_VIF=$(trueorfalse False OS_VIF_OVS_ISOLATE_VIF)
+
+function configure_os_vif {
+    if [[ -e ${NOVA_CONF} ]]; then
+        iniset ${NOVA_CONF} os_vif_ovs ovsdb_interface ${OS_VIF_OVS_OVSDB_INTERFACE}
+        iniset ${NOVA_CONF} os_vif_ovs isolate_vif ${OS_VIF_OVS_ISOLATE_VIF}
+    fi
+    if [[ -e ${NEUTRON_CONF} ]]; then
+        iniset ${NEUTRON_CONF} os_vif_ovs ovsdb_interface ${OS_VIF_OVS_OVSDB_INTERFACE}
+        iniset ${NEUTRON_CONF} os_vif_ovs isolate_vif ${OS_VIF_OVS_ISOLATE_VIF}
+    fi
+}
diff --git a/stack.sh b/stack.sh
index ef1ad3d..c439a72 100755
--- a/stack.sh
+++ b/stack.sh
@@ -597,6 +597,7 @@
 source $TOP_DIR/lib/dstat
 source $TOP_DIR/lib/tcpdump
 source $TOP_DIR/lib/etcd3
+source $TOP_DIR/lib/os-vif
 
 # Extras Source
 # --------------
@@ -1159,6 +1160,11 @@
     sudo sysctl -w net.ipv4.ip_forward=1
 fi
 
+# os-vif
+# ------
+if is_service_enabled nova neutron; then
+    configure_os_vif
+fi
 
 # Storage Service
 # ---------------