module blacklisting not respected

Bug #484807 reported by oger000
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
qemu-kvm (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Binary package hint: qemu-kvm

ad 1) ubuntu 9.10
ad 2) qemu-kvm 0.11.0-0ubuntu6.3
ad 3) The script /etc/init.d/qemu-kvm should respect the blacklisting system of modprobe (/etc/modprobe.d/blacklist-xxx.conf for example).
ad 4) The kvm modules are loaded even if blacklisted.

If you are interested why the issue arises: The kvm modules conflict with virualbox and I dont want to modify the init scripts by hand especally because there is infrastructure to handle this in another way.

Patch attached.

Revision history for this message
oger000 (oger000-deactivatedaccount) wrote :
Revision history for this message
Soren Hansen (soren) wrote : Re: [Bug 484807] [NEW] module blacklisting not respected

On Wed, Nov 18, 2009 at 02:59:35PM -0000, oger000 wrote:
> ad 1) ubuntu 9.10
> ad 2) qemu-kvm 0.11.0-0ubuntu6.3
> ad 3) The script /etc/init.d/qemu-kvm should respect the blacklisting system of modprobe (/etc/modprobe.d/blacklist-xxx.conf for example).
> ad 4) The kvm modules are loaded even if blacklisted.
>
> If you are interested why the issue arises: The kvm modules conflict
> with virualbox and I dont want to modify the init scripts by hand
> especally because there is infrastructure to handle this in another way.

I presume you need this because you're using qemu-kvm to emulate other
architectures? Otherwise, why not just remove qemu-kvm instead of
fiddling with blacklists?

Revision history for this message
Soren Hansen (soren) wrote : Re: [Bug 484807] Re: module blacklisting not respected

On Wed, Nov 18, 2009 at 02:59:35PM -0000, oger000 wrote:
> ** Attachment added: "Use --use-blacklist paramter when loading the kvm modules"
> http://launchpadlibrarian.net/35825330/qemu-kvm.oebatch01

I think it will seem confusing that the init script says "Loading kvm
module [OK]", yet the module isn't loaded. I don't know if modprobe
offers a way to check whether a module /would/ be loaded by "modprobe
-b". If it does, we can check earlier and simply not echo anything at
all.

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 484807] [NEW] module blacklisting not respected

I have both virtualbox-ose and qemu-kvm installed on my Karmic system.

When I want to run virtualbox, I first run:
 $ sudo service qemu-kvm stop
which unloads the kvm module, and then I can run virtualbox.

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

On Wed, Nov 18, 2009 at 08:34:27PM -0000, Dustin Kirkland wrote:
> I have both virtualbox-ose and qemu-kvm installed on my Karmic system.
>
> When I want to run virtualbox, I first run:
> $ sudo service qemu-kvm stop
> which unloads the kvm module, and then I can run virtualbox.

What happens if the kvm module is loaded when you run VirtualBox?

Revision history for this message
oger000 (oger000-deactivatedaccount) wrote : Re: [Bug 484807] Re: module blacklisting not respected

Soren Hansen schrieb:
> On Wed, Nov 18, 2009 at 02:59:35PM -0000, oger000 wrote:
>> ** Attachment added: "Use --use-blacklist paramter when loading the kvm modules"
>> http://launchpadlibrarian.net/35825330/qemu-kvm.oebatch01
>
> I think it will seem confusing that the init script says "Loading kvm
> module [OK]", yet the module isn't loaded. I don't know if modprobe
> offers a way to check whether a module /would/ be loaded by "modprobe
> -b". If it does, we can check earlier and simply not echo anything at
> all.
>

Good point - I will have to improve my quick hack ;-)

--
O(ettl) GER(hard)

Revision history for this message
oger000 (oger000-deactivatedaccount) wrote : Re: [Bug 484807] [NEW] module blacklisting not respected

Soren Hansen schrieb:
> On Wed, Nov 18, 2009 at 02:59:35PM -0000, oger000 wrote:
>> ad 1) ubuntu 9.10
>> ad 2) qemu-kvm 0.11.0-0ubuntu6.3
>> ad 3) The script /etc/init.d/qemu-kvm should respect the blacklisting system of modprobe (/etc/modprobe.d/blacklist-xxx.conf for example).
>> ad 4) The kvm modules are loaded even if blacklisted.
>>
>> If you are interested why the issue arises: The kvm modules conflict
>> with virualbox and I dont want to modify the init scripts by hand
>> especally because there is infrastructure to handle this in another way.
>
> I presume you need this because you're using qemu-kvm to emulate other
> architectures? Otherwise, why not just remove qemu-kvm instead of
> fiddling with blacklists?

Visualbox is in daily usage on my workstation. Also needed from other users who
share my desktop one day a week when I am out. Virtualbox stops starting (with
appropriate message) when kvm modules (kvm_intel) are loaded. This other users
have no root access, I have. I have some rare cases where I need qemu-kvm,
testing usb-stick images. So my idea was to disable (blacklist) the kvm-modules
and do a manual "modprobe kvm_intel" when I need it.

The other way would be something like "update-rc.d -f kvm remove" (untested).
But I think blacklisting is the "intended" way to configure that specific
modules should not be loaded at boot time. So I'll try to improve my patch to go
this route.

--
O(ettl) GER(hard)

Revision history for this message
oger000 (oger000-deactivatedaccount) wrote : Re: [Bug 484807] Re: module blacklisting not respected

Soren Hansen schrieb:
> On Wed, Nov 18, 2009 at 02:59:35PM -0000, oger000 wrote:
>> ** Attachment added: "Use --use-blacklist paramter when loading the kvm modules"
>> http://launchpadlibrarian.net/35825330/qemu-kvm.oebatch01
>
> I think it will seem confusing that the init script says "Loading kvm
> module [OK]", yet the module isn't loaded. I don't know if modprobe
> offers a way to check whether a module /would/ be loaded by "modprobe
> -b".

Not direct, but by checking the output of modprobe -v for the sting "insmod".

> If it does, we can check earlier and simply not echo anything at
> all.

I modified the patch accordingly.

The patch works for me, for others there has to be the decision: If the weakness
of depending on the output of modprobe is too strong, you can close this bug
withou applying the patch. If you think the check stable enough please apply.

gerhard

Mathias Gug (mathiaz)
Changed in qemu-kvm (Ubuntu):
importance: Undecided → Wishlist
status: New → Confirmed
status: Confirmed → Triaged
Revision history for this message
AmenophisIII (amenophisiii) wrote :

the annoyance of this problem is, that you have to find out why kvm_intel is loaded, although you have set up a blacklist for it.
if i put something on a presumable system-wide blacklist, i dont expect it to be loaded in another way.

it this patch is not included, than the manpage of modprobe.d should mention, that there may be other mechanisms loading modules, it can not control imho.

redhat had a similar bug https://bugzilla.redhat.com/show_bug.cgi?id=383921
and i noticed quite a few postings regarding blacklisting kvm_* on the ubuntuforums (most of them without a hint to this bug).

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

This is now fixed in Lucid's qemu-kvm, which has converted /etc/init.d/qemu-kvm into an upstart script, which uses modprobe -b.

Changed in qemu-kvm (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
AmenophisIII (amenophisiii) wrote :

kvm was patched so that it does not block other VMMs, if it is just loaded but not used.
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=10474ae8945ce08622fd1f3464e55bd817bf2376
this is afaik included in 2.6.33 (eventually released in the next days).

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.