/etc/init/qemu-kvm.conf is in qemu-kvm 1.0+noroms-0ubuntu13.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | # qemu-kvm
description "KVM"
author "Dustin Kirkland <kirkland@canonical.com>"
start on runlevel [2345]
pre-start script
# Silently exit if the package isn't installed anymore
if [ ! -e /usr/bin/kvm ]; then
exit 0
fi
[ -r /etc/default/qemu-kvm ] && . /etc/default/qemu-kvm
# Load the appropriate module, respecting blacklists
if grep -qs "^flags.* vmx" /proc/cpuinfo; then
modprobe -b kvm_intel "$KVM_NESTED"
elif grep -qs "^flags.* svm" /proc/cpuinfo; then
modprobe -b kvm_amd
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
if [ -w /sys/kernel/mm/ksm/sleep_millisecs ]; then
if [ -n "$SLEEP_MILLISECS" ]; then
echo "$SLEEP_MILLISECS" > /sys/kernel/mm/ksm/sleep_millisecs
fi
fi
else
[ -w /sys/kernel/mm/ksm/run ] && echo 0 > /sys/kernel/mm/ksm/run
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
fi
end script
post-stop script
# Unload the modules
if grep -qs "^flags.* vmx" /proc/cpuinfo; then
modprobe -r kvm_intel
elif grep -qs "^flags.* svm" /proc/cpuinfo; then
modprobe -r kvm_amd
fi
modprobe -r vhost_net
end script
|