5

Let's take this example (I spent several hours to make it work):

qemu-system-x86_64 ... \
-kernel $HOME/devel/vmlinuz-5.11.0-22-generic            \
-drive ...                                               \
-append 'earlyprintk=hvc0 console=hvc0 root=/dev/sda rw' \ (0)
-device virtio-serial-pci,id=virtio-serial0              \ (1)
-chardev stdio,id=charconsole0                           \ (2)
-device virtconsole,chardev=charconsole0,id=console0       (3)

What do those options do? My understanding is that

  • (2) tells qemu to create host end-point of tty/console and "binds" it to qemu's stdio.
  • (3) tells qemu what devices should be exposed to the guest, and also specifies that charconsole0 should be used as the other end, which is effectively qemu's stdio.
    • But what is virtconsole?
    • What is the difference between virtconsole and virtserialport or virtio-serial-pci?
  • What does (1) do? Where does its name: virtio-serial-pci come from?
  • How do I know that virtconsole device in the guest will be identified with the name hvc0 (so that I could specify it in (0))?

1 Answer 1

1

virtconsole is really just a specialised virtio-serial link. Each -device specifies a new device so in your example you have two virtio-serial devices. The virtio-serial-pci device behaves exactly like virtio-serial except it is on the PCI bus rather than the MMIO bus.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.