It's probably too late for you, but your question could be of general interest.
If your serial port (or USB port or whatever) can be identified as PCI device, you can avoid XS to take into control that device and let manage it by guest OS.
lspci
to list devices and choose which one represents your serial port, in the following example the serial port PCI id is 02:00.0
01:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS 2108 [Liberator] (rev 05)
02:00.0 Serial controller: MosChip Semiconductor Technology Ltd. PCIe 9922 Multi-I/O Controller
05:00.0 USB controller: Renesas Technology Corp. uPD720202 USB 3.0 Host Controller (rev 02)
edit the /boot/extlinux.conf
and look for "label xe" line, that identifies your boot default configuration; on the row beginning with "append /boot...", there are parameters; after "splash" add another parameter as "pciback.hide=(02.00.0)", where you should put in parenthesis the same PCI id you had found before. If the PCI devices you want to pass to guest are multiple, list them each one enclosed in parenthesis, separated by blanks, as in the example.
label xe
# XenServer
kernel mboot.c32
append /boot/xen.gz mem=1024G dom0_max_vcpus=4 dom0_mem=752M,max:752M watchdog_timeout=300 lowmem_emergency_pool=1M crashkernel=64M@32M cpuid_mask_xsave_eax=0 console=vga vga=mode-0x0311 --- /boot/vmlinuz-2.6-xen root=LABEL=root-mvyxdjwc ro xencons=hvc console=hvc0 console=tty0 quiet vga=785 splash pciback.hide=(05:00.0) (02:00.0) (00:1d.0) --- /boot/initrd-2.6-xen.img
Save the file, issue the extlinux -i /boot
command and reboot your server.
Now you should assign the PCI device(s) to the VM you want to manage them. Although there are more ways to get the UUID of a VM, you can list them all with xe vm-list
command and choose the right one from the resulting list. In the example the wanted UUID is a82769ff-9dc4-56bb-61f9-57d741162a14
uuid ( RO) : a82769ff-9dc4-56bb-61f9-57d741162a14
name-label ( RW): sersrv03.xyz.lan
power-state ( RO): running
And finally, the command that tells the VM to take into direct charge the PCI device(s) is the following, where you put the UUID of the wanted VM and the PCI id's of the PCI devices. In the example, there are two PCI devices listed, separated by comma.
xe vm-param-set other-config:pci=0/0000:02:00.0,0/0000:00:1d.0 uuid=a82769ff-9dc4-56bb-61f9-57d741162a14
Start the relevant VM and check if the new hardware is correctly detected.
This method comes from here, thanks to sotech for sharing.
Notes
- Of course your device will be tied to a specific VM.
- If your application depends on that specific PCI device, forget moving the VM elsewhere.
- If your device is not listed as PCI, you are out of luck.
- Not all devices are suitable to be managed this way. I had my bad time with an USB controlled UPS, that refused to be managed with this sort of passthrough.
- I agree that TomTom's suggestion is the most general and canonical way to solve the problem with a serial port.