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
charconsole0should be used as the other end, which is effectively qemu's stdio.- But what is
virtconsole? - What is the difference between
virtconsoleandvirtserialportorvirtio-serial-pci?
- But what is
- What does (1) do? Where does its name:
virtio-serial-pcicome from? - How do I know that
virtconsoledevice in the guest will be identified with the namehvc0(so that I could specify it in (0))?