qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2] hw/usb/bus.c: print device ID when 'info usb' us


From: Programmingkid
Subject: [Qemu-devel] [PATCH v2] hw/usb/bus.c: print device ID when 'info usb' used
Date: Fri, 28 Aug 2015 14:54:07 -0400

Print the ID (if available) of each device when 'info usb' is used in the 
monitor.

Signed-off-by: John Arbuckle <address@hidden>

---
Added conditional code that only prints the ID if it is available.

 hw/usb/bus.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 5f39e1e..6da6695 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -655,9 +655,17 @@ 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);
+            if (dev->qdev.id) {  /* Print ID if available */
+                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);
+            } else {
+                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);
+            }
         }
     }
 }
-- 
1.7.5.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]