qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/usb/bus.c: print device ID when 'info usb' used
@ 2015-08-24 19:13 Programmingkid
  2015-08-28 11:50 ` Gerd Hoffmann
  0 siblings, 1 reply; 10+ messages in thread
From: Programmingkid @ 2015-08-24 19:13 UTC (permalink / raw)
  To: Gerd Hoffmann, qemu-devel qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1586 bytes --]

Print the ID of each device when 'info usb' is used in the monitor.

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>

---
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


[-- Attachment #2: Type: text/html, Size: 8092 bytes --]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-08-28 16:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-24 19:13 [Qemu-devel] [PATCH] hw/usb/bus.c: print device ID when 'info usb' used Programmingkid
2015-08-28 11:50 ` Gerd Hoffmann
2015-08-28 13:08   ` Programmingkid
2015-08-28 13:35     ` Daniel P. Berrange
2015-08-28 13:39       ` Programmingkid
2015-08-28 13:50         ` Daniel P. Berrange
2015-08-28 13:50         ` Gerd Hoffmann
2015-08-28 13:55           ` Programmingkid
2015-08-28 16:07             ` Peter Maydell
2015-08-28 16:09               ` Programmingkid

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).