
On Tue, Feb 04, 2014 at 02:25:03PM +0100, Martin Kletzander wrote:
On Tue, Feb 04, 2014 at 01:34:38PM +0100, Christophe Fergeau wrote:
Regarding the way it's exposed, you have chosen to go with <devices> <serial type="spiceport"> <source channel="org.qemu.console.serial.0"/> <target port="1"/> </serial> </devices>
This exposes the 'org.qemu.console.serial.0' spiceport as a serial port in the guest. This spiceport can then be used by client applications to interact with the guest. This is very similar to what is done for the spice agent channel (a virtio serial port is made available in the guest and is used for client<->guest communication). Wouldn't it be more consistent to use <channel type="spiceport"> <target type="virtio" name="org.qemu.console.serial.0"/> </channel> here?
When I gave some thoughts about how to expose spiceport in libvirt, I got confused as in addition to this guest<->spice client channel, spiceport is much more generic and can also be used to create some host<->spice client channels (eg forward a local host socket/... over to the client through spice). If we use <channel>, maybe this can be added later with <channel type="spiceport"> <target type="host" name="org.qemu.console.serial.0"/> <source ... /> </channel> ? (thinking out loud, and something which can be added when there is need for it)
From the technical POV, you can interconnect spiceport as a source with any other target that qemu supports. [...]
In the example I went with using isa-serial as a target, because that was the usage mentioned in the mail thanks to which I started working on it [1], but I to meet your needs you can go with:
<channel type="spiceport"> <source channel="org.qemu.console.serial.0"/> <target type="virtio" name="whatever-name.you.want"/> </channel>
which works with this patch too
Ah, I missed this was possible, hence the comments. It would probably be worth it to add a !isa-serial example either to the documentation or to the commit log. Thanks for the detailed explanation!
P.S.: Due to spicevmc channel being implemented the way it is, it took me non-trivial amount of time to figure out how to expose this and I went through more "designs" before I figured this is just a backend, nothing else :)
Yeah, had trouble wrapping my head around exposing spiceport when I gave it a quick look, good that you managed to get on top of it ;) Christophe