Provide a kvm-less qemu / guix system vm

  • Done
  • quality assurance status badge
Details
5 participants
  • Jookia
  • Alex Kost
  • Christopher Allan Webber
  • Leo Famulari
  • Ludovic Courtès
Owner
unassigned
Submitted by
Christopher Allan Webber
Severity
normal

Debbugs page

Christopher Allan Webber wrote 9 years ago
(address . bug-guix@gnu.org)
87oabnqhv3.fsf@dustycloud.org
So on my Libreboot-enabled machine, KVM does not work. In fact, even
starting qemu with KVM enabled on it appears to crash my whole system.
Not only does "guix system vm" not work, even "guix system vm-image" can
take the whole machine down!

It would be nice to have a --no-kvm switch, because I'd really like to
make use of Guix's nice VM features!

PS: Apparently in future revisions of Libreboot, this will be fixed.
For now though...
Jookia wrote 9 years ago
(name . Christopher Allan Webber)(address . cwebber@dustycloud.org)(address . 22633@debbugs.gnu.org)
20160211225009.GA4943@novena-choice-citizen.lan
On Thu, Feb 11, 2016 at 09:26:12AM -0800, Christopher Allan Webber wrote:
Toggle quote (5 lines)
> So on my Libreboot-enabled machine, KVM does not work. In fact, even
> starting qemu with KVM enabled on it appears to crash my whole system.
> Not only does "guix system vm" not work, even "guix system vm-image" can
> take the whole machine down!

Currently the 'solution' I've found is to edit Guix to remove the two instances
of '--enable-kvm' which works somewhat, though it's slower as there's absolutely
no acceleration.

Toggle quote (3 lines)
> It would be nice to have a --no-kvm switch, because I'd really like to
> make use of Guix's nice VM features!

We should probably also blacklist kvm on Libreboot machines too somehow, though
this could also break it on non-Libreboot machines. I wonder if there's a way to
query the BIOS to see if Libreboot is enabled?

Toggle quote (3 lines)
> PS: Apparently in future revisions of Libreboot, this will be fixed.
> For now though...

Oh really? I was under the impression this was broken due to microcode issues.

Jookia.
Leo Famulari wrote 9 years ago
(name . Jookia)(address . 166291@gmail.com)
20160212004919.GB30668@jasmine
On Fri, Feb 12, 2016 at 09:50:09AM +1100, Jookia wrote:
Toggle quote (13 lines)
> On Thu, Feb 11, 2016 at 09:26:12AM -0800, Christopher Allan Webber wrote:
> > So on my Libreboot-enabled machine, KVM does not work. In fact, even
> > starting qemu with KVM enabled on it appears to crash my whole system.
> > Not only does "guix system vm" not work, even "guix system vm-image" can
> > take the whole machine down!
>
> Currently the 'solution' I've found is to edit Guix to remove the two instances
> of '--enable-kvm' which works somewhat, though it's slower as there's absolutely
> no acceleration.
>
> > It would be nice to have a --no-kvm switch, because I'd really like to
> > make use of Guix's nice VM features!

It's not a proper fix, but this patch achieves that on my non-Libreboot
machine. Can you see if it works for you?

