diff -Nru qemu-2.1+dfsg/debian/changelog qemu-2.1+dfsg/debian/changelog --- qemu-2.1+dfsg/debian/changelog 2014-09-16 00:29:03.000000000 -0500 +++ qemu-2.1+dfsg/debian/changelog 2014-09-17 14:20:19.000000000 -0500 @@ -1,3 +1,18 @@ +qemu (2.1+dfsg-4ubuntu3d1) utopic; urgency=medium + + * debian/qemu-system-x86.qemu-kvm.upstart: create /dev/kvm in a + container. (LP: #1370199) + * load kvm module on ppc64le at boot (LP: #1369785) + - debian/rules: install qemu-kvm on ppc64el + - add debian/qemu-system-ppc.qemu-kvm.{upstart,default} to autoload the + kvm-hv module if available + * qemu-system-x86.maintscript: remove accidentally installed + /etc/init.d/qemu-system-x86 (from 2.0.0+dfsg-6ubuntu1 and a few earlier) + * rename qemu-system-x86 init script to qemu-kvm so it gets installed in + ubuntu. + + -- Serge Hallyn Wed, 17 Sep 2014 14:20:12 -0500 + qemu (2.1+dfsg-4ubuntu3) utopic; urgency=medium * Re-stick the trusty machine type to 2.0 (where it must always stay) and diff -Nru qemu-2.1+dfsg/debian/qemu-system-ppc.qemu-kvm.default qemu-2.1+dfsg/debian/qemu-system-ppc.qemu-kvm.default --- qemu-2.1+dfsg/debian/qemu-system-ppc.qemu-kvm.default 1969-12-31 18:00:00.000000000 -0600 +++ qemu-2.1+dfsg/debian/qemu-system-ppc.qemu-kvm.default 2014-09-16 14:48:40.000000000 -0500 @@ -0,0 +1,11 @@ +# To disable qemu-kvm's page merging feature, set KSM_ENABLED=0 and +# sudo restart qemu-kvm +KSM_ENABLED=1 +SLEEP_MILLISECS=200 +# To load the vhost_net module, which in some cases can speed up +# network performance, set VHOST_NET_ENABLED to 1. +VHOST_NET_ENABLED=0 + +# Set this to 1 if you want hugepages to be available to kvm under +# /run/hugepages/kvm +KVM_HUGEPAGES=0 diff -Nru qemu-2.1+dfsg/debian/qemu-system-ppc.qemu-kvm.init qemu-2.1+dfsg/debian/qemu-system-ppc.qemu-kvm.init --- qemu-2.1+dfsg/debian/qemu-system-ppc.qemu-kvm.init 1969-12-31 18:00:00.000000000 -0600 +++ qemu-2.1+dfsg/debian/qemu-system-ppc.qemu-kvm.init 2014-09-16 21:12:53.000000000 -0500 @@ -0,0 +1,60 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: qemu-system-x86 +# Required-Start: mountkernfs +# Required-Stop: +# Should-Start: udev devfsd +# Should-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: QEMU KVM module loading script +# Description: This script loads the kernel modules needed by QEMU KVM +### END INIT INFO + +case "$1" in + start|restart|force-reload) + + [ ! -e /dev/kvm ] || exit 0 # nothing to do + + # kernel 3.4+ autoloads modules + case "$(uname -r 2>/dev/null)" in + 3.[4-9]* | 3.[1-9][0-9]* | [4-9].*) exit 0 ;; + esac + + # check if we're running inside an (lxc) container + # (we may copy or move this to the postinst script too, to skip installing it) + grep -zqs ^container= /proc/1/environ && exit 0 + + . /lib/lsb/init-functions + + if grep -q '^flags.*\' /proc/cpuinfo; then + module=kvm_intel + elif grep -q '^flags.*\' /proc/cpuinfo; then + module=kvm_amd + else + log_warning_msg "Your system does not have support for KVM" + exit 0 + fi + if ! which modprobe >/dev/null; then + log_warning_msg "modprobe isn't installed, not loading kvm modules." + exit 0 + fi + if modprobe -b $module ; then + log_success_msg "Loading kvm module $module" + else + log_failure_msg "Module $module failed to load" + exit 1 + fi + if modprobe -b vhost-net ; then + log_warning_msg "Module vhost-net failed to load" + fi + ;; + stop) + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff -Nru qemu-2.1+dfsg/debian/qemu-system-ppc.qemu-kvm.upstart qemu-2.1+dfsg/debian/qemu-system-ppc.qemu-kvm.upstart --- qemu-2.1+dfsg/debian/qemu-system-ppc.qemu-kvm.upstart 1969-12-31 18:00:00.000000000 -0600 +++ qemu-2.1+dfsg/debian/qemu-system-ppc.qemu-kvm.upstart 2014-09-16 15:09:31.000000000 -0500 @@ -0,0 +1,52 @@ +# qemu-kvm + +description "KVM" +author "Dustin Kirkland " + +start on runlevel [2345] + +pre-start script + # Silently exit if the package isn't installed anymore + if [ ! -e /usr/bin/qemu-system-ppc64 ]; then + exit 0 + fi + if [ `uname -m` != "ppc64le" ]; then + exit 0 + fi + [ -r /etc/default/qemu-kvm ] && . /etc/default/qemu-kvm + # Load the appropriate module, respecting blacklists + modprobe -b kvm-hv || true + if running-in-container; then + mknod /dev/kvm c 10 232 || true + chown root:kvm /dev/kvm || true + chmod g+rw /dev/kvm || true + fi + # Enable KSM, respecting the default configuration file + if [ "$KSM_ENABLED" = "1" ]; then + [ -w /sys/kernel/mm/ksm/run ] && echo 1 > /sys/kernel/mm/ksm/run || true + if [ -w /sys/kernel/mm/ksm/sleep_millisecs ]; then + if [ -n "$SLEEP_MILLISECS" ]; then + echo "$SLEEP_MILLISECS" > /sys/kernel/mm/ksm/sleep_millisecs || true + fi + fi + else + [ -w /sys/kernel/mm/ksm/run ] && echo 0 > /sys/kernel/mm/ksm/run || true + fi + # If /etc/default/qemu-kvm says to, load vhost_net. Default is not to. + if [ "$VHOST_NET_ENABLED" = "1" ]; then + modprobe -b vhost_net || true + fi + # mount hugepages if available and requested + if [ "$KVM_HUGEPAGES" -eq "1" ]; then + if ! grep -q hugetlbfs /proc/filesystems; then + logger -t qemu-kvm "Error: hugepages not available in the kernel!" + elif grep -q /run/hugepages/kvm /proc/mounts; then + logger -t qemu-kvm "/run/hugepages/kvm already mounted" + elif ! getent group kvm > /dev/null 2>&1; then + logger -t qemu-kvm "Error: group kvm does not exist!" + else + mkdir -p /run/hugepages/kvm + mount -t hugetlbfs hugetlbfs-kvm -o mode=775,gid=kvm /run/hugepages/kvm + fi + fi +end script diff -Nru qemu-2.1+dfsg/debian/qemu-system-x86.init qemu-2.1+dfsg/debian/qemu-system-x86.init --- qemu-2.1+dfsg/debian/qemu-system-x86.init 2014-07-30 18:06:35.000000000 -0500 +++ qemu-2.1+dfsg/debian/qemu-system-x86.init 1969-12-31 18:00:00.000000000 -0600 @@ -1,60 +0,0 @@ -#! /bin/sh -### BEGIN INIT INFO -# Provides: qemu-system-x86 -# Required-Start: mountkernfs -# Required-Stop: -# Should-Start: udev devfsd -# Should-Stop: -# Default-Start: S -# Default-Stop: -# Short-Description: QEMU KVM module loading script -# Description: This script loads the kernel modules needed by QEMU KVM -### END INIT INFO - -case "$1" in - start|restart|force-reload) - - [ ! -e /dev/kvm ] || exit 0 # nothing to do - - # kernel 3.4+ autoloads modules - case "$(uname -r 2>/dev/null)" in - 3.[4-9]* | 3.[1-9][0-9]* | [4-9].*) exit 0 ;; - esac - - # check if we're running inside an (lxc) container - # (we may copy or move this to the postinst script too, to skip installing it) - grep -zqs ^container= /proc/1/environ && exit 0 - - . /lib/lsb/init-functions - - if grep -q '^flags.*\' /proc/cpuinfo; then - module=kvm_intel - elif grep -q '^flags.*\' /proc/cpuinfo; then - module=kvm_amd - else - log_warning_msg "Your system does not have support for KVM" - exit 0 - fi - if ! which modprobe >/dev/null; then - log_warning_msg "modprobe isn't installed, not loading kvm modules." - exit 0 - fi - if modprobe -b $module ; then - log_success_msg "Loading kvm module $module" - else - log_failure_msg "Module $module failed to load" - exit 1 - fi - if modprobe -b vhost-net ; then - log_warning_msg "Module vhost-net failed to load" - fi - ;; - stop) - ;; - *) - echo "Usage: $0 {start|stop|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff -Nru qemu-2.1+dfsg/debian/qemu-system-x86.maintscript qemu-2.1+dfsg/debian/qemu-system-x86.maintscript --- qemu-2.1+dfsg/debian/qemu-system-x86.maintscript 1969-12-31 18:00:00.000000000 -0600 +++ qemu-2.1+dfsg/debian/qemu-system-x86.maintscript 2014-09-17 11:39:11.000000000 -0500 @@ -0,0 +1 @@ +rm_conffile /etc/init.d/qemu-system-x86 2.1+dfsg-4ubuntu4~ diff -Nru qemu-2.1+dfsg/debian/qemu-system-x86.qemu-kvm.init qemu-2.1+dfsg/debian/qemu-system-x86.qemu-kvm.init --- qemu-2.1+dfsg/debian/qemu-system-x86.qemu-kvm.init 1969-12-31 18:00:00.000000000 -0600 +++ qemu-2.1+dfsg/debian/qemu-system-x86.qemu-kvm.init 2014-07-30 18:06:35.000000000 -0500 @@ -0,0 +1,60 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: qemu-system-x86 +# Required-Start: mountkernfs +# Required-Stop: +# Should-Start: udev devfsd +# Should-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: QEMU KVM module loading script +# Description: This script loads the kernel modules needed by QEMU KVM +### END INIT INFO + +case "$1" in + start|restart|force-reload) + + [ ! -e /dev/kvm ] || exit 0 # nothing to do + + # kernel 3.4+ autoloads modules + case "$(uname -r 2>/dev/null)" in + 3.[4-9]* | 3.[1-9][0-9]* | [4-9].*) exit 0 ;; + esac + + # check if we're running inside an (lxc) container + # (we may copy or move this to the postinst script too, to skip installing it) + grep -zqs ^container= /proc/1/environ && exit 0 + + . /lib/lsb/init-functions + + if grep -q '^flags.*\' /proc/cpuinfo; then + module=kvm_intel + elif grep -q '^flags.*\' /proc/cpuinfo; then + module=kvm_amd + else + log_warning_msg "Your system does not have support for KVM" + exit 0 + fi + if ! which modprobe >/dev/null; then + log_warning_msg "modprobe isn't installed, not loading kvm modules." + exit 0 + fi + if modprobe -b $module ; then + log_success_msg "Loading kvm module $module" + else + log_failure_msg "Module $module failed to load" + exit 1 + fi + if modprobe -b vhost-net ; then + log_warning_msg "Module vhost-net failed to load" + fi + ;; + stop) + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff -Nru qemu-2.1+dfsg/debian/qemu-system-x86.qemu-kvm.upstart qemu-2.1+dfsg/debian/qemu-system-x86.qemu-kvm.upstart --- qemu-2.1+dfsg/debian/qemu-system-x86.qemu-kvm.upstart 2014-09-09 17:23:36.000000000 -0500 +++ qemu-2.1+dfsg/debian/qemu-system-x86.qemu-kvm.upstart 2014-09-16 13:27:25.000000000 -0500 @@ -17,6 +17,11 @@ elif grep -qs "^flags.* svm" /proc/cpuinfo; then modprobe -b kvm_amd || true fi + if running-in-container; then + mknod /dev/kvm c 10 232 || true + chown root:kvm /dev/kvm || true + chmod g+rw /dev/kvm || true + fi # Enable KSM, respecting the default configuration file if [ "$KSM_ENABLED" = "1" ]; then [ -w /sys/kernel/mm/ksm/run ] && echo 1 > /sys/kernel/mm/ksm/run || true diff -Nru qemu-2.1+dfsg/debian/rules qemu-2.1+dfsg/debian/rules --- qemu-2.1+dfsg/debian/rules 2014-09-09 17:55:00.000000000 -0500 +++ qemu-2.1+dfsg/debian/rules 2014-09-16 14:43:51.000000000 -0500 @@ -255,6 +255,9 @@ # remoe past jessie (and maybe for jessie too) dh_installinit -pqemu-system-x86 --no-restart-on-upgrade --error-handler=true --name=qemu-kvm endif +ifneq ($(filter $(DEB_HOST_ARCH),ppc64le),) + dh_installinit -pqemu-system-ppc --no-restart-on-upgrade --error-handler=true --name=qemu-kvm +endif endif dh_installinit -pqemu-guest-agent endif