[Spice-devel] The second client cannot redirect USB

Frediano Ziglio freddy77 at gmail.com
Mon Nov 21 12:46:48 UTC 2022


Il giorno lun 21 nov 2022 alle ore 08:44 韩雪峰 <hanxuefeng at 360.cn> ha scritto:

> Hi,
>
> Thanks for your reply. But If I want to support multiple channels for USB
> redirection when multiple clients connect to a same VM,  do you know which
> project includes the code about USB channels ?   Spice ? or QEMU?
>
>
>
> Thanks and Regards,
>
> Xuefeng
>
>
Channels are a SPICE thing. But you will find surprisingly few code in
SPICE (at least the server). The reason is that SPICE in this case mostly
forwards data from/to usbredir (which is another project). In details Qemu
uses usbredir to handle a USB device for the guest. This device is attached
to spice-server which handles SPICE channels. A spice client (like
spice-gtk) connects to SPICE USB channels and forward data from either a
physical device or an emulated device (currently spice-gtk handles an
emulated CD/DVD device).
Currently each SPICE USB channel is bound to a single Qemu device (I doubt
it makes sense to bind it to multiple devices but it could in theory not be
bound to a device).
Note that spice-server currently only forward data (presented like a
pipe/stream) to/from client to the device, the hard lifting is made by
Qemu/usbredir.

Frediano


>
> *发件人:* Frediano Ziglio <freddy77 at gmail.com>
> *发送时间:* 2022年11月18日 20:52
> *收件人:* 韩雪峰 <hanxuefeng at 360.cn>
> *抄送:* spice-devel at lists.freedesktop.org
> *主题:* Re: [Spice-devel] The second client cannot redirect USB
>
>
>
> Il giorno ven 18 nov 2022 alle ore 10:21 韩雪峰 <hanxuefeng at 360.cn> ha
> scritto:
>
> Hello,
>
>
>
>    When I used two client to connect to a same one VM by spice with
> setting “SPICE_DEBUG_ALLOW_MC=1”, the two clients worked, and the first
> client could redirect USB. However, the second client could not redirect
> USB device, It shows like the picture:
>
>
>
> I’m sure that there’re enough channels for USB redirection.
>
>
>
> Is this a problem? Or Is there any way that could resolve the second client
> ’s USB redirection problem?
>
>
>
> Thanks and Regards,
>
>
>
> Xuefeng
>
>
>
> Currently all character device channels (including USB one) do not support
> multiple channels, so the first client takes them all.
>
>
>
> Frediano
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20221121/5a682ba6/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 29613 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20221121/5a682ba6/attachment-0001.png>


More information about the Spice-devel mailing list