[...]
Toggle diff (26 lines)
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index a095f9d..e4abcb2 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -97,7 +97,7 @@ the #:references-graphs parameter of 'derivation'."
(_ #f))
(unless (zero?
- (apply system* qemu "-enable-kvm" "-nographic" "-no-reboot"
+ (apply system* qemu "-nographic" "-no-reboot"
"-m" (number->string memory-size)
"-net" "nic,model=virtio"
"-virtfs"
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index a7c03bd..aa9c421 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -457,7 +457,7 @@ with '-virtfs' options for the host file systems listed in SHARED-FS."
"\" "))
#~(string-append
- " -enable-kvm -no-reboot -net nic,model=virtio \
+ " -no-reboot -net nic,model=virtio \
" #$@(map virtfs-option shared-fs) " \
-net user \
-serial stdio -vga std \
Ludovic Courtès wrote 9 years ago
(name . Jookia)(address . 166291@gmail.com)
87oabm2tfa.fsf@gnu.org
Jookia <166291@gmail.com> skribis:

Toggle quote (2 lines)
> We should probably also blacklist kvm on Libreboot machines too somehow,

A simple way to achieve this is with:

(operating-system
;; …
(kernel-arguments '("modprobe.blacklist=kvm-intel,kvm")))

But I guess ‘guix system vm’ will now fail.

We could change the two occurrences of ‘-enable-kvm’ to use this flag if
and only if /dev/kvm exists (I think it doesn’t exist when the kvm
modules are not loaded.)

Thoughts?

Ludo’.
Christopher Allan Webber wrote 9 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)
87ziv595xb.fsf@dustycloud.org
Ludovic Courtès writes:

Toggle quote (10 lines)
> Jookia <166291@gmail.com> skribis:
>
>> We should probably also blacklist kvm on Libreboot machines too somehow,
>
> A simple way to achieve this is with:
>
> (operating-system
> ;; …
> (kernel-arguments '("modprobe.blacklist=kvm-intel,kvm")))

I tried this:

(operating-system
(kernel linux-libre-4.1)
(kernel-arguments '("modprobe.blacklist=kvm-intel,kvm"))
...)

The generated Grub configuration looks right:

menuentry "GNU with Linux-Libre 4.1.17 (alpha)" {
search --label --set guix
linux /gnu/store/k3l4g22vypwniy0k3f8xha9l8p1s716d-linux-libre-4.1.17/bzImage --root=guix --system=/gnu/store/flq2702dmj6ppqc4iix6xgp0q364yl3l-system --load=/gnu/store/flq2702dmj6ppqc4iix6xgp0q364yl3l-system/boot modprobe.blacklist=kvm-intel,kvm
initrd /gnu/store/flq2702dmj6ppqc4iix6xgp0q364yl3l-system/initrd
}

Unfortunately, after rebooting into it:

cwebber@oolong:~$ lsmod | grep kvm
kvm_intel 155648 0
kvm 491520 1 kvm_intel
cwebber@oolong:~$ ls /dev/kvm
/dev/kvm

Not sure why it didn't seem to do anything...

Toggle quote (6 lines)
> But I guess ‘guix system vm’ will now fail.
>
> We could change the two occurrences of ‘-enable-kvm’ to use this flag if
> and only if /dev/kvm exists (I think it doesn’t exist when the kvm
> modules are not loaded.)

If we could really get kvm blocked, I could write this patch.

Toggle quote (3 lines)
> Thoughts?
>
> Ludo’.
Christopher Allan Webber wrote 9 years ago
(name . Leo Famulari)(address . leo@famulari.name)
87y4ap954w.fsf@dustycloud.org
Leo Famulari writes:

Toggle quote (19 lines)
> On Fri, Feb 12, 2016 at 09:50:09AM +1100, Jookia wrote:
>> On Thu, Feb 11, 2016 at 09:26:12AM -0800, Christopher Allan Webber wrote:
>> > So on my Libreboot-enabled machine, KVM does not work. In fact, even
>> > starting qemu with KVM enabled on it appears to crash my whole system.
>> > Not only does "guix system vm" not work, even "guix system vm-image" can
>> > take the whole machine down!
>>
>> Currently the 'solution' I've found is to edit Guix to remove the two instances
>> of '--enable-kvm' which works somewhat, though it's slower as there's absolutely
>> no acceleration.
>>
>> > It would be nice to have a --no-kvm switch, because I'd really like to
>> > make use of Guix's nice VM features!
>
> It's not a proper fix, but this patch achieves that on my non-Libreboot
> machine. Can you see if it works for you?
>
> [...]

Good news there, that does work and I am able to boot a VM through that
route!

I would really like to be able to protect myself from accidentally
crashing my system by making sure that if /dev/kvm is not there that we
don't do --enable-kvm, so maybe I could do that if we can figure out how
to make blacklisting actually work. In the meanwhile, maybe I should
add a --no-kvm flag to "guix system vm"?
Leo Famulari wrote 9 years ago
(name . Christopher Allan Webber)(address . cwebber@dustycloud.org)
20160213004714.GA27228@jasmine
On Fri, Feb 12, 2016 at 10:04:47AM -0800, Christopher Allan Webber wrote:
Toggle quote (30 lines)
> Leo Famulari writes:
>
> > On Fri, Feb 12, 2016 at 09:50:09AM +1100, Jookia wrote:
> >> On Thu, Feb 11, 2016 at 09:26:12AM -0800, Christopher Allan Webber wrote:
> >> > So on my Libreboot-enabled machine, KVM does not work. In fact, even
> >> > starting qemu with KVM enabled on it appears to crash my whole system.
> >> > Not only does "guix system vm" not work, even "guix system vm-image" can
> >> > take the whole machine down!
> >>
> >> Currently the 'solution' I've found is to edit Guix to remove the two instances
> >> of '--enable-kvm' which works somewhat, though it's slower as there's absolutely
> >> no acceleration.
> >>
> >> > It would be nice to have a --no-kvm switch, because I'd really like to
> >> > make use of Guix's nice VM features!
> >
> > It's not a proper fix, but this patch achieves that on my non-Libreboot
> > machine. Can you see if it works for you?
> >
> > [...]
>
> Good news there, that does work and I am able to boot a VM through that
> route!
>
> I would really like to be able to protect myself from accidentally
> crashing my system by making sure that if /dev/kvm is not there that we
> don't do --enable-kvm, so maybe I could do that if we can figure out how
> to make blacklisting actually work. In the meanwhile, maybe I should
> add a --no-kvm flag to "guix system vm"?

We definitely want to automatically disable KVM if it's not available.
But I think it would also be useful to have a --no-kvm option.
Alex Kost wrote 9 years ago
(name . Christopher Allan Webber)(address . cwebber@dustycloud.org)
87y4aozask.fsf@gmail.com
Christopher Allan Webber (2016-02-12 20:47 +0300) wrote:

Toggle quote (37 lines)
> Ludovic Courtès writes:
>
>> Jookia <166291@gmail.com> skribis:
>>
>>> We should probably also blacklist kvm on Libreboot machines too somehow,
>>
>> A simple way to achieve this is with:
>>
>> (operating-system
>> ;; …
>> (kernel-arguments '("modprobe.blacklist=kvm-intel,kvm")))
>
> I tried this:
>
> (operating-system
> (kernel linux-libre-4.1)
> (kernel-arguments '("modprobe.blacklist=kvm-intel,kvm"))
> ...)
>
> The generated Grub configuration looks right:
>
> menuentry "GNU with Linux-Libre 4.1.17 (alpha)" {
> search --label --set guix
> linux /gnu/store/k3l4g22vypwniy0k3f8xha9l8p1s716d-linux-libre-4.1.17/bzImage --root=guix --system=/gnu/store/flq2702dmj6ppqc4iix6xgp0q364yl3l-system --load=/gnu/store/flq2702dmj6ppqc4iix6xgp0q364yl3l-system/boot modprobe.blacklist=kvm-intel,kvm
> initrd /gnu/store/flq2702dmj6ppqc4iix6xgp0q364yl3l-system/initrd
> }
>
> Unfortunately, after rebooting into it:
>
> cwebber@oolong:~$ lsmod | grep kvm
> kvm_intel 155648 0
> kvm 491520 1 kvm_intel
> cwebber@oolong:~$ ls /dev/kvm
> /dev/kvm
>
> Not sure why it didn't seem to do anything...

I had the same issue. Some time ago I tried:

(kernel-arguments '("modprobe.blacklist=pcspkr"))

but "pcspkr" was also listed in lsmod.

--
Alex
Ludovic Courtès wrote 9 years ago
(name . Christopher Allan Webber)(address . cwebber@dustycloud.org)
87twl2xo6c.fsf@gnu.org
Christopher Allan Webber <cwebber@dustycloud.org> skribis:

Toggle quote (25 lines)
> I tried this:
>
> (operating-system
> (kernel linux-libre-4.1)
> (kernel-arguments '("modprobe.blacklist=kvm-intel,kvm"))
> ...)
>
> The generated Grub configuration looks right:
>
> menuentry "GNU with Linux-Libre 4.1.17 (alpha)" {
> search --label --set guix
> linux /gnu/store/k3l4g22vypwniy0k3f8xha9l8p1s716d-linux-libre-4.1.17/bzImage --root=guix --system=/gnu/store/flq2702dmj6ppqc4iix6xgp0q364yl3l-system --load=/gnu/store/flq2702dmj6ppqc4iix6xgp0q364yl3l-system/boot modprobe.blacklist=kvm-intel,kvm
> initrd /gnu/store/flq2702dmj6ppqc4iix6xgp0q364yl3l-system/initrd
> }
>
> Unfortunately, after rebooting into it:
>
> cwebber@oolong:~$ lsmod | grep kvm
> kvm_intel 155648 0
> kvm 491520 1 kvm_intel
> cwebber@oolong:~$ ls /dev/kvm
> /dev/kvm
>
> Not sure why it didn't seem to do anything...

Libkmod honors ‘modprobe.blacklist’ (in ‘kcmdline_parse_result’ in
libkmod-config.c) and eudev passes KMOD_PROBE_APPLY_BLACKLIST
unconditionally in udev-builtin-kmod.c (meaning it honors it too.)

However, there’s a hyphen-vs-underscore issue, I think. Namely, the
file is called ‘kvm-intel.ko’, but the normalized module name is
‘kvm_intel’, and this is what libkmod expects (commit 5c7dd5a changes
our code to normalize module names similarly.)

Could you try with “modprobe.blacklist=kvm_intel”?

TIA,
Ludo’.
Ludovic Courtès wrote 9 years ago
(name . Alex Kost)(address . alezost@gmail.com)
87oabaxo1t.fsf@gnu.org
Alex Kost <alezost@gmail.com> skribis:

Toggle quote (6 lines)
> I had the same issue. Some time ago I tried:
>
> (kernel-arguments '("modprobe.blacklist=pcspkr"))
>
> but "pcspkr" was also listed in lsmod.

I can’t reproduce it. Do you have a system config that exhibits this in
‘guix system vm’?

Note that the ‘modprobe pcspkr’ will load the module; you have to use
‘modprobe --use-blacklist pcspkr’ if you want it to honor the black list
(which is a questionable default IMO.)

Thanks,
Ludo’.
Christopher Allan Webber wrote 9 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)
87si0k8th9.fsf@dustycloud.org
Ludovic Courtès writes:

Toggle quote (11 lines)
> Libkmod honors ‘modprobe.blacklist’ (in ‘kcmdline_parse_result’ in
> libkmod-config.c) and eudev passes KMOD_PROBE_APPLY_BLACKLIST
> unconditionally in udev-builtin-kmod.c (meaning it honors it too.)
>
> However, there’s a hyphen-vs-underscore issue, I think. Namely, the
> file is called ‘kvm-intel.ko’, but the normalized module name is
> ‘kvm_intel’, and this is what libkmod expects (commit 5c7dd5a changes
> our code to normalize module names similarly.)
>
> Could you try with “modprobe.blacklist=kvm_intel”?

I tried it, and it works! This does mean that /dev/kvm doesn't exist,
so I should be able to write a patch to Guix that disables kvm for qemu
when /dev/kvm is absent. Great! :)
Christopher Allan Webber wrote 9 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 22633@debbugs.gnu.org)
87r3g48rnh.fsf@dustycloud.org
Christopher Allan Webber writes:

Toggle quote (17 lines)
> Ludovic Courtès writes:
>
>> Libkmod honors ‘modprobe.blacklist’ (in ‘kcmdline_parse_result’ in
>> libkmod-config.c) and eudev passes KMOD_PROBE_APPLY_BLACKLIST
>> unconditionally in udev-builtin-kmod.c (meaning it honors it too.)
>>
>> However, there’s a hyphen-vs-underscore issue, I think. Namely, the
>> file is called ‘kvm-intel.ko’, but the normalized module name is
>> ‘kvm_intel’, and this is what libkmod expects (commit 5c7dd5a changes
>> our code to normalize module names similarly.)
>>
>> Could you try with “modprobe.blacklist=kvm_intel”?
>
> I tried it, and it works! This does mean that /dev/kvm doesn't exist,
> so I should be able to write a patch to Guix that disables kvm for qemu
> when /dev/kvm is absent. Great! :)

This is slightly based off of Leo's preliminary patch, so I included him
in the copyright headers. I've tested and it works (in terms of
disabling kvm if no /dev/kvm is present) here.

Let me know if I need to fix something or if I should push...
From 852e0049213a0a80cacdcad4aba13ab242c3fbd8 Mon Sep 17 00:00:00 2001
From: Christopher Allan Webber <cwebber@dustycloud.org>
Date: Mon, 22 Feb 2016 11:23:14 -0800
Subject: [PATCH] vm: Only pass "-enable-kvm" to qemu if /dev/kvm is present.

* gnu/build/vm.scm (load-in-linux-vm): Only pass "-enable-kvm" flag to qemu
if "/dev/kvm" is present.
* gnu/system/vm.scm (common-kvm-options): Same as above.
---
gnu/build/vm.scm | 19 ++++++++++++++-----
gnu/system/vm.scm | 10 +++++++++-
2 files changed, 23 insertions(+), 6 deletions(-)

Toggle diff (72 lines)
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index a095f9d..823156d 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -1,5 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
+;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -97,7 +99,7 @@ the #:references-graphs parameter of 'derivation'."
(_ #f))
(unless (zero?
- (apply system* qemu "-enable-kvm" "-nographic" "-no-reboot"
+ (apply system* qemu "-nographic" "-no-reboot"
"-m" (number->string memory-size)
"-net" "nic,model=virtio"
"-virtfs"
@@ -111,10 +113,17 @@ the #:references-graphs parameter of 'derivation'."
"-initrd" initrd
"-append" (string-append "console=ttyS0 --load="
builder)
- (if make-disk-image?
- `("-drive" ,(string-append "file=" image-file
- ",if=virtio"))
- '())))
+ (append
+ (if make-disk-image?
+ `("-drive" ,(string-append "file=" image-file
+ ",if=virtio"))
+ '())
+ ;; Only enable kvm if we see /dev/kvm exists.
+ ;; This allows uers without hardware virtualization to still use these
+ ;; commands.
+ (if (file-exists? "/dev/kvm")
+ '("-enable-kvm")
+ '()))))
(error "qemu failed" qemu))
(if make-disk-image?
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index a7c03bd..5235ee3 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -1,5 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
+;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -457,7 +459,13 @@ with '-virtfs' options for the host file systems listed in SHARED-FS."
"\" "))
#~(string-append
- " -enable-kvm -no-reboot -net nic,model=virtio \
+ ;; Only enable kvm if we see /dev/kvm exists.
+ ;; This allows uers without hardware virtualization to still use these
+ ;; commands.
+ #$(if (file-exists? "/dev/kvm")
+ " -enable-kvm "
+ "")
+ " -no-reboot -net nic,model=virtio \
" #$@(map virtfs-option shared-fs) " \
-net user \
-serial stdio -vga std \
--
2.6.3
Jookia wrote 9 years ago
(name . Christopher Allan Webber)(address . cwebber@dustycloud.org)
20160222194302.GA7176@novena-choice-citizen.lan
On Mon, Feb 22, 2016 at 11:35:30AM -0800, Christopher Allan Webber wrote:
Toggle quote (15 lines)
> #~(string-append
> - " -enable-kvm -no-reboot -net nic,model=virtio \
> + ;; Only enable kvm if we see /dev/kvm exists.
> + ;; This allows uers without hardware virtualization to still use these
> + ;; commands.
> + #$(if (file-exists? "/dev/kvm")
> + " -enable-kvm "
> + "")
> + " -no-reboot -net nic,model=virtio \
> " #$@(map virtfs-option shared-fs) " \
> -net user \
> -serial stdio -vga std \
> --
> 2.6.3

What if I enable KVM then run the script?

Jookia.
Ludovic Courtès wrote 9 years ago
(name . Christopher Allan Webber)(address . cwebber@dustycloud.org)(address . 22633@debbugs.gnu.org)
87bn78moz3.fsf@gnu.org
Christopher Allan Webber <cwebber@dustycloud.org> skribis:

Toggle quote (23 lines)
> Christopher Allan Webber writes:
>
>> Ludovic Courtès writes:
>>
>>> Libkmod honors ‘modprobe.blacklist’ (in ‘kcmdline_parse_result’ in
>>> libkmod-config.c) and eudev passes KMOD_PROBE_APPLY_BLACKLIST
>>> unconditionally in udev-builtin-kmod.c (meaning it honors it too.)
>>>
>>> However, there’s a hyphen-vs-underscore issue, I think. Namely, the
>>> file is called ‘kvm-intel.ko’, but the normalized module name is
>>> ‘kvm_intel’, and this is what libkmod expects (commit 5c7dd5a changes
>>> our code to normalize module names similarly.)
>>>
>>> Could you try with “modprobe.blacklist=kvm_intel”?
>>
>> I tried it, and it works! This does mean that /dev/kvm doesn't exist,
>> so I should be able to write a patch to Guix that disables kvm for qemu
>> when /dev/kvm is absent. Great! :)
>
> This is slightly based off of Leo's preliminary patch, so I included him
> in the copyright headers. I've tested and it works (in terms of
> disabling kvm if no /dev/kvm is present) here.

Cool! Can you just double-check whether -enable-kvm has any effect when
/dev/kvm is missing? If it has no effect when /dev/kvm is missing, then
we don’t even need a patch.

Toggle quote (11 lines)
> Let me know if I need to fix something or if I should push...
>
> From 852e0049213a0a80cacdcad4aba13ab242c3fbd8 Mon Sep 17 00:00:00 2001
> From: Christopher Allan Webber <cwebber@dustycloud.org>
> Date: Mon, 22 Feb 2016 11:23:14 -0800
> Subject: [PATCH] vm: Only pass "-enable-kvm" to qemu if /dev/kvm is present.
>
> * gnu/build/vm.scm (load-in-linux-vm): Only pass "-enable-kvm" flag to qemu
> if "/dev/kvm" is present.
> * gnu/system/vm.scm (common-kvm-options): Same as above.

[...]

Toggle quote (2 lines)
> + ;; Only enable kvm if we see /dev/kvm exists.
> + ;; This allows uers without hardware virtualization to still use these
^^
Typo.

[...]

Toggle quote (3 lines)
> + ;; Only enable kvm if we see /dev/kvm exists.
> + ;; This allows uers without hardware virtualization to still use these

Ditto.

Otherwise the patch LGTM. Make sure to mention:


in the commit log.

Thanks,
Ludo’.
Christopher Allan Webber wrote 9 years ago
(name . Jookia)(address . 166291@gmail.com)
87mvqs8mhc.fsf@dustycloud.org
Jookia writes:

Toggle quote (20 lines)
> On Mon, Feb 22, 2016 at 11:35:30AM -0800, Christopher Allan Webber wrote:
>> #~(string-append
>> - " -enable-kvm -no-reboot -net nic,model=virtio \
>> + ;; Only enable kvm if we see /dev/kvm exists.
>> + ;; This allows uers without hardware virtualization to still use these
>> + ;; commands.
>> + #$(if (file-exists? "/dev/kvm")
>> + " -enable-kvm "
>> + "")
>> + " -no-reboot -net nic,model=virtio \
>> " #$@(map virtfs-option shared-fs) " \
>> -net user \
>> -serial stdio -vga std \
>> --
>> 2.6.3
>
> What if I enable KVM then run the script?
>
> Jookia.

Then it should use KVM.
Christopher Allan Webber wrote 9 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 22633-done@debbugs.gnu.org)
87lh6c8mc2.fsf@dustycloud.org
Ludovic Courtès writes:

Toggle quote (29 lines)
> Christopher Allan Webber <cwebber@dustycloud.org> skribis:
>
>> Christopher Allan Webber writes:
>>
>>> Ludovic Courtès writes:
>>>
>>>> Libkmod honors ‘modprobe.blacklist’ (in ‘kcmdline_parse_result’ in
>>>> libkmod-config.c) and eudev passes KMOD_PROBE_APPLY_BLACKLIST
>>>> unconditionally in udev-builtin-kmod.c (meaning it honors it too.)
>>>>
>>>> However, there’s a hyphen-vs-underscore issue, I think. Namely, the
>>>> file is called ‘kvm-intel.ko’, but the normalized module name is
>>>> ‘kvm_intel’, and this is what libkmod expects (commit 5c7dd5a changes
>>>> our code to normalize module names similarly.)
>>>>
>>>> Could you try with “modprobe.blacklist=kvm_intel”?
>>>
>>> I tried it, and it works! This does mean that /dev/kvm doesn't exist,
>>> so I should be able to write a patch to Guix that disables kvm for qemu
>>> when /dev/kvm is absent. Great! :)
>>
>> This is slightly based off of Leo's preliminary patch, so I included him
>> in the copyright headers. I've tested and it works (in terms of
>> disabling kvm if no /dev/kvm is present) here.
>
> Cool! Can you just double-check whether -enable-kvm has any effect when
> /dev/kvm is missing? If it has no effect when /dev/kvm is missing, then
> we don’t even need a patch.

I checked yes; qemu fails.

Toggle quote (25 lines)
>> Let me know if I need to fix something or if I should push...
>>
>> From 852e0049213a0a80cacdcad4aba13ab242c3fbd8 Mon Sep 17 00:00:00 2001
>> From: Christopher Allan Webber <cwebber@dustycloud.org>
>> Date: Mon, 22 Feb 2016 11:23:14 -0800
>> Subject: [PATCH] vm: Only pass "-enable-kvm" to qemu if /dev/kvm is present.
>>
>> * gnu/build/vm.scm (load-in-linux-vm): Only pass "-enable-kvm" flag to qemu
>> if "/dev/kvm" is present.
>> * gnu/system/vm.scm (common-kvm-options): Same as above.
>
> [...]
>
>> + ;; Only enable kvm if we see /dev/kvm exists.
>> + ;; This allows uers without hardware virtualization to still use these
> ^^
> Typo.
>
> [...]
>
>> + ;; Only enable kvm if we see /dev/kvm exists.
>> + ;; This allows uers without hardware virtualization to still use these
>
> Ditto.

Okay, fixed those.

Toggle quote (6 lines)
> Otherwise the patch LGTM. Make sure to mention:
>
> Fixes <http://bugs.gnu.org/22633>.
>
> in the commit log.

Mentioned, committed, pushed!
Closed
Alex Kost wrote 9 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 22633@debbugs.gnu.org)
87oab7onl0.fsf@gmail.com
Ludovic Courtès (2016-02-21 15:09 +0300) wrote:

Toggle quote (11 lines)
> Alex Kost <alezost@gmail.com> skribis:
>
>> I had the same issue. Some time ago I tried:
>>
>> (kernel-arguments '("modprobe.blacklist=pcspkr"))
>>
>> but "pcspkr" was also listed in lsmod.
>
> I can’t reproduce it. Do you have a system config that exhibits this in
> ‘guix system vm’?

Oops, my bad. Since I use my own "grub.cfg", obviously it wasn't
updated :-)

Now I confirm that adding "modprobe.blacklist=pcspkr" argument to
'linux' line works. Sorry for the noize.

--
Alex
Ludovic Courtès wrote 9 years ago
(name . Christopher Allan Webber)(address . cwebber@dustycloud.org)(address . 22633-done@debbugs.gnu.org)
87ziuriev1.fsf@gnu.org
Christopher Allan Webber <cwebber@dustycloud.org> skribis:

Toggle quote (2 lines)
> Mentioned, committed, pushed!

Thanks!

Ludo'.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 22633@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 22633
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help