qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Nathan Baum <nathan@parenthephobia.org.uk>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC,PATCH 08/11] qdev: Add usb_bus_dev_info
Date: Mon, 18 Jan 2010 11:35:35 +0100	[thread overview]
Message-ID: <4B543977.8050206@redhat.com> (raw)
In-Reply-To: <m3r5pn4t33.fsf@blackfin.pond.sub.org>

On 01/18/10 11:15, Markus Armbruster wrote:
> Nathan Baum<nathan@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?

Note: busnr is *not* fixed, it can be changed by the guest (maybe not 
for the primary, but surely for any secondary by writing to a pci bridge 
register).

>> Hmm. In cases like this, is it appropriate to modify the output of the
>> existing "info qtree" when it is modified to use the QObject data?
 >>
>> Would it be sensible to go the (probably small amount of) effort to
>> change the print functions to print exactly they do now, and put changes
>> to their output in different patches so they can easily be dropped if
>> necessary?
>
> We might want to change info qtree output anyway if we show bus
> information separately there...

Indeed.

>>> Hmm, we don't have the infrastructure to return bus information, yet.
>>> "info qtree" hardcodes printing of name and type.  Gerd, what do you
>>> think?

Adding a ->print_bus() function (or whatever the qmp aequivalent will 
be) to BusInfo is fine with me.

> Regardless, I think we should first decide what data we want to transmit
> over QMP, and how to structure it, then figure out if and how to change
> its human readable presentation.

Sounds like a plan ;)

cheers,
   Gerd

  reply	other threads:[~2010-01-18 10:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1261861899-1984-1-git-send-email-nathan@parenthephobia.org.uk>
     [not found] ` <1261861899-1984-5-git-send-email-nathan@parenthephobia.org.uk>
2010-01-15 18:06   ` [Qemu-devel] [RFC,PATCH 04/11] qdev: pcibus_dev_info Markus Armbruster
     [not found] ` <1261861899-1984-9-git-send-email-nathan@parenthephobia.org.uk>
2010-01-15 18:14   ` [Qemu-devel] [RFC,PATCH 08/11] qdev: Add usb_bus_dev_info Markus Armbruster
2010-01-15 22:14     ` Nathan Baum
2010-01-18 10:15       ` Markus Armbruster
2010-01-18 10:35         ` Gerd Hoffmann [this message]
2010-01-18 12:44           ` Markus Armbruster
     [not found] ` <1261861899-1984-7-git-send-email-nathan@parenthephobia.org.uk>
2010-01-15 18:17   ` [Qemu-devel] [RFC,PATCH 06/11] qdev: sysbus_dev_info Markus Armbruster
     [not found] ` <1261861899-1984-11-git-send-email-nathan@parenthephobia.org.uk>
2010-01-15 18:30   ` [Qemu-devel] [RFC, PATCH 10/11] qdev: Add do_info_qbus and friends Markus Armbruster
2010-01-18 10:37     ` Gerd Hoffmann
2010-01-18 12:34       ` Markus Armbruster
2010-01-18 12:59         ` Gerd Hoffmann
2010-01-15 18:31 ` [Qemu-devel] [RFC,PATCH 00/11] Half-convert info qtree to QMP Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B543977.8050206@redhat.com \
    --to=kraxel@redhat.com \
    --cc=armbru@redhat.com \
    --cc=nathan@parenthephobia.org.uk \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).