RFC: usb redirection over the network, interesting outside of spice?
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines
Hi All,
Now that I have usb-1.1 passthrough / local redirection support working reliably (see my patch sets for this), I'm going to start working on doing usb redirection support over the network.
Quoted 6 lines
The idea here is that a usb device connected to machine a, will be available for use by the guest os running on host b (machine b).
I'm working on this because it is something which we want / need for spice. I'm wondering if there is interest in this outside of spice ?
Not me at the moment, but unless you tunnel it inside another protocol, you'd really want to look at the existing USB-over-IP protocols instead of reinventing the wheel:
http://usbip.sourceforge.net/ (some support in Linux already IIRC)
(and there are others which I don't recall)
Quoted 3 lines
I'm asking because at this moment in time the redirection support can probably be written in a way which abstracts the transport channel quite easily, allowing use outside of spice.
Yeah it'd be nice to avoid code duplication.
Does RDP have such feature ?
I'd think it should be possible to add this to VNC somehow, since it has provisions for extensions.
François.
Hi,
Quoted 5 lines
Not me at the moment, but unless you tunnel it inside another protocol, you'd really want to look at the existing USB-over-IP protocols instead of reinventing the wheel:
http://usbip.sourceforge.net/ (some support in Linux already IIRC) (and there are others which I don't recall)
Doesn't look very useful on a quick glance.
First: Yes, we wanna embed this into other protocol(s).
Second, seems usbip is implemented using special drivers in kernel space for both sides. We will not need special drivers on the qemu side (we just hook up the devices to the emulated hci). On the client side using libusb looks alot more sensible than requiring kernel modules.
cheers,
Gerd
Quoted 8 lines
Quoted 5 lines
Not me at the moment, but unless you tunnel it inside another protocol, you'd really want to look at the existing USB-over-IP protocols instead of reinventing the wheel:
http://usbip.sourceforge.net/ (some support in Linux already IIRC) (and there are others which I don't recall)Doesn't look very useful on a quick glance.
I'm note sure about what I will say, but will a kernel approach handle specific disconnection/reconnection of devices, that libusb cannot?
I'm thinking in particular of what happens when one updates an iP* (*=hone, ad, odTouch, od) device, where it gets connected and disconnected several times during the process. During the updates, the device reboots, generating a disconnection event, and at reboot the guest OS (and iTunes) has to to catch the reconnection event directly (before iOS loads) to upload the new firmware. I'm not sure about it, but I think Virtualbox (non-ose) took care of this issue, and updates are now possible in a vm (TbC).
I don't think that an approach at libusb level would work, while I could understand that a kernel module would be able to catch the "connection" event directly, and pipe it through the network to the guest.
I don't know for sure if this use case affects only those devices, nor if it is an objective for spice to allow Apple device updates, but I think it has to be handled at pretty low level, so is worth mentioning before any implementation choices. Still, if such thing were to work, I think it would be a huge step for all the people in the iP* community that maintain a double boot only because they bought a closed phone once :-)
However, the guest side could be handled at qemu-level, since it would certainly provide an OS-independent implementation without the need for linux-/windows-/other-specific driver.
Frederic.
Hi,
Quoted 3 lines
I'm note sure about what I will say, but will a kernel approach handle specific disconnection/reconnection of devices, that libusb cannot?
Don't know, didn't investigate (yet) what libusb can do and what it can't.
cheers,
Gerd
Hi,
I guess it should be abstract enough to support multiple back-ends, be it a kernel driver or through libusb?
Rgrds,
Attila
2010/11/29 Gerd Hoffmann <[email protected]>
Quoted 20 lines
Hi,
I'm note sure about what I will say, but will a kernel approach
Quoted 3 lines
handle specific disconnection/reconnection of devices, that libusb cannot?
Don't know, didn't investigate (yet) what libusb can do and what it can't.
cheers,
Gerd_______________________________________________
Spice-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/spice-devel
Quoted 3 lines · Attila Sukosd
Hi,
I guess it should be abstract enough to support multiple back-ends, be it a kernel driver or through libusb?
Is this something that should just live in libusb?
If what libusb presented QEMU was actually implemented as USB-over-IP, QEMU wouldn't know the difference at all. I think it would also be very useful to be able for libusb-based applications to work with remote devices.
What is unclear to me is what role QEMU would play in setting up remove USB-over-IP devices. Pushing it down to the libusb layer completely takes QEMU out the picture which creates a clean separation layer. There are emulated devices in QEMU which we create and control and then there are passthrough devices that QEMU doesn't have any role in creating.
Regards,
Anthony Liguori
Quoted 31 lines
Rgrds,
Attila
2010/11/29 Gerd Hoffmann <[email protected] <mailto:[email protected]>>
Hi,
I'm note sure about what I will say, but will a kernel approach handle specific disconnection/reconnection of devices, that libusb cannot?
Don't know, didn't investigate (yet) what libusb can do and what it can't.
cheers,
Gerd_______________________________________________
Spice-devel mailing list
[email protected]
<mailto:[email protected]>
http://lists.freedesktop.org/mailman/listinfo/spice-devel
Quoted 11 lines · Anthony Liguori
Quoted 4 lines · Attila Sukosd
Hi,
I guess it should be abstract enough to support multiple back-ends, be it a kernel driver or through libusb?
Is this something that should just live in libusb?
If what libusb presented QEMU was actually implemented as USB-over-IP, QEMU wouldn't know the difference at all. I think it would also be very useful to be able for libusb-based applications to work with remote devices.
What is unclear to me is what role QEMU would play in setting up remove USB-over-IP devices. Pushing it down to the libusb layer completely takes QEMU out the picture which creates a clean separation layer. There are emulated devices in QEMU which we create and control and then there are passthrough devices that QEMU doesn't have any role in creating.
I agree. And if by any chance the libusb interfaces don't cut it, we should just enhance libusb.
Alex
Hi,
Quoted 9 lines · Anthony Liguori
Quoted 3 lines · Attila Sukosd
Hi,
I guess it should be abstract enough to support multiple back-ends, be it a kernel driver or through libusb?
Is this something that should just live in libusb?
If what libusb presented QEMU was actually implemented as USB-over-IP, QEMU wouldn't know the difference at all. I think it would also be very useful to be able for libusb-based applications to work with remote devices.
Well currently qemu is not using libusb but instead talking to usbfs directly when it comes to usb pass through. This is something worth looking into fixing (as doing the usbfs stuff ourselves is not nice), but looking at the smartcard support discussion I was left with the impression that using external libraries was deemed undesirable.
Even if qemu's usb pass through code were to use libusb though, I don't think that putting network direction into libusb is a good idea though. This clearly falls outside libusb's original design goals, and would require some major work on libusb. And although libusb upstream is not entirely dead, it also is not the most alive upstream either.
Quoted 1 line
What is unclear to me is what role QEMU would play in setting up remove USB-over-IP devices.
That would depend on the scenario, The way I see this is we get a usb-net-redir.c which sends packets through / from a real usb device like usb-linux.c does, but then over some reliable ordered transport channel.
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]
Another way would be for a spice client (viewer) to indicate through the spice main channel that it has a usb device which it wants to plug into the virtual machine, and the qemu spice code then adding this device to the vm, using a spice channel as the transport
Another way would be using a vnc client and somehow one of the sides indicating they want / are providing a usb device on the vnc client machine to show up inside the vm
Quoted 1 line
Pushing it down to the libusb layer completely takes QEMU out the picture which creates a clean separation layer. There are emulated devices in QEMU which we create and control and then there are passthrough devices that QEMU doesn't have any role in creating.
IMHO the above 3 scenarios clearly indicates that when it comes to the device management (adding / removing) qemu needs to be involved.
I plan to write and submit a RFC for the protocol over the reliable ordered transport channel today + tomorrow, and once that is in place I'll start with focussing on making it possible to do:usb_add net:192.168.1.100:2222:[vid]:[pid]
Assuming that a usb device sharing server is running and ready to accept connections on 192.168.1.100:2222
Regards,
Hans
Quoted 29 lines · Hans de Goede
Hi,
Quoted 9 lines · Anthony Liguori
Quoted 3 lines · Attila Sukosd
Hi,
I guess it should be abstract enough to support multiple back-ends, be it a kernel driver or through libusb?
Is this something that should just live in libusb?
If what libusb presented QEMU was actually implemented as USB-over-IP, QEMU wouldn't know the difference at all. I think it would also be very useful to be able for libusb-based applications to work with remote devices.
Well currently qemu is not using libusb but instead talking to usbfs directly when it comes to usb pass through. This is something worth looking into fixing (as doing the usbfs stuff ourselves is not nice), but looking at the smartcard support discussion I was left with the impression that using external libraries was deemed undesirable.
Even if qemu's usb pass through code were to use libusb though, I don't think that putting network direction into libusb is a good idea though. This clearly falls outside libusb's original design goals, and would require some major work on libusb. And although libusb upstream is not entirely dead, it also is not the most alive upstream either.
Quoted 1 line
What is unclear to me is what role QEMU would play in setting up remove USB-over-IP devices.
That would depend on the scenario, The way I see this is we get a
usb-net-redir.cwhich sends packets through / from a real usb device likeusb-linux.cdoes, but then over some reliable ordered transport channel.
Quoted 7 lines
Then there would be multiple ways to add a virtual usb device using
usb-net-redir.cto 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_addnet:192.168.1.100:2222:[vid]:[pid]
or:usb_addnet: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?
Quoted 30 lines
Another way would be for a spice client (viewer) to indicate through the spice main channel that it has a usb device which it wants to plug into the virtual machine, and the qemu spice code then adding this device to the vm, using a spice channel as the transport
Another way would be using a vnc client and somehow one of the sides indicating they want / are providing a usb device on the vnc client machine to show up inside the vm
Quoted 1 line
Pushing it down to the libusb layer completely takes QEMU out the picture which creates a clean separation layer. There are emulated devices in QEMU which we create and control and then there are passthrough devices that QEMU doesn't have any role in creating.
IMHO the above 3 scenarios clearly indicates that when it comes to the device management (adding / removing) qemu needs to be involved.
I plan to write and submit a RFC for the protocol over the reliable ordered transport channel today + tomorrow, and once that is in place I'll start with focussing on making it possible to do:
usb_addnet:192.168.1.100:2222:[vid]:[pid]Assuming that a usb device sharing server is running and ready to accept connections on 192.168.1.100:2222
Regards,
Hans
_______________________________________________
Spice-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/spice-devel
Hi,
Quoted 1 line · Alon Levy
On Tue, Nov 30, 2010 at 12:26:56PM +0100, Hans de Goede wrote:
<snip snip>
Quoted 11 lines
Quoted 7 lines
Then there would be multiple ways to add a virtual usb device using
usb-net-redir.cto 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_addnet:192.168.1.100:2222:[vid]:[pid]
or:usb_addnet:192.168.1.100:2222:[busnr]:[addr]Wouldn't you want to add a
usb_addnet: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.
Regards,
Hans
Quoted 14 lines
Hi,
Quoted 1 line · Alon Levy
On Tue, Nov 30, 2010 at 12:26:56PM +0100, Hans de Goede wrote:
<snip snip>
Quoted 8 lines
Quoted 7 lines
Then there would be multiple ways to add a virtual usb device using
usb-net-redir.cto 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_addnet:192.168.1.100:2222:[vid]:[pid]
or:usb_addnet:192.168.1.100:2222:[busnr]:[addr]
Quoted 8 lines
Quoted 2 lines
Wouldn't you want to add a
usb_addnet: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
Hi,
Quoted 35 lines · Paul Brook
Quoted 14 lines
Hi,
Quoted 1 line · Alon Levy
On Tue, Nov 30, 2010 at 12:26:56PM +0100, Hans de Goede wrote:
<snip snip>
Quoted 8 lines
Quoted 7 lines
Then there would be multiple ways to add a virtual usb device using
usb-net-redir.cto 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_addnet:192.168.1.100:2222:[vid]:[pid]
or:usb_addnet:192.168.1.100:2222:[busnr]:[addr]Quoted 8 lines
Quoted 2 lines
Wouldn't you want to add a
usb_addnet: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).
Quoted 3 lines
For bonus points your protocol should include some way of enumerating the available devices.
First of all management (enumeration, requesting a specific device) is something which I want to do separately from the usb redirection protocol itself as management is transport specific, see below.
Quoted 4 lines
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]
In the spice and vnc cases I do not expect there to be a way to connect to devices on the client from the monitor. Instead the client will tell qemu through some sort of command channel, that there is a remote usb device to be plugged into the virtual machine through redirection.
This is what makes most sense from a use case pov. A user is sitting behind some client machine connecting to a vm through vnc / spice and then wants to "plug" some local (to the client machine) usb device into the vm. The logical way to do this is through some menu / other UI part of the vnc / spice client. This menu would then show a list of all currently connected devices and allow the user to choose one to plug in.
The problem with exotic devices which disconnect and come back under a different guise then also becomes a client problem, which is IMHO where it belongs (the client could for example remember which usb-port it is redirecting to the virtual machine and if a device unplug / replug happens there also redirect the new device).
Thinking more about this, the solution to the whole device id problem is not sending a device id from qemu / the monitor at all, iow:
net:<host:port>:[device_id]
Becomes just:
net:<host:port>
In this scenario a server already needs to be started manually on the usb-host, the device / port to share can then be indicated when starting the server.
And in the rare case one wants to share multiple devices/ports on the same usb-host one can simply start the server multiple times listening on different ports.
Regards,
Hans
Quoted 12 lines
Quoted 12 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
usb_addnet:192.168.1.100:2222:[vid]:[pid]
or:usb_addnet:192.168.1.100:2222:[busnr]:[addr]...
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 formdevice_id_1234_5678(for example).
Quoted 6 lines
Quoted 2 lines
For bonus points your protocol should include some way of enumerating the available devices.
First of all management (enumeration, requesting a specific device) is something which I want to do separately from the usb redirection protocol itself as management is transport specific, see below.
Except that by having a way of specifying the remote device you are implicitly including some form management interface. However...
Quoted 10 lines
Thinking more about this, the solution to the whole device id problem is not sending a device id from qemu / the monitor at all, iow:
net:<host:port>:[device_id]Becomes just:
net:<host:port>In this scenario a server already needs to be started manually on the usb-host, the device / port to share can then be indicated when starting the server.
This sounds reasonable.
On a tangential note, it's worth considering whether we want to support passthrough of a hub (including all connected devices).
My suspicion is this may be more trouble than it's worth. Instead make this the responsibility of the management layer. If we want to create the appearance of a physical hub being connected to a VM, then the management layer should leave the hub itself alone and automatically passthrough all the individual downstream devices.
Paul
Quoted 8 lines · Anthony Liguori
Quoted 4 lines · Attila Sukosd
Hi,
I guess it should be abstract enough to support multiple back-ends, be it a kernel driver or through libusb?
Is this something that should just live in libusb?
Quoted 7 lines
If what libusb presented QEMU was actually implemented as USB-over-IP, QEMU wouldn't know the difference at all. I think it would also be very useful to be able for libusb-based applications to work with remote devices.
What is unclear to me is what role QEMU would play in setting up remove USB-over-IP devices. Pushing it down to the libusb layer completely takes QEMU out the picture which creates a clean separation layer.
Well, I think the management is actually the most tricky thing here. Unfortunaly this isn't covered very well in the usb/ip papers. Also there seems to be no protocol specification linked from the website.
Being compatible at protocol level makes sense for direct connections (if possible). For the usb-over-vnc and vnc-over-spice cases this probably isn't going to work though.
cheers,
Gerd
Quoted 8 lines
Hi,Quoted 5 lines
Not me at the moment, but unless you tunnel it inside another protocol, you'd really want to look at the existing USB-over-IP protocols instead of reinventing the wheel:
http://usbip.sourceforge.net/ (some support in Linux already IIRC) (and there are others which I don't recall)
Quoted 8 lines
Doesn't look very useful on a quick glance.
First: Yes, we wanna embed this into other protocol(s).
Second, seems usbip is implemented using special drivers in kernel space for both sides. We will not need special drivers on the qemu side (we just hook up the devices to the emulated hci). On the client side using libusb looks alot more sensible than requiring kernel modules.
I don't know how good the usp/ip stuff is, but I'd be very reluctant to invent yet annother remote-usb protocol. USB is very hairy, so there's good reason to go with something that has already been tested.
IMO the ability to interact with the native kernel support is a feature in its own right. If we end up with a libusb implementation of the usb/ip device end, then that only seems like a good thing - you potentialy get testing coverage from both qemu users and native vhci-hcd users.
Paul
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
The idea here is that a usb device connected to machine a, will be available for use by the guest os running on host b (machine b).
I'm working on this because it is something which we want / need for spice. I'm wondering if there is interest in this outside of spice ?
I'm asking because at this moment in time the redirection support can probably be written in a way which abstracts the transport channel quite easily, allowing use outside of spice.
[...]
Quoted 11 lines
Quoted 5 lines
Not me at the moment, but unless you tunnel it inside another protocol, you'd really want to look at the existing USB-over-IP protocols instead of reinventing the wheel:
http://usbip.sourceforge.net/ (some support in Linux already IIRC) (and there are others which I don't recall)Doesn't look very useful on a quick glance.
First: Yes, we wanna embed this into other protocol(s).
Second, seems usbip is implemented using special drivers in kernel space for both sides. We will not need special drivers on the qemu side (we just hook up the devices to the emulated hci). On the client side using libusb looks alot more sensible than requiring kernel modules.
I recall seeing discussions about it on the libusb-devel list (CCing).
http://search.gmane.org/?query=usbip&group=gmane.comp.lib.libusb.devel.general
It's just one implementation of it, it should be possible to implement a subset of the features at least with libusb which should be enough for most devices (scanners/printers/mass storage).
And it's better to use the same protocol anyway when possible.
This way the untunnelled version could be used from QEMU or a host using a stub driver connecting to a server using either the kernel driver or the libusb version regardless.
François.
Quoted 1 line · François Revol
Quoted 1 line
usbip
I don't know how good this is.
For another implementation of USB-over-IP you could look at Sun's work with the SunRay thin clients. I believe some of it may be in the OpenUSB codebase. (They forked libusb to make it work the way they wanted.) I don't know how good that is, either.
Quoted 2 lines
Quoted 2 lines
On the client side using libusb looks alot more sensible than requiring kernel modules.
..
Quoted 3 lines
It's just one implementation of it, it should be possible to implement a subset of the features at least with libusb which should be enough for most devices (scanners/printers/mass storage).
Keep in mind that libusb can be used only with USB interfaces which have the usbfs driver bound to them. (Or no driver at all, in which case usbfs is transparently bound at libusb_claim_interface() time.)
This means that any kernel driver (like usb-storage) must be moved out of the way. This can be done with libusb, but not portably. Given sufficient permissions it works nicely and on the fly in Linux, but Mac OS X needs manual work and a reboot, and Windows needs to create a restore point. On Windows the libwdi library can be used to switch drivers for USB interfaces. http://libusb.org/wiki/libwdi
I have been mulling over if libusb should actually take on the significant task of USB kernel driver management, offering a portable API also for that. In principle I would very much prefer not to do this within libusb, but it is relevant because libusb does require that special kernel driver. Unfortunately it is so painful outside Linux.
Quoted 4 lines
And it's better to use the same protocol anyway when possible. This way the untunnelled version could be used from QEMU or a host using a stub driver connecting to a server using either the kernel driver or the libusb version regardless.
I doubt USB-over-IP is a good enough USB transport for QEMU. I think QEMU will want lower level access to the bus. One way is to leverage libusb, but even that might not be good enough in the long run.
//Peter
[Qemu-devel] Using usbip for usb network redirection (was RFC: usb redirection over the network, interesting outside of spice?)
In reply to Gerd HoffmannHi,
First some definitions:
vm-host: machine running the qemu virtual machine with the guest os usb-host: machine which has the usb device which "appears" inside the vm
Quoted 10 lines · Gerd Hoffmann
Hi,
Quoted 5 lines
Not me at the moment, but unless you tunnel it inside another protocol, you'd really want to look at the existing USB-over-IP protocols instead of reinventing the wheel:
http://usbip.sourceforge.net/ (some support in Linux already IIRC) (and there are others which I don't recall)Doesn't look very useful on a quick glance.
I already was aware of usbip and had looking into it on my todo. As multiple people have pointed out the existence and possible o.t.s. usage of usbip I've spend some time taking a (much) closer look at usbip, esp. At the protocol it uses.
Quoted 1 line
First: Yes, we wanna embed this into other protocol(s).
Well, we could do that with the current usbip protocol as long as we create a virtual channel for it inside those other protocols
Quoted 1 line
Second, seems usbip is implemented using special drivers in kernel space for both sides. We will not need special drivers on the qemu side (we just hook up the devices to the emulated hci). On the client side using libusb looks alot more sensible than requiring kernel modules.
Agreed. Note though that there already is a libusb using implementation for the software running on the usb-host (what you call client and the usbip people call server).
As for the vm-host, yes we cannot reuse the usbip software there, but talking the same protocol as them would still be good, as that allows re-using the usbip usb-host software.
Still overall I agree with you that usbip is not very useful:
1) It is dead upstream
2) The libusb version of the usb-host software is quite ugly code (as the author admits it is a quick hack developed according to the test it, fix it, test it, till it works cycle).
3) The protocol itself is far from ideal.
Number 3 is the big deal breaker for me. I've looked at the (undocumented) protocol by sifting through the source. And it is very low level, all it does is shove usb packets back and forth over the network. It has no concept of configuration setting (the docs say make sure the device is in the right configuration before sharing it). No concept of caching things like descriptors, active configuration, per interface alt setting, etc.
Besides missing a lot of useful smarts the whole one packet at a time approach does not really fly when it comes to isoc endpoints. As there paper states, the vm-host / guest os drivers need to make sure enough packets are submitted / queued at all time to gap the network delay / fill the network pipe.
For iso endpoints it makes much more sense to have a start / stop stream model, where the usb-host "pumpes" the urb ringbuffer and sends out data received from the usb device to the vm-host (isoc input endp case), or sends data received from the vm-host (through a buffer to deal with network jitter) to the isoc output endpoint.
This also halves the number of packets which need to be send over the network, as their is no need for the vm-host to send a request for each packet once an input stream has started / for the usb-host to send an ack for each delivered packet for an ouput stream. It would still send an error when an error occurs, but their is no reason to ack all delivered packets. Given the delay caused by buffering, etc. not being able to match up the error to an exact packet is not important, as from the vm-host emulated usb hc (host controller), the packet has long been delivered already.
Instead we will simply report the error to the guest os for the next packet enqueued by the guest after receiving notification of the error from the usb-host.
Regards,
Hans