From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evMkJ-0008Fa-NQ for guix-patches@gnu.org; Mon, 12 Mar 2018 08:40:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evMkF-0006ov-Rj for guix-patches@gnu.org; Mon, 12 Mar 2018 08:40:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:48195) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1evMkF-0006oe-OB for guix-patches@gnu.org; Mon, 12 Mar 2018 08:40:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1evMkF-00030K-Fd for guix-patches@gnu.org; Mon, 12 Mar 2018 08:40:03 -0400 Subject: [bug#30604] [PATCH v10 4/6] vm: Make the virtio-blk uniquely identifiable in /sys. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 12 Mar 2018 13:39:16 +0100 Message-Id: <20180312123918.22645-4-ludo@gnu.org> In-Reply-To: <20180312123918.22645-1-ludo@gnu.org> References: <87ina1qxic.fsf@gnu.org> <20180312123918.22645-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 30604@debbugs.gnu.org From: Danny Milosavljevic * 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 --- 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