diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-03-17 00:14:49 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-03-17 00:14:49 +0100 |
commit | dba37f6f3f2b8cbec0cc4be630b63841d0a22d5c (patch) | |
tree | c634338462527002220e60c47db893c62ac3f275 /hw/usb/dump.c | |
parent | 4c74173c15d2bf2ff498dba6ce88728978f42a72 (diff) | |
download | qemu-dba37f6f3f2b8cbec0cc4be630b63841d0a22d5c.tar.gz |
usbdump: do not hard-code bus number, use nr from USBBus
Instead of changing bus.c (next_usb_bus) and possibly breaking
configurations relying on this number, just add one in the dump code
for cosmetic purposes.
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'hw/usb/dump.c')
-rw-r--r-- | hw/usb/dump.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/usb/dump.c b/hw/usb/dump.c index 2c94c6426d..6d35d46963 100644 --- a/hw/usb/dump.c +++ b/hw/usb/dump.c @@ -170,6 +170,7 @@ static void init_from_usbpacket(UsbDumpState *s, struct usbmon_packet *u, const USBPacket *p, char ev_type, unsigned datalen) { const USBDevice *dev = p->ep->dev; + const USBBus *bus = usb_bus_from_device((USBDevice *) dev); bool is_data_in; if (p->ep->type == USB_ENDPOINT_XFER_CONTROL) { @@ -194,7 +195,8 @@ static void init_from_usbpacket(UsbDumpState *s, struct usbmon_packet *u, u->devnum = dev->addr; /* uint16_t - 12: Bus number */ - u->busnum = 1; /* does anybody care about this hard-coded bus? */ + /* The Linux guest starts numbering at 1 instead of 0 like QEMU does. */ + u->busnum = bus->busnr + 1; // TODO: usb_process_one() checks for EP0 (Default Control Pipe). Should we // also do that here? |