<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.30.3">
</HEAD>
<BODY>
hi,<BR>
I'm testing spice usb redirection,it works great,and it's better than usbip, thanks.<BR>
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:<BR>
generated_demarshallers.c:<BR>
<BR>
spice_parse_channel_func_t spice_get_server_channel_parser(uint32_t channel, unsigned int *max_message_type)<BR>
{<BR>
static struct {spice_parse_channel_func_t func; unsigned int max_messages; } channels[10] = {<BR>
{ NULL, 0 },<BR>
{ parse_MainChannel_msg, 111},<BR>
{ parse_DisplayChannel_msg, 315},<BR>
{ parse_InputsChannel_msg, 111},<BR>
{ parse_CursorChannel_msg, 108},<BR>
{ parse_PlaybackChannel_msg, 106},<BR>
{ parse_RecordChannel_msg, 104},<BR>
{ parse_TunnelChannel_msg, 108},<BR>
#ifdef USE_SMARTCARD<BR>
{ parse_SmartcardChannel_msg, 101},<BR>
#endif /* USE_SMARTCARD */<BR>
{ parse_UsbredirChannel_msg, 101}<BR>
};<BR>
if (channel < 10) {<BR>
if (max_message_type != NULL) {<BR>
*max_message_type = channels[channel].max_messages;<BR>
}<BR>
return channels[channel].func;<BR>
}<BR>
return NULL;<BR>
}<BR>
when not define USE_SMARTCARD,the cannels[10] array is wrong about usbredir channel, it may fix with:<BR>
#ifdef USE_SMARTCARD<BR>
{ parse_SmartcardChannel_msg, 101},<BR>
<FONT COLOR="#ff0000">#else</FONT><BR>
<FONT COLOR="#ff0000"> {NULL, 0},</FONT><BR>
#endif /* USE_SMARTCARD */<BR>
<BR>
I got 1 bug about usbredir lib when I test a usb device which has two functions(headphone and microphone);the bug is here:<BR>
<TT>usbredirhost.c</TT>:<BR>
<TT>static int usbredirhost_cancel_iso_stream(struct usbredirhost *host,</TT>
<PRE>
<TT> uint8_t ep, int do_free)</TT>
<TT>{</TT>
<TT> LOCK(host);</TT>
<TT> return usbredirhost_cancel_iso_stream(host, ep, do_free);</TT>
<TT> UNLOCK(host);</TT>
<TT>}</TT>
the function is infinite recursive call;I guess it call the wrong function, so I changed to:
<TT>static int usbredirhost_cancel_iso_stream(struct usbredirhost *host,</TT>
<TT>uint8_t ep, int do_free)</TT>
<TT>{</TT>
<TT> LOCK(host);</TT>
<TT> return </TT><TT><FONT COLOR="#ff0000">usbredirhost_cancel_iso_stream_unlocked</FONT></TT><TT>(host, ep, do_free);</TT>
<TT> UNLOCK(host);</TT>
<TT>}</TT>
Then,it works perfect.
Coolper Chen
</PRE>
</BODY>
</HTML>