<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 class="">
<div style="color: rgb(0, 0, 0); letter-spacing: 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; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class="">-----------------------------------</div><div class=""><blockquote type="cite" class=""></blockquote>Daynix Computing LTD<br class=""><blockquote type="cite" class=""></blockquote>Dmitry Fleytman, CTO<br class=""><blockquote type="cite" class=""></blockquote>Email: <a href="mailto:yan@daynix.com" class="">dmitry@daynix.com</a><br class=""><blockquote type="cite" class=""></blockquote>Phone: +972-54-2819481<br class=""><blockquote type="cite" class=""></blockquote>Web: <a href="http://www.daynix.com/" class="">www.daynix.com</a></div></div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 22 Sep 2015, at 18:52 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; 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 Sun, Aug 16, 2015 at 03:35:41PM +0300, Dmitry Fleytman wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 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; 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="">USB redirection flow on Windows includes a number of reset requests issued<br class="">to the port that hosts the device deing redirected.<br class=""><br class="">Each port reset emulates device removal and reinsertion and produces<br class="">corresponding hotplug events and a number of device list updates on<br class="">different levels of USB stack and USB redirection engine.<br class=""><br class="">As a result, queriyng USB device list performed by spice-gtk's hotplug<br class="">event handler may return inconsistens results if performed in parallel<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 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; 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="">'inconsistent'</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 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=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 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; 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="">to redirection flow.<br class=""><br class="">This patch suppresses handling of USB hotplug events during redirection<br class="">and injects a simulated hotplug event after redirection completion<br class="">in order to properly process real device list changes in case they<br class="">happened during the redirection flow.<br class=""><br class="">Signed-off-by: Kirill Moizik <<a href="mailto:kmoizik@redhat.com" class="">kmoizik@redhat.com</a>><br class="">Signed-off-by: Dmitry Fleytman <<a href="mailto:dfleytma@redhat.com" class="">dfleytma@redhat.com</a>><br class="">---<br class="">src/win-usb-dev.c | 17 +++++++++++++++++<br class="">1 file changed, 17 insertions(+)<br class=""><br class="">diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c<br class="">index 60bc434..78f1877 100644<br class="">--- a/src/win-usb-dev.c<br class="">+++ b/src/win-usb-dev.c<br class="">@@ -305,10 +305,18 @@ static void g_udev_client_set_property(GObject *gobject,<br class="">{<br class=""> GUdevClient *self = G_UDEV_CLIENT(gobject);<br class=""> GUdevClientPrivate *priv = self->priv;<br class="">+ gboolean old_val;<br class=""><br class=""> switch (prop_id) {<br class=""> case PROP_REDIRECTING:<br class="">+ old_val = priv->redirecting;<br class=""> priv->redirecting = g_value_get_boolean(value);<br class="">+ if (old_val && !priv->redirecting) {<br class="">+ /* This is a redirection completion case.<br class="">+ Inject hotplug event in case we missed device changes<br class="">+ during redirection processing. */<br class="">+ handle_dev_change(self);<br class="">+ }<br class=""> break;<br class=""> default:<br class=""> G_OBJECT_WARN_INVALID_PROPERTY_ID(gobject, prop_id, pspec);<br class="">@@ -409,6 +417,15 @@ static void handle_dev_change(GUdevClient *self)<br class=""> GList *lit, *sit; /* iterators for long-list and short-list */<br class=""> GUdevDevice *ldev, *sdev; /* devices on long-list and short-list */<br class=""><br class="">+ if (priv->redirecting == TRUE) {<br class="">+ /* On Windows, queriyng USB device list may return inconsistent results<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 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; 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="">'querying'</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 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=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 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; 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="">+ if performed in parallel to redirection flow.<br class="">+ A simulated hotplug event will be injected after redirection<br class="">+ completion in order to process real device list changes that may<br class="">+ had place during redirection process. */<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 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; 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="">'had taken place’</span></div></blockquote><div><br class=""></div><div><br class=""></div><div>All 3 issues fixed. thanks.</div><div><br class=""></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; 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; 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="">+ return;<br class="">+ }<br class="">+<br class=""> dev_count = g_udev_client_list_devices(self, &now_devs, &err,<br class=""> __FUNCTION__);<br class=""> g_return_if_fail(dev_count >= 0);<br class="">--<span class="Apple-converted-space"> </span><br class="">2.4.3<br class=""><br class="">_______________________________________________<br class="">Spice-devel mailing list<br class=""><a href="mailto:Spice-devel@lists.freedesktop.org" class="">Spice-devel@lists.freedesktop.org</a><br class=""><a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" class="">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a></blockquote></div></blockquote></div><br class=""></body></html>