Re: [Qemu-devel] Re: virtio-serial: An interface for host-guest communication

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Gerd Hoffmann
Date: Monday, August 10, 2009 - 2:47 am

On 08/10/09 08:55, Amit Shah wrote:

I think the naming is very important.  The guest needs to know who is 
listening on the other end of the line.  I think a sysfs attribute (as 
suggested by Jamie IIRC) will work nicely here.  So each device gets a 
property called 'class' or 'protocol' or something simliar named, 
therein a string which specifies the protocol it speaks.


Host side would look like this:

   -virtioserial port=4,protocol=clipboard

... in case the protocol is implemented in qemu or like this:

   -virtioserial port=2,protocol=libguestfs,char=unix:something

... for stuff provided by external apps.


Within the guest the two lines above would create vmch4 and vmch2, both 
having a protocol attribute, and udev then can create symlinks named by 
protocol, i.e.

   /dev/vmchannel/clipboard  symlinked to /dev/vmch4    and
   /dev/vmchannel/libguestfs symlinked to /dev/vmch2

The port=<nr> attribute can be optional and dynamically auto-allocated 
by default.



reverse fqdn name space is a good idea.  We don't need a central 
protocol name registry then.  The examples above would then become 
something like this:

   protocol=orq.qemu.clipboard    and
   protocol=org.libguestfs.fish

... and within the guest

   /dev/vmchannel/org/qemu/clipboard  and
   /dev/vmchannel/org/libguestfs/fish



I think virtio-serial is the better way to handle vmchannel.  Unlike usb 
virtio is designed to work nicely in a virtual environment.

But vmchannel-over-usbserial should be easy too though in case some 
guests lacks virtio backports or something.  I think you can just stick 
a name like "vmchannel:orq.qemu.clipboard" into the usbserial product 
name, then have udev match that and create
   /dev/vmchannel/org/qemu/clipboard symlinking to /dev/ttyUSB<nr>

Voila, you can switch transports and the apps don't even notice.

cheers,
   Gerd
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 2/3] vnc: add a is_vnc_active() helper, Amit Shah, (Mon Jul 27, 11:04 am)
Re: virtio-serial: An interface for host-guest communication, Anthony Liguori, (Mon Jul 27, 1:22 pm)
Re: [Qemu-devel] Re: virtio-serial: An interface for host- ..., Daniel P. Berrange, (Mon Jul 27, 1:32 pm)
Re: [Qemu-devel] Re: virtio-serial: An interface for host- ..., Richard W.M. Jones, (Tue Jul 28, 7:00 am)
Re: [Qemu-devel] Re: virtio-serial: An interface for host- ..., Richard W.M. Jones, (Tue Jul 28, 7:55 am)
Re: [Qemu-devel] Re: virtio-serial: An interface for host- ..., Richard W.M. Jones, (Wed Aug 5, 11:32 am)
Re: [Qemu-devel] Re: virtio-serial: An interface for host- ..., Gerd Hoffmann, (Mon Aug 10, 2:47 am)
Re: [Qemu-devel] Re: virtio-serial: An interface for host- ..., Daniel P. Berrange, (Thu Aug 20, 7:25 am)