[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/5] PCI: Convert pci_info() to QObject
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 3/5] PCI: Convert pci_info() to QObject |
Date: |
Wed, 20 Jan 2010 08:32:43 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Luiz Capitulino <address@hidden> writes:
> On Mon, 18 Jan 2010 18:16:21 +0100
> Markus Armbruster <address@hidden> wrote:
[...]
>> > +/**
>> > + * do_pci_info(): PCI buses and devices information
>> > + *
>> > + * The returned QObject is a QList of all buses. Each bus is
>> > + * represented by a QDict, which has a key with a QList of all
>> > + * PCI devices attached to it. Each device is represented by
>> > + * a QDict.
>> > + *
>> > + * The bus QDict contains the following:
>> > + *
>> > + * - "bus": bus number
>> > + * - "devices": a QList of QDicts, each QDict represents a PCI
>> > + * device
>> > + *
>> > + * The PCI device QDict contains the following:
>> > + *
>> > + * - "bus": bus number
>>
>> This is redundant, because a device QDict is always contained in a bus
>> QDict, which has the bus number.
>
> Turns out I find this redundancy convenient for clients, because if
> you pass the device dict down to a function you have the bus number
> there if you need it (otherwise you'd need to pass the bus number
> too).
>
> I'm writing a shell in Python and found this convenient, is it that
> bad?
It's not bad, it's redundant :)
A little convenient redundancy is okay. I just don't want accidental
redundancy.
If you keep it, I'd suggest document that it's identical to the parent's
bus member.
[...]