[Spice-devel] [Qemu-devel] RFC: usb redirection over the network, interesting outside of spice?
Paul Brook
paul at codesourcery.com
Wed Dec 1 03:04:57 PST 2010
> Hi,
>
> On 11/30/2010 12:32 PM, Alon Levy wrote:
> > On Tue, Nov 30, 2010 at 12:26:56PM +0100, Hans de Goede wrote:
> <snip snip>
>
> >> Then there would be multiple ways to add a virtual usb device using
> >> usb-net-redir.c to the virtual machine. One way of adding such a device
> >> could be starting a tcp/ip server on a machine with an interesting usb
> >> device, say 192.168.1.100:2222 and then in the monitor type:
> >> usb_add net:192.168.1.100:2222:[vid]:[pid]
> >> or:
> >> usb_add net:192.168.1.100:2222:[busnr]:[addr]
> >
> > Wouldn't you want to add a usb_add net:host:port that would just export
> > anything it has decided to export? or is this just the next step?
>
> The idea is one channel (one socket in this case), one device. This way the
> same server on the usb-host could export multiple devices, using one
> client connection per device. The server of course should in the end have
> some sort of security wrt which devices the vm-host can connect to and
> which not.
I don't think either of vid:pid or bus:address are a good idea for identifying
remote devices. The idea that the VM should need to know about the details of
the USB topology of the remote machine seems fundamentally wrong. It also
means that it's impossible to use devices that reset+reconnect themselves.
Instead I suggest just using a freeform string ID. For practical reasons we
probably want to restrict this to regular characters, like we do other ids
(i.e. [-_A-Za-z0-9]). This allows the device server to assign persistent,
meaningful names to devices. If you really want to allow the VM free reign of
devices on a machine you can just make it the server accept and parse names of
the form device_id_1234_5678 (for example).
For bonus points your protocol should include some way of enumerating the
available devices.
When tunneling over spice/vnc I'd expect the same id to be used. i.e.
net:<host:port>:[device_id]
spice:[sice_display]:[device_id]
vnc:[vnc_display>]:[device_id]
Paul
More information about the Spice-devel
mailing list