Utility to see if kvm acceleration can be used

Bug #188878 reported by to be removed
4
Affects Status Importance Assigned to Milestone
kvm (Ubuntu)
Fix Released
Wishlist
Dustin Kirkland 

Bug Description

Binary package hint: kvm

I'm attaching a little Python program to see if kvm acceleration can be used. Running this would be easier than copy-pasting the egrep command line, especially if something tries to be smart and converts ASCII quotes to fancy, non-working quotes.

Related branches

Revision history for this message
to be removed (liw) wrote :

And the script.

Revision history for this message
Emmet Hikory (persia) wrote :

kvm doesn't current depend on python, and doesn't require it, so adding this script would add a dependency which could be avoided by using a shell script and grep (both of which are guaranteed to be installed). Furthermore, kvm falls back to qemu from the internal code: perhaps abstracting this for an extra utility would be simple enough?

Revision history for this message
to be removed (liw) wrote :

Oh, I thought kvm did require Python already. I'm happy to rewrite the script in shell, though, no big deal.

I know kvm falls back on qemu: the point is to make it easier to know whether it will or not, on a given hardware. Copy-pasting the command line from the package description works, except when it doesn't. See https://lists.ubuntu.com/archives/ubuntu-devel-discuss/2008-February/003226.html for an example.

Revision history for this message
Soren Hansen (soren) wrote :

Python is "Essential: yes" and depends on python2.5, which depends on python2.5-minimal, which provides both optparse and sys. No need for additional dependencies. I don't see the value of the script, though. kvm's init script does the detection and loads the appropriate modules or tells you if you're out of luck (i.e.: don't have the extensions you need).

Revision history for this message
to be removed (liw) wrote :

The value of the script is that it makes it easy to see if your hardware supports kvm acceleration or not.

Copy-pasting the shell command from the package description has proven to not always be easy enough, see link in my previous message. If you don't think that's sufficient justification, feel free to close the bug, of course.

Revision history for this message
Soren Hansen (soren) wrote : Re: [Bug 188878] Re: Utility to see if kvm acceleration can be used

On Tue, Feb 05, 2008 at 11:12:00PM -0000, Lars Wirzenius wrote:
> The value of the script is that it makes it easy to see if your hardware
> supports kvm acceleration or not.
>
> Copy-pasting the shell command from the package description has proven
> to not always be easy enough, see link in my previous message. If you
> don't think that's sufficient justification, feel free to close the bug,
> of course.

Well, this script would be in the kvm package, correct? The init script
in that package already provides this check whenever it's run.

I could add a "check" option to the init script to give roughly the same
output as you suggest.. Would that make you happy? :)

--
Soren Hansen
Virtualisation specialist
Ubuntu Server Team
http://www.ubuntu.com/

Revision history for this message
to be removed (liw) wrote :

I don't think running "/etc/init.d/kvm start" is as easy as running "kvm-ok" (or whatever command name you choose). It also tries to load a kernel module, which may be an unwanted side effect, but that's easily fixable by adding a new argument ("/etc/init.d/kvm check" or something).

If you add the command, you could call it from the init.d script, and centralize the checking.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Thanks for the report, Lars. I think such a utility would be useful too.

I'm attaching a debdiff that creates a /usr/bin/kvm-ok script. This script is loosely based on Lars' original. I've simplified it a bit, to a simple if/then/else statement. I strengthened the regular expression just a bit. And I removed the -v/--verbose option, as I think that's best handed by ">/dev/null" appendage by the caller, if necessary.

I dropped the script source in the debian/ dir, and install it to /usr/bin/kvm-ok. I think this should probably be pushed back upstream, if they want it.

:-Dustin

Changed in kvm:
assignee: nobody → kirkland
importance: Undecided → Wishlist
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kvm - 1:72+dfsg-1ubuntu4

---------------
kvm (1:72+dfsg-1ubuntu4) intrepid; urgency=low

  * debian/kvm-ok: simple script to determine of the cpu supports kvm
    acceleration (LP: #188878)
  * debian/rules: install the kvm-ok binary into /usr/bin/kvm-ok

 -- Dustin Kirkland <email address hidden> Mon, 22 Sep 2008 12:09:47 -0500

Changed in kvm:
status: In Progress → 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.