yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From 4de8173704a782b602f2d5412b2b9d08ceb9fc1d Mon Sep 17 00:00:00 2001
9ae3a8
From: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
Date: Tue, 13 Aug 2013 08:31:21 +0200
9ae3a8
Subject: usb/host-libusb: Fix building with libusb git master code
9ae3a8
9ae3a8
RH-Author: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
Message-id: <1376382681-14630-1-git-send-email-stefanha@redhat.com>
9ae3a8
Patchwork-id: 53201
9ae3a8
O-Subject: [PATCH] usb/host-libusb: Fix building with libusb git master code
9ae3a8
Bugzilla: 996469
9ae3a8
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
9ae3a8
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
RH-Acked-by: Hans de Goede <hdegoede@redhat.com>
9ae3a8
9ae3a8
From: Hans de Goede <hdegoede@redhat.com>
9ae3a8
9ae3a8
Upstream-status: bc45de8c21dfc3bc3896a78b33d5a6d9e710dfff
9ae3a8
Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=6159903
9ae3a8
BZ: 996469
9ae3a8
9ae3a8
The next libusb release will deprecate libusb_get_port_path, and since
9ae3a8
we compile with -Werror, this breaks the build.
9ae3a8
9ae3a8
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9ae3a8
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9ae3a8
(cherry picked from commit bc45de8c21dfc3bc3896a78b33d5a6d9e710dfff)
9ae3a8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
9ae3a8
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
9ae3a8
index 3a582c5..0c12b0f 100644
9ae3a8
--- a/hw/usb/host-libusb.c
9ae3a8
+++ b/hw/usb/host-libusb.c
9ae3a8
@@ -241,7 +241,11 @@ static int usb_host_get_port(libusb_device *dev, char *port, size_t len)
9ae3a8
     size_t off;
9ae3a8
     int rc, i;
9ae3a8
 
9ae3a8
+#if LIBUSBX_API_VERSION >= 0x01000102
9ae3a8
+    rc = libusb_get_port_numbers(dev, path, 7);
9ae3a8
+#else
9ae3a8
     rc = libusb_get_port_path(ctx, dev, path, 7);
9ae3a8
+#endif
9ae3a8
     if (rc < 0) {
9ae3a8
         return 0;
9ae3a8
     }