[Top][All Lists]

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

Re: No 'virtio-bus' bus found for device 'virtio-blk-device' - Error

From: Peter Maydell
Subject: Re: No 'virtio-bus' bus found for device 'virtio-blk-device' - Error
Date: Mon, 31 Jul 2023 10:52:34 +0100

On Sun, 30 Jul 2023 at 21:32, Swedha R <swedhar10@gmail.com> wrote:
> Hi ,
> when I run this following command , I am facing this problem for all machine 
> types rather that virt.
> qemu-system-riscv64 -M sifive_u -bios fw_jump.elf -kernel Image -append 
> "rootwait root=/dev/vda ro" -drive file=rootfs.ext2,format=raw,id=hd0 -device 
> virtio-blk-pci,drive=hd0 -netdev user,id=net0 -device 
> virtio-net-device,netdev=net0 -nographic

virtio devices come in two parts:
 * a backend which does the actual work (blk, net, etc)
 * a transport which handles how that is exposed to the guest
   (pci, mmio, s390 channel controller, etc)

In some cases we also provide "convenience wrapper" devices
which create both the backend and the transport with a
single -device option. virtio-blk-pci is a wrapper device
(as you can see from the name that has both 'blk' the backend
and 'pci' the transport in it).

virtio-net-device is a virtio backend only. The error message
is telling you there was no transport to plug it into. As
a -device option, it only works for either:
 * boards which support the virtio-mmio transport (of the riscv
   boards, only virt has this support)
 * command lines where you explicitly create a virtio-pci transport
   (this is such an odd thing to do that I forget if it even
   works ;-))

As a general rule of thumb, the PCI transport is the best
for all situations where it will work (i.e. where the board
has a PCI controller and the guest OS is happy with doing
PCI enumeration etc).

Since your command line has a virtio-blk-pci device on it,
presumably you're OK with virtio-over-pci. So you
should use -device virtio-net-pci and not use virtio-mmio
at all (even on the virt board). Then your use of virtio
is consistent for all the virtio devices you're using,
rather than being oddly split between two transport types.

-- PMM

reply via email to

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