]> git.proxmox.com Git - qemu.git/commit
usb-linux: fix device path aka physical port handling
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 10 May 2011 09:43:57 +0000 (11:43 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 26 May 2011 09:55:02 +0000 (11:55 +0200)
commit5557d820817028603d8a1446b0ddb62f7d267510
tree7713d8bf42a3e4fbe848237dee9e69e033e701fa
parent50b7963e72da6c31c2bebd435aeefd2966cd94ee
usb-linux: fix device path aka physical port handling

The device path isn't just a number.  It specifies the physical port
the device is connected to and in case the device is connected via
usb hub you'll have two numbers there, like this: "5.1".  The first
specifies the root port where the hub is plugged into, the second
specifies the port number of the hub where the device is plugged in.
With multiple hubs chained the string can become longer.

This patch renames devpath to port and makes it a string.   It also
adapts the sysfs parsing code accordingly.  The parser code is also more
strict now and skips the root hubs (which can't be assigned anyway).

The "info usbhost" monitor command now prints bus number, (os-assigned)
device address and physical port for each device.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-linux.c