Print the ID of each device when 'info usb' is used in the monitor.
Signed-off-by: John Arbuckle <[email protected]>
---
This patch is easier to test when the qdev-monitor.c patch I
also submitted is applied first. It can still be tested without
it. Just run QEMU with the -usb option. Then go to the monitor
and type "device_add usb-mouse,id=mouse-one". You will see the
ID printed with the usb-mouse's info when you type 'info usb'.
The ID is used by device_del to remove a device from QEMU. With
this patch, the user can actually see the ID of the usb device
making it possible to actually pick the right device to remove.
hw/usb/bus.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 5f39e1e..d2a726c 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -655,9 +655,11 @@ void hmp_info_usb(Monitor *mon, const QDict *qdict)
dev = port->dev;
if (!dev)
continue;
- monitor_printf(mon, " Device %d.%d, Port %s, Speed %s Mb/s,
Product %s\n",
- bus->busnr, dev->addr, port->path,
usb_speed(dev->speed),
- dev->product_desc);
+ monitor_printf(mon, " Device %d.%d, Port %s, Speed %s Mb/s,"
+ "Product %s, ID %s\n",
+ bus->busnr, dev->addr, port->path,
+ usb_speed(dev->speed),
+ dev->product_desc, dev->qdev.id);
}
}
}
--
1.7.5.4