Skip to contentSkip to conversation

usb: print device id in "info usb" monitor command

PATCH New Gerd Hoffmann 1 participant 1 message Oct 6, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: print device id in "info usb" monitor command

---
 hw/usb/bus.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
hw/usb/bus.c +6 -3
index 5f39e1e..ee6b43a 100644
@@ -655,9 +655,12 @@ 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%s%s\n",
+                           bus->busnr, dev->addr, port->path,
+                           usb_speed(dev->speed), dev->product_desc,
+                           dev->qdev.id ? ", ID: " : "",
+                           dev->qdev.id ?: "");
         }
     }
 }
Signature · 1 line
1.8.3.1