guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#30604] [PATCH v11 4/6] vm: Make the virtio-blk uniquely identifiabl


From: Ludovic Courtès
Subject: [bug#30604] [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 <address@hidden>

* 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 <address@hidden>
---
 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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]