Il giorno lun 21 nov 2022 alle ore 08:44 韩雪峰 <hanxuef...@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 <fredd...@gmail.com> > *发送时间:* 2022年11月18日 20:52 > *收件人:* 韩雪峰 <hanxuef...@360.cn> > *抄送:* spice-devel@lists.freedesktop.org > *主题:* Re: [Spice-devel] The second client cannot redirect USB > > > > Il giorno ven 18 nov 2022 alle ore 10:21 韩雪峰 <hanxuef...@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 >