[Spice-devel] About spice usb redirection

Hans de Goede hdegoede at redhat.com
Fri Sep 30 02:27:32 PDT 2011


Hi,

Thanks for testing the usb code, and many thanks for the 2 bug reports!

I just send a patch for the first issue (segfault when compiled with --disable-smartcard)
to the list. I'll push that to the official repo as soon as I get an ack for it.

The second issue (infinite recursion in usbredir) has been fixed in my
usbredir repository.

Regards,

Hans


On 09/29/2011 03:26 AM, coolper chen wrote:
> hi,
> I'm testing spice usb redirection,it works great,and it's better than usbip, thanks.
> I got 1 bug about spice-gtk,if I compile spice-gtk with --disable-smartcard,usb redir will cause segment fault;the bug is here:
> generated_demarshallers.c:
>
> spice_parse_channel_func_t spice_get_server_channel_parser(uint32_t channel, unsigned int *max_message_type)
> {
> static struct {spice_parse_channel_func_t func; unsigned int max_messages; } channels[10] = {
> { NULL, 0 },
> { parse_MainChannel_msg, 111},
> { parse_DisplayChannel_msg, 315},
> { parse_InputsChannel_msg, 111},
> { parse_CursorChannel_msg, 108},
> { parse_PlaybackChannel_msg, 106},
> { parse_RecordChannel_msg, 104},
> { parse_TunnelChannel_msg, 108},
> #ifdef USE_SMARTCARD
> { parse_SmartcardChannel_msg, 101},
> #endif /* USE_SMARTCARD */
> { parse_UsbredirChannel_msg, 101}
> };
> if (channel < 10) {
> if (max_message_type != NULL) {
> *max_message_type = channels[channel].max_messages;
> }
> return channels[channel].func;
> }
> return NULL;
> }
> when not define USE_SMARTCARD,the cannels[10] array is wrong about usbredir channel, it may fix with:
> #ifdef USE_SMARTCARD
> { parse_SmartcardChannel_msg, 101},
> #else
> {NULL, 0},
> #endif /* USE_SMARTCARD */
>
> I got 1 bug about usbredir lib when I test a usb device which has two functions(headphone and microphone);the bug is here:
> usbredirhost.c:
> static int usbredirhost_cancel_iso_stream(struct usbredirhost *host,
>
>      uint8_t ep, int do_free)
> {
>      LOCK(host);
>      return usbredirhost_cancel_iso_stream(host, ep, do_free);
>      UNLOCK(host);
> }
> the function is infinite recursive call;I guess it call the wrong function, so I changed to:
> static int usbredirhost_cancel_iso_stream(struct usbredirhost *host,
> uint8_t ep, int do_free)
> {
>      LOCK(host);
>         return  usbredirhost_cancel_iso_stream_unlocked(host, ep, do_free);
>      UNLOCK(host);
> }
> Then,it works perfect.
>
>
> Coolper Chen
>
>
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list