Gerd Hoffmann <kra...@redhat.com> writes:

> On 01/18/10 11:15, Markus Armbruster wrote:
>> Nathan Baum<nat...@parenthephobia.org.uk>  writes:
>>
>>>>> +static QObject *usb_bus_dev_info(Monitor *mon, DeviceState *qdev)
>>>>> +{
>>>>> +    USBDevice *dev = DO_UPCAST(USBDevice, qdev, qdev);
>>>>> +    USBBus *bus = usb_bus_from_device(dev);
>>>>> +    return qobject_from_jsonf("{'busnr': %d, 'addr':%d, 'speed': %s, 
>>>>> 'desc': %s, 'attached': %i}",
>>>>> +                              bus->busnr,
>>>>
>>>> As for PCI, 'busnr' belongs to the bus, not the device.
>
> You want be able to figure which bus the device is attached to.
>
> I think you actually can because the command returns the device tree
> converted into a qobject tree, correct?

Correct.

[...]


Reply via email to