Virtio Serial Device How To

Asked by Anton Nayshtut on 2013-04-30

How To create, test and use the Virtio Serial Device

Question information

Language:
English Edit question
Status:
Open
For:
netanya-obsolete Edit question
Assignee:
No assignee Edit question
Last query:
2013-04-30
Last reply:

Basic info: https://fedoraproject.org/wiki/Features/VirtioSerial

To add VirtIO PCI Serial device via QEMU command line:

        -device virtio-serial-pci,id=virtio_serial_pci0,addr=0x07

To add VirtIO PCI Serial device Port via QEMU command line:

        -chardev socket,id=devvc1,path=/tmp/virtio_port-vc1,server,nowait \
        -device virtconsole,chardev=devvc1,name=pvlib.0,id=vc1,bus=virtio_serial_pci0.0

Thus, to add one VirtIO PCI Serial device with one port attached:

        -device virtio-serial-pci,id=virtio_serial_pci0,addr=0x07 \
        -chardev socket,id=devvc1,path=/tmp/virtio_port-vc1,server,nowait \
        -device virtconsole,chardev=devvc1,name=pvlib.0,id=vc1,bus=virtio_serial_pci0.0

Please refer to lp:~daynix/netanya/trunk/PVTools/PVLib.sh that adds one VirtIO PCI Serial device with two port attached.

Once you have a port created, you should be able to see:
 - On the Host: corresponding socket file (/tmp/virtio_port-vc1)
 - On the Guest: corresponding DosDevice file (\\.\pvlib.0)

On the Host, the socket file can be accessed using socat tool (http://www.dest-unreach.org/socat/doc/socat.html)

On the Guest, the DosDevice file can be accessed by some standard console tools and techniques (like IO streams redirection, type etc.), however lots of standard applications doesn't support or partially support DosDevice files.

Can you help with this problem?

Provide an answer of your own, or ask Anton Nayshtut for more information if necessary.

To post a message you must log in.