From e47726a50a3421262b6cb472e58d987d407f3e5e Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 26 Oct 2024 13:00:55 +0200 Subject: [PATCH] board/qemu/riscv{32, 64}-virt: do not use the default bus implicitly Qemu 9.1 recently fixed the RISC-V virt target by adding the missing default type for block devices [1]. But the qemu command line we use for RISC-V virt is slightly incorrect: -drive file=rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 With Qemu 9.1, this command line now rejected since it conflict with the new default bus: qemu-system-riscv64: -drive file=rootfs.ext2,format=raw,id=hd0: Drive 'hd0' is already in use because it has been automatically connected to another device (did you need 'if=none' in the drive options?) Since we are currently still using Qemu 9.0, apply the suggested change by adding 'if=none'. Note: '-drive file=rootfs.ext2,format=raw,id=hd0' can be removed in a followup patch after the qemu version bump 9.1 is merged. [1] https://gitlab.com/qemu-project/qemu/-/commit/4406ba2b5efce6af64905f827ca244f699db8170 [Romain: rework the commit log] Signed-off-by: Waldemar Brodkorb Signed-off-by: Romain Naour Signed-off-by: Thomas Petazzoni --- board/qemu/riscv32-virt/readme.txt | 4 ++-- board/qemu/riscv64-virt-efi/readme.txt | 2 +- board/qemu/riscv64-virt/readme.txt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/board/qemu/riscv32-virt/readme.txt b/board/qemu/riscv32-virt/readme.txt index 555924f949..048306cd54 100644 --- a/board/qemu/riscv32-virt/readme.txt +++ b/board/qemu/riscv32-virt/readme.txt @@ -1,7 +1,7 @@ Run Linux in emulation with: - qemu-system-riscv32 -M virt -bios output/images/fw_jump.elf -kernel output/images/Image -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic # qemu_riscv32_virt_defconfig + qemu-system-riscv32 -M virt -bios output/images/fw_jump.elf -kernel output/images/Image -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0,if=none -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic # qemu_riscv32_virt_defconfig - qemu-system-riscv32 -M virt -bios none -kernel output/images/Image -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -nographic -cpu rv32,mmu=off -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 # qemu_riscv32_nommu_virt_defconfig + qemu-system-riscv32 -M virt -bios none -kernel output/images/Image -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0,if=none -device virtio-blk-device,drive=hd0 -nographic -cpu rv32,mmu=off -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 # qemu_riscv32_nommu_virt_defconfig The login prompt will appear in the terminal that started Qemu. diff --git a/board/qemu/riscv64-virt-efi/readme.txt b/board/qemu/riscv64-virt-efi/readme.txt index 6b9651a011..c7b3177af1 100644 --- a/board/qemu/riscv64-virt-efi/readme.txt +++ b/board/qemu/riscv64-virt-efi/readme.txt @@ -22,7 +22,7 @@ Run the emulation with: -blockdev node-name=pflash0,driver=file,read-only=on,filename=output/images/RISCV_VIRT_CODE.fd \ -blockdev node-name=pflash1,driver=file,filename=output/images/RISCV_VIRT_VARS.fd \ \ - -drive file=output/images/disk.img,format=raw,id=hd0 \ + -drive file=output/images/disk.img,format=raw,id=hd0,if=none \ -device virtio-blk-device,drive=hd0 \ \ -netdev user,id=net0 \ diff --git a/board/qemu/riscv64-virt/readme.txt b/board/qemu/riscv64-virt/readme.txt index f1c7bf41b5..5b3bb85b4b 100644 --- a/board/qemu/riscv64-virt/readme.txt +++ b/board/qemu/riscv64-virt/readme.txt @@ -1,7 +1,7 @@ Run Linux in emulation with: - qemu-system-riscv64 -M virt -bios output/images/fw_jump.elf -kernel output/images/Image -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic # qemu_riscv64_virt_defconfig + qemu-system-riscv64 -M virt -bios output/images/fw_jump.elf -kernel output/images/Image -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0,if=none -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic # qemu_riscv64_virt_defconfig - qemu-system-riscv64 -M virt -bios none -kernel output/images/Image -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -nographic -cpu rv64,mmu=off -netdev user,id=net0 -device virtio-net-device,netdev=net0 # qemu_riscv64_nommu_virt_defconfig + qemu-system-riscv64 -M virt -bios none -kernel output/images/Image -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0,if=none -device virtio-blk-device,drive=hd0 -nographic -cpu rv64,mmu=off -netdev user,id=net0 -device virtio-net-device,netdev=net0 # qemu_riscv64_nommu_virt_defconfig The login prompt will appear in the terminal that started Qemu.