qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 12/17] char: Convert qemu_chr_info() to QObject


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 12/17] char: Convert qemu_chr_info() to QObject
Date: Mon, 23 Nov 2009 16:39:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Luiz Capitulino <address@hidden> writes:

> On Fri, 20 Nov 2009 15:10:20 +0100
> Markus Armbruster <address@hidden> wrote:
>
>> Luiz Capitulino <address@hidden> writes:
>> 
>> > Each device is represented by a QDict. The returned QObject is a QList
>> > of all devices.
>> >
>> > This commit should not change user output.
>> >
>> > Signed-off-by: Luiz Capitulino <address@hidden>
>> > ---
>> >  monitor.c   |    3 ++-
>> >  qemu-char.c |   43 +++++++++++++++++++++++++++++++++++++++++--
>> >  qemu-char.h |    4 +++-
>> >  3 files changed, 46 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/monitor.c b/monitor.c
>> > index e4fed10..a0a9281 100644
>> > --- a/monitor.c
>> > +++ b/monitor.c
[...]
>> > @@ -2465,13 +2466,51 @@ void qemu_chr_close(CharDriverState *chr)
>> >      qemu_free(chr);
>> >  }
>> >  
>> > -void qemu_chr_info(Monitor *mon)
>> > +static void qemu_chr_print_qlist(QObject *obj, void *opaque)
>> 
>> Why *_qlist?  It prints a qdict, which happens to be a list element, but
>> this function doesn't know that.
>
>  It does know, as it was written with the purpose of printing the elements
> of a qlist.

You knew it when you wrote it, but the function itself has nothing to do
with lists.

Elsewhere, you call such functions *_dict(), which makes sense to me,
because it prints a dictionary, or *_iter(), which I is also okay.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]