[CentOS-virt] Setting up serial ports on kvm guests

Tue Jan 31 19:01:35 UTC 2012
James B. Byrne <byrnejb at harte-lyne.ca>


We have a dedicated CentOS-5.7 host used for fax reception
and transmission that we wish to move to a CentOS-6.2
virtual guest instance. The CentOS-6.2 virtual host has a
4-port serial card installed.

lspci -v tshows this this:

03:00.0 Serial controller: Oxford Semiconductor Ltd
OX16PCI954 (Quad 16950 UART) function 0 (Uart) (prog-if 06
        Subsystem: Oxford Semiconductor Ltd Device 0000
        Flags: medium devsel, IRQ 17
        I/O ports at d040 [size=32]
        Memory at d0702000 (32-bit, non-prefetchable)
        I/O ports at d020 [size=32]
        Memory at d0701000 (32-bit, non-prefetchable)
        Capabilities: [40] Power Management version 2
        Kernel driver in use: serial

setserial -g /dev/ttyS* shows this:

/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16950/954, Port: 0xd040, IRQ: 17
/dev/ttyS2, UART: 16950/954, Port: 0xd048, IRQ: 17
/dev/ttyS3, UART: 16950/954, Port: 0xd050, IRQ: 17

But, in virt-manage, when I try to add a serial device  to
the guest as the physical character device /dev/ttyS1 I
get this error and the device is not added.

XML error: unknown device type

Traceback (most recent call last):
line 1026, in add_device
  File "/usr/share/virt-manager/virtManager/domain.py",
line 698, in attach_device
  File "/usr/lib64/python2.6/site-packages/libvirt.py",
line 400, in attachDevice
    if ret == -1: raise libvirtError
('virDomainAttachDevice() failed', dom=self)
libvirtError: XML error: unknown device type

We wish to have at least two, preferably three, andf
ideally all four, serial ports enabled on the virtual
guest. Does anyone know how this is accomplished?

***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB at Harte-Lyne.ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3