diff options
Diffstat (limited to 'hw')
-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? |