Linux@Eikelenboom.IT
2009-Apr-07 16:16 UTC
[Xen-devel] Passthrough of Serial port /dev/ttyS0 to PV and HVM domains problems
I''m trying to get the following working: Serial port (/dev/ttyS0) passthrough to a PV or HVM domain, together with xenfb and usb passthrough. passthrough of the serial port works fine in a PV without xenfb (and so without qemu) by using the following lines in the config: irq = [4] ioports = ["3f8-3ff"] by using vfb = [ ''vnc=1,vnclisten=0.0.0.0,vncunused=1'' ] it will use qemu, so the lines above don''t work anymore. Now it uses qemu which is the same for HVM and PVM using serial=''/dev/ttyS0'' in the config files doesn''t work, although it should according to the qemu manpages. using: echo "test" > /dev/ttyS0 on the host,and cat /dev/ttyS0 on the guest, to test it, it shows nothing on the guest when using serial=pty in the config file, and using using: echo "test" > /dev/pts/0 on the host,and cat /dev/ttyS0 on the guest, to test it, it shows the test string on the guest using: socat /dev/ttyS0 /dev/pts/0 works passing through the hardware serial port to the guest, but it''s not very elegant since the pts/0 could change. Questions: - Shouldn''t the serial=''/dev/ttyS0'' config option work in the first place for the qemu domains (PV or HVM) ? - is xenfb and thus x11 support indeed only available on PV''s using qemu ? - is there any other way to get sdl/vnc graphics in a domU together with serial port passthrough, without using external tools as socat ? - wouldn''t it be nice to have some sort of standardization in all the available passthrough options, or at least an overview in Dom0 of what is passthrouged to what in the different guest domains. There are quite a few variables at the moment: -xend-PV or qemu-PV/HVM. -PCI or USB or serial or parport passthrough. -with or without VT-D/iommu support. And it is difficult to find out the status (working/partially/not-working) of all these options it leads to. It also means there is not much documentation around. I hope anyone can help ... Regards, Sander Eikelenboom _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Sander Eikelenboom
2009-Apr-09 13:32 UTC
[Xen-devel] [Patch] fix Passthrough of Serial port to tty for qemu-dm (from qemu-upstream)
In upstream qemu my issue was fixed, see http://git.kernel.dk/?p=qemu.git;a=commit;h=b4abdfa4fbf4afaa7540ddaf814236e7844935ff also send a patch with this post. Passthrough of the hardware serial port to qemu works like a charm with my serial touchscreen to a xen HVM with linux or windows. Is it already possible to use upstream qemu instead of qemu-dm with xen, or is it still depending on modifications in it''s own qemu-dm ? -- Sander Eikelenboom --- qemu-char.c 2009-04-09 15:00:09.000000000 +0200 +++ qemu-char.c 2009-04-09 15:09:14.000000000 +0200 @@ -1055,37 +1055,48 @@ static int tty_serial_ioctl(CharDriverSt } break; case CHR_IOCTL_SERIAL_GET_TIOCM: { int sarg = 0; int *targ = (int *)arg; ioctl(s->fd_in, TIOCMGET, &sarg); *targ = 0; - if (sarg | TIOCM_CTS) + if (sarg & TIOCM_CTS) *targ |= CHR_TIOCM_CTS; - if (sarg | TIOCM_CAR) + if (sarg & TIOCM_CAR) *targ |= CHR_TIOCM_CAR; - if (sarg | TIOCM_DSR) + if (sarg & TIOCM_DSR) *targ |= CHR_TIOCM_DSR; - if (sarg | TIOCM_RI) + if (sarg & TIOCM_RI) *targ |= CHR_TIOCM_RI; - if (sarg | TIOCM_DTR) + if (sarg & TIOCM_DTR) *targ |= CHR_TIOCM_DTR; - if (sarg | TIOCM_RTS) + if (sarg & TIOCM_RTS) *targ |= CHR_TIOCM_RTS; } break; case CHR_IOCTL_SERIAL_SET_TIOCM: { int sarg = *(int *)arg; int targ = 0; - if (sarg | CHR_TIOCM_DTR) + ioctl(s->fd_in, TIOCMGET, &targ); + targ &= ~(CHR_TIOCM_CTS | CHR_TIOCM_CAR | CHR_TIOCM_DSR + | CHR_TIOCM_RI | CHR_TIOCM_DTR | CHR_TIOCM_RTS); + if (sarg & CHR_TIOCM_CTS) + targ |= TIOCM_CTS; + if (sarg & CHR_TIOCM_CAR) + targ |= TIOCM_CAR; + if (sarg & CHR_TIOCM_DSR) + targ |= TIOCM_DSR; + if (sarg & CHR_TIOCM_RI) + targ |= TIOCM_RI; + if (sarg & CHR_TIOCM_DTR) targ |= TIOCM_DTR; - if (sarg | CHR_TIOCM_RTS) + if (sarg & CHR_TIOCM_RTS) targ |= TIOCM_RTS; ioctl(s->fd_in, TIOCMSET, &targ); } break; default: return -ENOTSUP; } return 0; _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2009-Apr-14 11:06 UTC
Re: [Xen-devel] [Patch] fix Passthrough of Serial port to tty for qemu-dm (from qemu-upstream)
Sander Eikelenboom writes ("[Xen-devel] [Patch] fix Passthrough of Serial port to tty for qemu-dm (from qemu-upstream)"):> In upstream qemu my issue was fixed, see http://git.kernel.dk/?p=qemu.git;a=commit;h=b4abdfa4fbf4afaa7540ddaf814236e7844935ffThanks. I''ll look into pulling from the most recent qemu stable branch - which appears to contain this fix. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel