[Spice-devel] [PATCH spice-gtk 5/6] usbredir: Add a spice_usb_device_manager_can_redirect_device function

Hans de Goede hdegoede at redhat.com
Wed Feb 22 06:55:53 PST 2012


Hi,

On 02/22/2012 03:12 PM, Marc-André Lureau wrote:
> The patch looks fine in general.
>
> You like to use a lot GError in general, which is a good thing. But we
> didn't have so many error conditions reported until now. You shouldn't
> be affraid to introduce and use different error codes. That would
> allow the caller to do something smart about it (may sound silly, but
> perhaps it could create new channel automatically, treat some errors
> as critical or ignore others, or things like that)

Understood. I'll look into doing a follow up patch introducing various
error codes for different USB error conditions.

>
> On Tue, Feb 21, 2012 at 3:12 PM, Hans de Goede<hdegoede at redhat.com>  wrote:
>> +    /* When we run the channel is still "in use", it only becomes free
>> +       after we run, so we update our status in idle. */
>> +    g_idle_add(spice_usb_device_widget_update_status, self);
>
> I don't really understand the comment. Couldn't we set a flag saying
> that update_status() should be called "after we run", when we reached
> the condition, instead of just adding an untracked idle?

Since I was touching the device-error signal emit code anyways I've changed
it to first set channel->device to NULL (through calling device_disconnect())
and only then ask the usb device manager to emit the signal, removing the
need to do this in idle. And I've changed this to a direct call in my local
tree.

Regards,

Hans


More information about the Spice-devel mailing list