I am using the following parameters to launch QEMU so that output from the guest would be redirected to the host console:-chardev stdio,id=virtiocon0-device virtio-serial-device virtconsole,chardev=virtiocon0I have the following questions:What do each of these flags mean?What kind of devices are created on both guest and host sides?Where should I look for the device on the host side (I actually want to read from it)?
How do these qemu parameters for stdout redirection work?
kvm;qemu;stdout
From the manpage:-chardev backend ,id=id [,mux=on|off] [,options]Backend is one of: null, socket, udp, msmouse, vc, ringbuf, file, pipe, console, serial, pty, stdio, braille, tty, parallel, parport,  spicevmc. spiceport. The specific backend will determine the  applicable options.All devices must have an id, which can be any string up to 127  characters long. It is used to uniquely identify this device in other  command line directives.And about the stdio backend in particular:-chardev stdio ,id=id [,signal=on|off]Connect to standard input and standard output of the QEMU process.So this one connects the chardev virtiocon0 with the qemu process' stdin/out.The other two are:-device driver[,prop[=value][,...]]  Add device driver. prop=value sets driver properties. Valid properties depend on the driver.The first driver, virtio-serial simply creates a communication channel between host and guest. This is necessary for the next driver.The last one, virtconsole creates a console device on the guest, attached to the chardev created before, which was attached to qemu's stdio/out.The guest can then use this console device like any other tty (e.g., call getty on it, etc.).The device created on the guest will depend on the kernel and how it was compiled, in linux it's usually /dev/hvc0.There's no device created on the host in this case, it's simply using stdin and stdout. Read from it on stdin and write to it on stdout.You can also redirect stdin and stdout to something else, or use a different chardev backend. Try socket or pipe.