diff --git a/SOURCES/0002-Don-t-print-warning-when-resetting-a-missing-device.patch b/SOURCES/0002-Don-t-print-warning-when-resetting-a-missing-device.patch new file mode 100644 index 0000000..2f110c3 --- /dev/null +++ b/SOURCES/0002-Don-t-print-warning-when-resetting-a-missing-device.patch @@ -0,0 +1,42 @@ +From 39aa3c69f61bba28856a3eef3fe4ab37a3968e88 Mon Sep 17 00:00:00 2001 +From: Jonathon Jongsma +Date: Thu, 10 Aug 2017 10:41:57 -0500 +Subject: [PATCH usbredir] Don't print warning when resetting a missing device + +When usbredirhost clears the current device, it resets the device and +attempts to re-attach the kernel driver for the device. The current +device is cleared when the API user explicitly sets a new device with +usbredirhost_set_device(). However, some API users call +usbredirhost_set_device(..., NULL) to clear the current device when the +redirected device has been unplugged. In this scenario, resetting the +device will fail and print a warning to the terminal. Since this is an +expected scenario, we should simply handle it rather than printing an +warning. + +Resolves: rhbz#1442963 +Signed-off-by: Jonathon Jongsma +Acked-by: Frediano Ziglio +--- + usbredirhost/usbredirhost.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c +index a6bf8b3..3666227 100644 +--- a/usbredirhost/usbredirhost.c ++++ b/usbredirhost/usbredirhost.c +@@ -604,7 +604,11 @@ static void usbredirhost_release(struct usbredirhost *host, int attach_drivers) + if (!(host->quirks & QUIRK_DO_NOT_RESET)) { + r = libusb_reset_device(host->handle); + if (r != 0) { +- ERROR("error resetting device: %s", libusb_error_name(r)); ++ /* if we're releasing the device because it was removed, resetting ++ * will fail. Don't print a warning in this situation */ ++ if (r != LIBUSB_ERROR_NO_DEVICE) { ++ ERROR("error resetting device: %s", libusb_error_name(r)); ++ } + return; + } + } +-- +2.13.6 + diff --git a/SPECS/usbredir.spec b/SPECS/usbredir.spec index e2a28c2..75087cc 100644 --- a/SPECS/usbredir.spec +++ b/SPECS/usbredir.spec @@ -1,6 +1,6 @@ Name: usbredir Version: 0.7.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: USB network redirection protocol libraries Group: System Environment/Libraries License: LGPLv2+ @@ -8,6 +8,7 @@ URL: https://www.spice-space.org Source0: https://www.spice-space.org/download/%{name}/%{name}-%{version}.tar.bz2 # Some patches from upstream git (drop at next rebase) Patch1: 0001-usbredirhost-Fix-Wformat-warning.patch +Patch2: 0002-Don-t-print-warning-when-resetting-a-missing-device.patch BuildRequires: libusb1-devel >= 1.0.20 %description @@ -48,6 +49,7 @@ A simple USB host TCP server, using libusbredirhost. %prep %setup -q %patch1 -p1 +%patch2 -p1 %build @@ -81,6 +83,10 @@ rm $RPM_BUILD_ROOT%{_libdir}/libusbredir*.la %changelog +* Fri Nov 17 2017 Jonathon Jongsma - 0.7.1-3 +- Don't print a warning when resetting a removed device + Resolves: rhbz#1442963 + * Tue Dec 20 2016 Pavel Grunt - 0.7.1-2 - Rebuild to add USB3 support Resolves: rhbz#976685