<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 11, 2015, at 15:41 PM, Christophe Fergeau <<a href="mailto:cfergeau@redhat.com" class="">cfergeau@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On Mon, Aug 03, 2015 at 04:10:47PM +0300, Kirill Moizik wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">From: Kirill Moizik <<a href="mailto:kmoizik@redhat.com" class="">kmoizik@redhat.com</a>><br class=""><br class="">---<br class="">src/channel-usbredir-priv.h | 4 +++<br class="">src/channel-usbredir.c | 20 ++++++++++++-<br class="">src/map-file | 1 +<br class="">src/usb-device-manager.c | 73 +++++++++++++++++++++++++++++++++++++++++++++<br class="">src/usb-device-manager.h | 8 +++++<br class="">5 files changed, 105 insertions(+), 1 deletion(-)<br class=""><br class="">diff --git a/src/channel-usbredir-priv.h b/src/channel-usbredir-priv.h<br class="">index f2e17e3..6e6d58b 100644<br class="">--- a/src/channel-usbredir-priv.h<br class="">+++ b/src/channel-usbredir-priv.h<br class="">@@ -33,6 +33,10 @@ G_BEGIN_DECLS<br class="">void spice_usbredir_channel_set_context(SpiceUsbredirChannel *channel,<br class=""> libusb_context *context);<br class=""><br class="">+void spice_usbredir_channel_disconnect_device_async(SpiceUsbredirChannel *channel,<br class="">+ GSimpleAsyncResult *simple,<br class="">+ GCancellable *cancellable);<br class="">+<br class="">/* Note the context must be set, and the channel must be brought up<br class=""> (through spice_channel_connect()), before calling this. */<br class="">void spice_usbredir_channel_connect_device_async(<br class="">diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c<br class="">index f1bd815..4cf1173 100644<br class="">--- a/src/channel-usbredir.c<br class="">+++ b/src/channel-usbredir.c<br class="">@@ -428,10 +428,12 @@ void spice_usbredir_channel_disconnect_device(GSimpleAsyncResult *simple,<br class=""> GObject *object,<br class=""> GCancellable *cancellable)<br class="">{<br class="">- SpiceUsbredirChannelPrivate *priv = channel->priv;<br class=""><br class="">+ SpiceUsbredirChannel *channel = SPICE_USBREDIR_CHANNEL(object);<br class="">+ SpiceUsbredirChannelPrivate *priv = channel->priv;<br class=""> CHANNEL_DEBUG(channel, "disconnecting device from usb channel %p", channel);<br class=""><br class="">+ g_mutex_lock(priv->flows_mutex);<br class=""> switch (priv->state) {<br class=""> case STATE_DISCONNECTED:<br class=""> case STATE_DISCONNECTING:<br class="">@@ -465,6 +467,22 @@ void spice_usbredir_channel_disconnect_device(GSimpleAsyncResult *simple,<br class=""> priv->state = STATE_DISCONNECTED;<br class=""> break;<br class=""> }<br class="">+ g_mutex_unlock(priv->flows_mutex);<br class="">+}<br class="">+<br class="">+void spice_usbredir_channel_disconnect_device_async(SpiceUsbredirChannel *channel,<br class="">+ GSimpleAsyncResult *simple,<br class="">+ GCancellable *cancellable)<br class="">+{<br class="">+ if (channel) {<br class="">+ g_object_ref(channel);<br class="">+ g_simple_async_result_run_in_thread(simple,<br class="">+ spice_usbredir_channel_disconnect_device,<br class="">+ G_PRIORITY_DEFAULT,<br class="">+ cancellable);<br class="">+ } else {<br class="">+ g_simple_async_result_complete_in_idle(simple);<br class="">+ }<br class="">}<br class=""><br class="">G_GNUC_INTERNAL<br class="">diff --git a/src/map-file b/src/map-file<br class="">index 6d5a5ef..042889f 100644<br class="">--- a/src/map-file<br class="">+++ b/src/map-file<br class="">@@ -120,6 +120,7 @@ spice_usb_device_get_type;<br class="">spice_g_udev_set_redirecting;<br class="">spice_usb_device_manager_can_redirect_device;<br class="">spice_usb_device_manager_connect_device_async;<br class="">+spice_usb_device_manager_disconnect_device_async;<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I don't think this needs to be here.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>Moved to corresponding commit...</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">spice_usb_device_manager_connect_device_finish;<br class="">spice_usb_device_manager_disconnect_device;<br class="">spice_usb_device_manager_get;<br class="">diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c<br class="">index 901a1b9..ebd9307 100644<br class="">--- a/src/usb-device-manager.c<br class="">+++ b/src/usb-device-manager.c<br class="">@@ -1697,6 +1697,79 @@ void spice_usb_device_manager_disconnect_device(SpiceUsbDeviceManager *self,<br class="">#endif<br class="">}<br class=""><br class="">+typedef struct _disconnect_cb_data<br class="">+{<br class="">+ SpiceUsbDeviceManager *self;<br class="">+ GSimpleAsyncResult *result;<br class="">+ SpiceUsbDevice *device;<br class="">+} disconnect_cb_data;<br class="">+<br class="">+#ifdef USE_USBREDIR<br class="">+static<br class="">+void spice_usb_device_manager_disconnect_device_async_cb(GObject *gobject,<br class="">+ GAsyncResult *channel_res,<br class="">+ gpointer user_data)<br class="">+{<br class="">+ disconnect_cb_data *data = user_data;<br class="">+ GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT(data->result);<br class="">+ SpiceUsbDeviceManager *self = SPICE_USB_DEVICE_MANAGER(data->self);<br class="">+<br class="">+#ifdef G_OS_WIN32<br class="">+ if (self->priv->use_usbclerk) {<br class="">+ spice_usb_device_manager_driver_uninstall_async(self, data->device);<br class="">+ }<br class="">+#endif<br class="">+<br class="">+ g_object_set(self, "redirecting", FALSE, NULL);<br class="">+<br class="">+#ifndef USE_LIBUSB_HOTPLUG<br class="">+ spice_g_udev_set_redirecting(FALSE);<br class="">+#endif<br class="">+ g_simple_async_result_complete(result);<br class="">+ g_object_unref(result);<br class="">+ g_object_unref(gobject);<br class="">+ g_free(data);<br class="">+}<br class="">+#endif<br class="">+<br class="">+void spice_usb_device_manager_disconnect_device_async(SpiceUsbDeviceManager *self,<br class="">+ SpiceUsbDevice *device,<br class="">+ GCancellable *cancellable,<br class="">+ GAsyncReadyCallback callback,<br class="">+ gpointer user_data)<br class="">+{<br class="">+#ifdef USE_USBREDIR<br class="">+ GSimpleAsyncResult *nested;<br class="">+ GSimpleAsyncResult *result;<br class="">+ g_return_if_fail(SPICE_IS_USB_DEVICE_MANAGER(self));<br class="">+<br class="">+ g_return_if_fail(device != NULL);<br class="">+ g_return_if_fail(self->priv->redirecting == FALSE);<br class="">+<br class="">+ SPICE_DEBUG("disconnecting device %p", device);<br class="">+<br class="">+ SpiceUsbredirChannel *channel;<br class="">+<br class="">+ g_object_set(self,"redirecting", TRUE, NULL);<br class="">+#ifndef USE_LIBUSB_HOTPLUG<br class="">+ spice_g_udev_set_redirecting(TRUE);<br class="">+#endif<br class="">+ channel = spice_usb_device_manager_get_channel_for_dev(self, device);<br class="">+ nested = g_simple_async_result_new(G_OBJECT(self), callback, user_data,<br class="">+ spice_usb_device_manager_disconnect_device_async);<br class="">+ disconnect_cb_data *data = g_new(disconnect_cb_data,1);<br class="">+ data->self = self;<br class="">+ data->result = nested;<br class="">+ data->device = device;<br class="">+<br class="">+ result = g_simple_async_result_new(G_OBJECT(channel),<br class="">+ spice_usb_device_manager_disconnect_device_async_cb, data,<br class="">+ spice_usb_device_manager_disconnect_device_async);<br class="">+<br class="">+ spice_usbredir_channel_disconnect_device_async(channel,result,cancellable);<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Missing spaces between ‘,'</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div><br class=""></div><div>Thanks, fixed.</div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Christophe</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Spice-devel mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:Spice-devel@lists.freedesktop.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Spice-devel@lists.freedesktop.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a></div></blockquote></div><br class=""></body></html>