GNU bug report logs - #30604
[PATCH 0/4] Load Linux module only when supported hardware is present.

Previous Next

Package: guix-patches;

Reported by: Danny Milosavljevic <dannym <at> scratchpost.org>

Date: Sun, 25 Feb 2018 11:47:02 UTC

Severity: important

Tags: patch

Full log


Message #332 received at 30604 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 30604 <at> debbugs.gnu.org
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>,
 Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH v11 4/6] vm: Make the virtio-blk uniquely identifiable in /sys.
Date: Mon, 12 Mar 2018 23:15:39 +0100
From: Danny Milosavljevic <dannym <at> scratchpost.org>

* gnu/build/vm.scm (load-in-linux-vm): Set virtio-blk pci addr to 0x10.
* gnu/system/vm.scm (common-qemu-options): Set virtio-blk pci addr to 0x10.

Signed-off-by: Ludovic Courtès <ludo <at> gnu.org>
---
 gnu/build/vm.scm  | 6 +++++-
 gnu/system/vm.scm | 7 ++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index fe003ea45..773b738ae 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -154,7 +154,11 @@ the #:references-graphs parameter of 'derivation'."
                                            builder)
                   (append
                    (if make-disk-image?
-                       `("-device" "virtio-blk,drive=myhd"
+
+                       ;; QEMU seems to have a bug that it doesn't assign PCI
+                       ;; IDs properly, so force the address of our virtio-blk
+                       ;; device.
+                       `("-device" "virtio-blk-pci,addr=0x10,drive=myhd"
                          "-drive" ,(string-append "if=none,file=" output
                                                   ",format=" disk-image-format
                                                   ",id=myhd"))
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 91ff32ce9..4360adf15 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -677,7 +677,12 @@ with '-virtfs' options for the host file systems listed in SHARED-FS."
 
      #$@(map virtfs-option shared-fs)
      "-vga std"
-     (format #f "-drive file=~a,if=virtio,cache=writeback,werror=report,readonly"
+
+     ;; QEMU seems to have a bug that it doesn't assign PCI IDs properly, so
+     ;; force the address of our virtio-blk device.
+     "-device" "virtio-blk-pci,addr=0x10,drive=myhd"
+
+     (format #f "-drive id=myhd,file=~a,if=none,cache=writeback,werror=report,readonly"
              #$image)))
 
 (define* (system-qemu-image/shared-store-script os
-- 
2.16.2





This bug report was last modified 5 years and 305 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.