Merge "Add LIBVIRT_CPU_MODE to set CPU mode"

This commit is contained in:
Zuul 2020-02-17 01:05:14 +00:00 committed by Gerrit Code Review
commit 93d22d8298
3 changed files with 3 additions and 1 deletions

View File

@ -259,6 +259,7 @@ function configure_nova {
if [ ! -e /dev/kvm ]; then
echo "WARNING: Switching to QEMU"
LIBVIRT_TYPE=qemu
LIBVIRT_CPU_MODE=none
if which selinuxenabled >/dev/null 2>&1 && selinuxenabled; then
# https://bugzilla.redhat.com/show_bug.cgi?id=753589
sudo setsebool virt_use_execmem on

View File

@ -39,7 +39,7 @@ function cleanup_nova_hypervisor {
function configure_nova_hypervisor {
configure_libvirt
iniset $NOVA_CONF libvirt virt_type "$LIBVIRT_TYPE"
iniset $NOVA_CONF libvirt cpu_mode "none"
iniset $NOVA_CONF libvirt cpu_mode "$LIBVIRT_CPU_MODE"
# Do not enable USB tablet input devices to avoid QEMU CPU overhead.
iniset $NOVA_CONF DEFAULT pointer_model "ps2mouse"
iniset $NOVA_CONF libvirt live_migration_uri "qemu+ssh://$STACK_USER@%s/system"

View File

@ -621,6 +621,7 @@ VIRT_DRIVER=${VIRT_DRIVER:-$DEFAULT_VIRT_DRIVER}
case "$VIRT_DRIVER" in
ironic|libvirt)
LIBVIRT_TYPE=${LIBVIRT_TYPE:-kvm}
LIBVIRT_CPU_MODE=${LIBVIRT_CPU_MODE:-none}
if [[ "$os_VENDOR" =~ (Debian|Ubuntu) ]]; then
# The groups change with newer libvirt. Older Ubuntu used
# 'libvirtd', but now uses libvirt like Debian. Do a quick check