From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NCYtM-0005KZ-NZ for qemu-devel@nongnu.org; Mon, 23 Nov 2009 08:23:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NCYtJ-0005H4-2C for qemu-devel@nongnu.org; Mon, 23 Nov 2009 08:23:44 -0500 Received: from [199.232.76.173] (port=45206 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCYtI-0005Gh-LK for qemu-devel@nongnu.org; Mon, 23 Nov 2009 08:23:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:24482) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NCYtG-0007dp-Jz for qemu-devel@nongnu.org; Mon, 23 Nov 2009 08:23:38 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nANDNbmZ009407 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 Nov 2009 08:23:37 -0500 Date: Mon, 23 Nov 2009 11:23:31 -0200 From: Luiz Capitulino Subject: Re: [Qemu-devel] [PATCH 12/17] char: Convert qemu_chr_info() to QObject Message-ID: <20091123112331.6ad22f22@doriath> In-Reply-To: References: <1258489944-12159-1-git-send-email-lcapitulino@redhat.com> <1258489944-12159-13-git-send-email-lcapitulino@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org On Fri, 20 Nov 2009 15:10:20 +0100 Markus Armbruster wrote: > Luiz Capitulino 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 > > --- > > 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 > > @@ -2040,7 +2040,8 @@ static const mon_cmd_t info_cmds[] = { > > .args_type = "", > > .params = "", > > .help = "show the character devices", > > - .mhandler.info = qemu_chr_info, > > + .user_print = qemu_chr_info_print, > > + .mhandler.info_new = qemu_chr_info, > > }, > > { > > .name = "block", > > diff --git a/qemu-char.c b/qemu-char.c > > index 5a81e8f..7fcde98 100644 > > --- a/qemu-char.c > > +++ b/qemu-char.c > > @@ -32,6 +32,7 @@ > > #include "hw/usb.h" > > #include "hw/baum.h" > > #include "hw/msmouse.h" > > +#include "qemu-objects.h" > > > > #include > > #include > > @@ -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.