qemu upstart job should create /dev/kvm in a container

Bug #1370199 reported by Ryan Harper
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qemu (Ubuntu)
Fix Released
High
Ryan Harper
Trusty
Fix Released
Undecided
Unassigned

Bug Description

I have a host with kvm loaded and after creating a container and installing the qemu package, /dev/kvm doesn't exist. If I create it manually qemu runs fine.

The upstart job should detect that it's in a container and create /dev/kvm for use.

============================================================
Impact: /dev/kvm does not exist in containers after installing qemu-kvm
Test case:
  sudo lxc-create -t download -n t1 -- -d ubuntu -r trusty -a amd64
  sudo lxc-start -n t1 -d
  sudo lxc-attach -n t1 -- apt-get update
  sudo lxc-attach -n t1 -- apt-get -y install qemu-kvm
  sudo lxc-attach -n t1 -- ls -l /dev/kvm
Regression potential: This can only be fixed for privileged containers on the real host, where root in the container can in fact create /dev/kvm. In that case there should be no regresison as we simply create the needed device. In the other case, package install should not fail since we do '|| true' to ignore failure.
============================================================

Revision history for this message
Ryan Harper (raharper) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "proposed patch from Serge" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Ryan Harper (raharper)
Changed in qemu (Ubuntu):
assignee: nobody → Ryan Harper (raharper)
importance: Undecided → High
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qemu - 2.1+dfsg-4ubuntu4

---------------
qemu (2.1+dfsg-4ubuntu4) 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 <email address hidden> Wed, 17 Sep 2014 14:20:12 -0500

Changed in qemu (Ubuntu):
status: In Progress → Fix Released
description: updated
Revision history for this message
Sebastien Bacher (seb128) wrote :

there is nothing left to sponsor, unsubscribing ubuntu-sponsors

Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Ryan, or anyone else affected,

Accepted qemu into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/qemu/2.0.0+dfsg-2ubuntu1.8 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in qemu (Ubuntu Trusty):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Ryan Harper (raharper) wrote :

With the updated 2.0.0+dfsg-2ubuntu1.8 package in trusty/proposed, the test-case still fails as written.

After upgrading qemu-kvm, qemu-system-common qemu-system-x86 from trusty/proposed, no /dev/kvm exists even though /etc/init/qemu-kvm.conf includes the updated script to write it out. This is because the qemu-kvm upstart job is running.

To get the updated conf to run, one must also run:

sudo stop qemu-kvm; sudo start qemu-kvm

After running the above command with the new package, the contain does have a /dev/kvm entry.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Ryan Harper (raharper) wrote :

I don't think the fix is adequate since it requires an extra manual step, rather, I think the packaging should (if possible) trigger the upstart job to stop and then start again... Otherwise, anyone upgrading this (or installing it on top of a system with qemu-kvm already installed in a container) won't actually see /dev/kvm created in the container.

Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for qemu has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qemu - 2.0.0+dfsg-2ubuntu1.8

---------------
qemu (2.0.0+dfsg-2ubuntu1.8) trusty-proposed; urgency=medium

  * debian/qemu-system-x86.qemu-kvm.upstart: create /dev/kvm in a
    container. (LP: #1370199)
  * Cherrypick upstream patch to fix intermittent qemu-img corruption
    (LP: #1368815)
    - 501-block-raw-posix-fix-disk-corruption-in-try-fiemap
    - (note - 502-block-raw-posic-use-seek-hole-ahead-of-fiemap (which was
      also needed in utopic) appears to be unneeded here as the code being
      changed has not yet been switched to using try_fiemap)
 -- Serge Hallyn <email address hidden> Thu, 20 Nov 2014 11:24:51 -0600

Changed in qemu (Ubuntu Trusty):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.