Comment 0 for bug 1316812

Revision history for this message
Andrew Woodward (xarses) wrote :

Iso 172, 180, 183

Ubuntu fails to deploy because qemu-kvm fails to install because its init service wont start.

init fails due to
cat /etc/init/qemu-kvm.conf
...
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" || true
                chown root:kvm /dev/kvm
                chmod 0660 /dev/kvm
        elif grep -qs "^flags.* svm" /proc/cpuinfo; then
                modprobe -b kvm_amd || true
                chown root:kvm /dev/kvm
                chmod 0660 /dev/kvm
        fi
 ...

On guests that have parent hosts that support kvm_nested
/proc/cpuinfo will contain 'svm' or 'vmx' however because we are already a guest, /dev/kvm might not create, running modprobe on kvm_amd or kvm_intell will fail, then chmod will fail because /dev/kvm still doesn't exist. This causes init to fail

we should probably change the first test from /usr/bin/kvm to /dev/kvm like in Debian SID

case "$1" in
    start|restart|force-reload)

        [ ! -e /dev/kvm ] || exit 0 # nothing to do