From 91eba8eb20019f998ef03b7bd553f66fc035cdaf Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 2 Dec 2015 15:30:44 +0000 Subject: [PATCH] Add distro support for KVM for IBM z Systems Add "KVM for IBM z Systems" to the list of Fedora-like distros. As the distribution does not have a dedicated kvm package, prevent the installation of the kvm package during the libvirt setup. Conflicts: stack.sh cherry-picked from a5ea08b7526bee0d9cab51000a477654726de8fe Change-Id: Ibb5c60797d6867264f9dea7fea85cdf1d7c72ded --- functions-common | 4 +++- lib/nova_plugins/functions-libvirt | 5 ++++- stack.sh | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/functions-common b/functions-common index 5d317bea22..f000cf6c0f 100644 --- a/functions-common +++ b/functions-common @@ -385,6 +385,8 @@ function GetDistro { DISTRO="rhel${os_RELEASE::1}" elif [[ "$os_VENDOR" =~ (XenServer) ]]; then DISTRO="xs$os_RELEASE" + elif [[ "$os_VENDOR" =~ (kvmibm) ]]; then + DISTRO="${os_VENDOR}${os_RELEASE::1}" else # Catch-all for now is Vendor + Release + Update DISTRO="$os_VENDOR-$os_RELEASE.$os_UPDATE" @@ -419,7 +421,7 @@ function is_fedora { [ "$os_VENDOR" = "Fedora" ] || [ "$os_VENDOR" = "Red Hat" ] || \ [ "$os_VENDOR" = "CentOS" ] || [ "$os_VENDOR" = "OracleLinux" ] || \ - [ "$os_VENDOR" = "CloudLinux" ] + [ "$os_VENDOR" = "CloudLinux" ] || [ "$os_VENDOR" = "kvmibm" ] } diff --git a/lib/nova_plugins/functions-libvirt b/lib/nova_plugins/functions-libvirt index 46ccaf4e0e..30b3628d8a 100755 --- a/lib/nova_plugins/functions-libvirt +++ b/lib/nova_plugins/functions-libvirt @@ -38,7 +38,10 @@ function install_libvirt { fi #pip_install_gr elif is_fedora || is_suse; then - install_package kvm + # On "KVM for IBM z Systems", kvm does not have its own package + if [[ ! ${DISTRO} =~ "kvmibm1" ]]; then + install_package kvm + fi # there is a dependency issue with kvm (which is really just a # wrapper to qemu-system-x86) that leaves some bios files out, # so install qemu-kvm (which shouldn't strictly be needed, as diff --git a/stack.sh b/stack.sh index e1b3319fca..78dbf2661c 100755 --- a/stack.sh +++ b/stack.sh @@ -169,7 +169,7 @@ source $TOP_DIR/stackrc # Warn users who aren't on an explicitly supported distro, but allow them to # override check and attempt installation with ``FORCE=yes ./stack`` -if [[ ! ${DISTRO} =~ (precise|trusty|utopic|vivid|7.0|wheezy|sid|testing|jessie|f21|f22|rhel7) ]]; then +if [[ ! ${DISTRO} =~ (precise|trusty|utopic|vivid|7.0|wheezy|sid|testing|jessie|f21|f22|rhel7|kvmibm1) ]]; then echo "WARNING: this script has not been tested on $DISTRO" if [[ "$FORCE" != "yes" ]]; then die $LINENO "If you wish to run this script anyway run with FORCE=yes"