Patchwork [7/7] usb: print attached status in info qtree

login
register
mail settings
Submitter Gerd Hoffmann
Date Oct. 26, 2009, 2:56 p.m.
Message ID <1256569011-20256-8-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/36922/
State New
Headers show

Comments

Gerd Hoffmann - Oct. 26, 2009, 2:56 p.m.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb-bus.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

Patch

diff --git a/hw/usb-bus.c b/hw/usb-bus.c
index 87dcc7f..99d185e 100644
--- a/hw/usb-bus.c
+++ b/hw/usb-bus.c
@@ -226,9 +226,10 @@  static void usb_bus_dev_print(Monitor *mon, DeviceState *qdev, int indent)
     USBDevice *dev = DO_UPCAST(USBDevice, qdev, qdev);
     USBBus *bus = usb_bus_from_device(dev);
 
-    monitor_printf(mon, "%*saddr %d.%d, speed %s, name %s\n", indent, "",
-                   bus->busnr, dev->addr,
-                   usb_speed(dev->speed), dev->devname);
+    monitor_printf(mon, "%*saddr %d.%d, speed %s, name %s%s\n",
+                   indent, "", bus->busnr, dev->addr,
+                   usb_speed(dev->speed), dev->devname,
+                   dev->attached ? ", attached" : "");
 }
 
 void usb_info(Monitor *mon)