qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Spice-devel] [Qemu-devel] RFC: usb redirection over the network, in


From: Paul Brook
Subject: Re: [Spice-devel] [Qemu-devel] RFC: usb redirection over the network, interesting outside of spice?
Date: Wed, 1 Dec 2010 11:04:57 +0000
User-agent: KMail/1.13.5 (Linux/2.6.36-trunk-amd64; KDE/4.4.5; x86_64; ; )

> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]