Hello, I'd like to ask what would be the best user space interface for generic guest<->host communication channel. The channel will be used to pass mouse events to/from a guest or by managements software to communicate with agents running in a guests or for something similar. The interfaces that are being considered are netlink socket (only datagram semantics, linux specific), new socket family or character device with different minor number for each channel. Which one better suits for the purpose? Is there other kind of interface to consider? New socket family looks like a good choice, but it would be nice to hear other opinions before starting to work on it. Thanks, -- Gleb.
On Wednesday 26 November 2008, Gleb Natapov wrote:> The interfaces that are being considered are netlink socket (only datagram > semantics, linux specific), new socket family or character device with > different minor number for each channel. Which one better suits for > the purpose? ?Is there other kind of interface to consider? New socket > family looks like a good choice, but it would be nice to hear other > opinions before starting to work on it.I think a socket and a pty both look reasonable here, but one important aspect IMHO is that you only need a new kernel driver for the guest, if you just use the regular pty support or Unix domain sockets in the host. Obviously, there needs to be some control over permissions, as a guest most not be able to just open any socket or pty of the host, so a reasonable approach might be that the guest can only create a socket or pty that can be opened by the host, but not vice versa. Alternatively, you create the socket/pty in host userspace and then allow passing that down into the guest, which creates a virtio device from it. Arnd <><
On Wed, Nov 26, 2008 at 04:07:01PM +0300, Evgeniy Polyakov wrote:> On Wed, Nov 26, 2008 at 02:39:19PM +0200, Gleb Natapov (gleb at redhat.com) wrote: > > The interfaces that are being considered are netlink socket (only datagram > > semantics, linux specific), new socket family or character device with > > different minor number for each channel. Which one better suits for > > the purpose? Is there other kind of interface to consider? New socket > > family looks like a good choice, but it would be nice to hear other > > opinions before starting to work on it. > > What about X (or whatever else) protocol running over host-guest network > device, which are in the kernel already? >I should have mentioned that in my original mail. We don't want to use IP stack for communication between host and guest for variety of reasons. User of the VM may interfere with our communication by mis configuring firewall for instance (and he/she may even not be aware that an OS running inside a VM). We also want be able to communicate with agent inside a guest even when guest's network is not yet configured. -- Gleb.
Possibly Parallel Threads
- Host<->guest channel interface advice needed
- [PATCH] AF_VMCHANNEL address family for guest<->host communication.
- [PATCH] AF_VMCHANNEL address family for guest<->host communication.
- [PATCH][RFC] vmchannel a data channel between host and guest.
- [PATCH][RFC] vmchannel a data channel between host and guest.